Dashboards & Visualizations

Subsearch: How to create a search which returns multiple values?

madhukar3us
Engager

Hi,

I have a search query which returns multiple values. For example, the search query returns abc, def, ghi.

I need to take this as input and  i need to perform a search of these values. The logs contains the abc-123-678, def-678+943 , ghi-678-123 and i need to search the events that contains these strings.

Any suggestions?

 

 

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @madhukar3us ,

if you need to use the result of a subquery to search  as text in the main search, you have to follow this approach

supposing that the field in the subsearch containing the values to search is "my_field"

your_main_search [ search your_secondary_search  rename my_field AS query | fields query ]

Ciao.

Giuseppe

View solution in original post

marysan
Communicator

Hi
I suppose that you need join command for example :
index=index1 abc=123-678  def=678+943 , ghi=678-123
| fields abc,def,ghi
| join type=inner abc,def,ghi
 [| search index=index2]

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @madhukar3us ,

if you need to use the result of a subquery to search  as text in the main search, you have to follow this approach

supposing that the field in the subsearch containing the values to search is "my_field"

your_main_search [ search your_secondary_search  rename my_field AS query | fields query ]

Ciao.

Giuseppe

danielcj
Communicator

Hello @madhukar3us ,

Could you please provide more information? Are these values on the same field? Could you also share some log samples?

 

Thanks.

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 ...