[Bro-Dev] #558: /topic/gilbert/ascii-header

Bro Tracker bro at tracker.bro-ids.org
Wed Aug 17 15:59:33 PDT 2011


#558: /topic/gilbert/ascii-header
----------------------------+----------------------
  Reporter:  gclark         |      Owner:  robin
      Type:  Merge Request  |     Status:  assigned
  Priority:  Normal         |  Milestone:  Bro1.6
 Component:  Bro            |    Version:
Resolution:                 |   Keywords:  logging
----------------------------+----------------------

Comment (by gclark):

 Replying to [comment:7 robin]:
 > I just noticed that setting awk's FS only works inside BEGIN, not
 > later. What I was hoping to use is something like this:
 >
 >     {{{
 >     echo -e "#separator ;\n1;2;3;4\n" | awk '/#separator/ {FS=$2} {print
 $1}'
 >     }}}
 >
 > But that doesn't work unfortinately.

 Are you sure that echo statement is doing what I think you think that echo
 statement is doing?  The above does recognize / use FS when I leave -e out
 of the echo.

 Alternatively, there's always something like:

 {{{
 echo `head -n 1 hdr_test.log | sed 's/^#separator\s*//'`
 }}}

 which is pretty close to what I'm doing in Python; it's not especially
 efficient, but it is relatively simple.

-- 
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/558#comment:8>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list