Splunk Search

How to use search field as an input in another search query within same index.

abhijeet
Explorer

Hello Friends, 

I am trying to fetch value of "F5_device"  from search and use as a input to another search to find the result of "syslog_severity". both fields are belongs to same index and sourcetype. 

I tried following subsearch query but noticed vast difference between output if ran query separately. 

index="f5" sourcetype="f5:enterprise" [search index="f5" sourcetype="f5:enterprise" AND (F5_URL=*abc.com* OR F5_vip=*abc.com* ) | fields + F5_device] |stats count by syslog_severity

Also from another  thread i do understand that subsearch have limitation so please suggest if there is any alternative option available for subsearch. I would like to use this query within dashboard.

Thank you in advance.  

 

 

 

 

Labels (1)
0 Karma
1 Solution

renjith_nair
Legend

If they are from same index and sourcetype, you probably could add the filters to F5_device in the same search.

 index="f5" sourcetype="f5:enterprise" AND (F5_URL=*abc.com* OR F5_vip=*abc.com* ) F5_device=* |stats count by syslog_severity

 Please let's know if your requirement is different from above

---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

renjith_nair
Legend

If they are from same index and sourcetype, you probably could add the filters to F5_device in the same search.

 index="f5" sourcetype="f5:enterprise" AND (F5_URL=*abc.com* OR F5_vip=*abc.com* ) F5_device=* |stats count by syslog_severity

 Please let's know if your requirement is different from above

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

abhijeet
Explorer

Hi Renjith, 

Thank you for reply. This is not the  output actually i am looking for.  index="f5" sourcetype="f5:enterprise" AND (F5_URL=*abc.com* OR F5_vip=*abc.com* ) is a subset of "index="f5" sourcetype="f5:enterprise" F5_device=* ".  Dashboard allows user to search for "F5_URL" and it will locate F5 device were url is hosted. Once device is located then we would like to run another query (within same dashboard) to check what different syslog events are reported by that device. 

 

 

 

0 Karma

renjith_nair
Legend

Ok, are these urls and syslog entries are in different events and do they have F5 device common in them?

Do you have some sample events for them ? Mostly we should be able to combine them.

On another note, are you trying to implement a drill-down functionality?

If your searches are enabled with tokens in the dashboard, you can substitute the device with token value to get the syslog events as you might already know.

 

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...