http://qs321.pair.com?node_id=11122015


in reply to Re: Need advice in for perl use as awk replacement
in thread Need advice in for perl use as awk replacement

Hi, thanks for your reply. The input data is as I said the syslog message log file. But it is actually not important. The regex is not the problem here (I am comfortable in this part) it filters as expected. The problem is the following sequence of boolean operations. However it looks like site formatting added some spurious "+" (line breaks>) to it

There is also currently no meaningfull result as this script will later be dynamic where depending on the callers parameter the syslog data is filtered and complete line or parts of it returned.

My first try was to filter data and just output the system name (group $3, $1=complete line, $2=date/time, group $3=system name, $4=source $5=optional source PID, ...).

The problem is how to correctly filter some of the groups and only print on positiv match, and why my examples are not working (for getting better understanding of perl).

But here some sample data:

Sep 21 19:18:25 tic kernel: hv_balloon: Balloon request will be partia +lly fulfilled. Balloon floor reached. Sep 21 19:23:10 tic crmd[1427]: notice: State transition S_IDLE -> S_ +POLICY_ENGINE Sep 21 19:23:10 tic pengine[1426]: warning: Fencing and resource manag +ement disabled due to lack of quorum