Splunk Search

Search events by field value from search result

jacob_rod
Explorer

Hello friends,

Please try to assist me.

My data structure is -

Date , field1 , field2 , field3

I need to search events that contain a specific value in field2 ,  based on the results display all the events that contain a common value of field1.

Example -

17/2 AAA BBB gfg
17/2 XXX VVV hjh
17/2 AAA MMM klk
Searching BBB will display this lines (that have AAA in common) -
17/2 AAA BBB gfg
17/2 AAA MMM klk

Help will be appreciated,

Thank you.

 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try this

| eval field4=if(field2="BBB",field2,null)
| eventstats values(field4) as field4 by field1
| where field4="BBB"

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Try this

| eval field4=if(field2="BBB",field2,null)
| eventstats values(field4) as field4 by field1
| where field4="BBB"

jacob_rod
Explorer

Thank you very much !

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...