Hello,
I need some recommendations on how to extract limited amount of _raw data based on some search criteria. My requirements and one sample _raw event/data are given below. Any help will be highly appreciated. Thank you!
My requirements:
Following is one sample event, I have a key search object "Operation Succeeded" (see second line of the event from the last) and my objectives from this search
1. Need to get all events those have "Operation Succeeded"
2. Need to display one line that has "Operation Succeeded" only. For example, search will display only " ----AUDIT-1044-036936275288 -- 2021/10/05 08:58:24.289 Operation Succeeded" (will ignore the rest) for that event and same for rest of the events those have "Operation Succeeded" match.
Sample Data:
--AUDIT-1044-036936275170 -- 2021/10/05 08:58:24.289 Attempting to set option 'auditing'
----AUDIT-1044-036936275196 -- 2021/10/05 08:58:24.289 Checking SET ANY OPTION system privilege or authority - OK
----AUDIT-1044-036936275242 -- 2021/10/05 08:58:24.289 Checking SET ANY SECURITY OPTION system privilege or authority - OK
----AUDIT-1044-036936275288 -- 2021/10/05 08:58:24.289 Operation Succeeded
----AUDIT-1044-036936275305 -- 2021/10/05 08:58:24.289 Auditing Disabled
| rex "\n?(?<line>.*?Operation Succeeded)"
| table line
Hello,
Thank you so much, it's really helpful. However, it only extract Operation Succeeded from that event, that looks great. But there is any way I can have the whole line of text (like below) instead:
----AUDIT-1044-036936275288 -- 2021/10/05 08:58:24.289 Operation Succeeded
Thank you...any appreciate your support in these efforts.
Try without the optionality on the newline
| rex "\n(?<line>.*?Operation Succeeded)"
Hello,
Thank you so much again.....yes, I tried, but, getting blank without optionality with \n.
What do you get with this?
| regex _raw="Operation Succeeded"
| table _raw
Hello,
I am getting complete length of all _raw events (with all elements/full text) which have "Operation Succeeded"......key word!
| rex "(?<line>----AUDIT-\S+\s--\s\S+\s\S+\sOperation Succeeded)"
Hello,
Yes, it's working as expected, thank you so much...truly appreciated.....just one more question on this issue, is there any way I can limit (truncate/trim) the length of the _raw event from search head queries.....thank you again...