I am trying to convert some superfluous parenthesis from this log. Duration value can be up to 4 digits.
1/2/2017 12:34 severity=INFO post call (duration=5)
What I want
1/2/2017 12:34 severity=INFO post call duration=5
Here is what I got so far, but not clicking.
SEDCMD-log4jwildfixduration_parenth = s/((duration=(0-9)*))/\1/
Try this run anywhere search, below will look only for
duration fieldand remove the brackets from duration field only.
| makeresults | eval data="1/2/2017 12:34 severity=INFO post call (duration=5)" | rex field=data mode=sed "s/\((duration=[^\)]+)\)/\1/"
Here is what you should write in your environment:
SEDCMD-log4jwild_fix_duration_parenth = s/\((duration=[^\)]+)\)/\1/
let me know if this helps!