Splunk Search

How to combine these two searches into one search so that correlation between all three fields

nickrally2009
Explorer

Hi.
I have two separate searches.
Search1 returns events where field1 and field2 exist:

search source=x resource=foo | table field1, field2

Search2 returns events where field2 and field3 exist:

source=y resource=bar | stats count by field2, filed3

Events of Search2 do not contain mentions of field1 but there is one-to-one relation between field1 and field2, shown by results of Search1. How to combine these two searches into one search so that all three fields field1field2 and field3 are shown in a table?

0 Karma
1 Solution

manjunathmeti
SplunkTrust
SplunkTrust

Try this:

index=foo source=x resource=foo | table field1, field2 | append [search index=bar source=y resource=bar | stats count by field2, filed3] | stats values(*) as * by field2

View solution in original post

manjunathmeti
SplunkTrust
SplunkTrust

Try this:

index=foo source=x resource=foo | table field1, field2 | append [search index=bar source=y resource=bar | stats count by field2, filed3] | stats values(*) as * by field2

nickrally2009
Explorer

Thank you.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...