Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Need advice in for perl use as awk replacement

by Anonymous Monk
on Sep 21, 2020 at 17:41 UTC ( #11122015=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11122015]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2020-10-22 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (225 votes). Check out past polls.

    Notices?