Splunk Search

How do you pull data from a previous event?

muzicman61
New Member

So here is what my Splunk data looks like... these 4 events are consistently sequential.

›  1/7/19 1:02:11.211 PM    2019-01-07 14:02:11.211|Testing rule - Result:True
host = WTSXXXXX  sourcetype = VHT:HPIQ:VHT_QueueMonitorService 

›  1/7/19 1:02:11.208 PM    2019-01-07 14:02:11.208|Testing rule - Condition:   (FifoCallBacks <= 1) && (OpMode == QSPEAK) 
host = WTSXXXXX  sourcetype = VHT:HPIQ:VHT_QueueMonitorService 

›  1/7/19 1:02:11.208 PM    2019-01-07 14:02:11.208|Testing rule - Description: VHT_Test Rule
host = WTSFCCMY  sourcetype = VHT:HPIQ:VHT_QueueMonitorService 

›  1/7/19 1:02:11.208 PM    2019-01-07 14:02:11.208|rule:  VHT_Test
host = WTSXXXXX  sourcetype = VHT:HPIQ:VHT_QueueMonitorService 

Once I find an event with ( results:True) then I need the pull the rule name in the last event (VHT_Test)

So to clarify, when I find "result:True" I need to pull the rule name from the event 3 events prior.

Really lost on how to do this.

Thanks!

Tags (2)
0 Karma

skoelpin
SplunkTrust
SplunkTrust

Use streamstats window=1 to grab from the nearest "neighbor"

https://docs.splunk.com/Documentation/Splunk/7.2.3/SearchReference/Streamstats

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...