Hello everyone - I have a log file which is in the following format:
19476 2013-04-05,12:10:51.909293 host:internal.machine44.company.net main INFO Running normally with ACTION=<processing> FAN_A=<OK> FAN_B=<OK> SEND=<Sent mail (221 2.0.0 Service closing transmission channel)> FAILURE=<2>
What I'd like to do is split this into a few different pieces. The first number is a line number and I do not need it, as well as the host: information. So I'd like to get the data into this format:
$date => 2013-04-05,12:10:51.909293 $info[ACTION] => processing $info[FAN_A] => OK $info[FAN_B] => OK $info[SEND] => Sent mail (221 2.0.0 Service closing transmission chann +el) $info[FAILURE] => 2
I can do this by using performing multiple greps, but can someone show me if there is a more efficient way to read the information in and use the items such as FAN_A and FAN_B as elements for the array and the value inserted from the information between the <>s?
Thanks in advance.
In reply to Some assistance with splitting variables by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |