Splunk Search

proper way to filter data in a search

jgpshntap
Explorer

Hi, i'm new to splunk but more used to powershell..

I want to filter my results based on fields, lag=yes

What's the best way to do this?

Tags (2)
1 Solution

jeffland
SplunkTrust
SplunkTrust

Just like that - fieldName=value 🙂

View solution in original post

0 Karma

jeffland
SplunkTrust
SplunkTrust

Just like that - fieldName=value 🙂

0 Karma

jeffland
SplunkTrust
SplunkTrust

Also, where can be of interest to you.

0 Karma

jgpshntap
Explorer

That's exactly what I did and its giving me error

index=sx sourcetype=sv NOT *date| eval Date=strftime(_time,"%m/%d/%Y") Lag_Exists="Yes" | table Date Primary Secondary Status Lag_Exists Admin_Share Current_Lag_Time Last_Transfer_Size Last_Transfer_Time

Is it because it's in the wrong spot

0 Karma

jeffland
SplunkTrust
SplunkTrust

Generally speaking, you should put filters that reduce the number of results as early as possible to reduce unneccessary calculations. But other than that, you can put them anywhere.
You should try to enclose your field name in single quotes as it contains non-alphanumeric characters though, that might be the problem here.

jgpshntap
Explorer

Excellent - Thanks.. I created a dashboard panel with filtered results up top and then full list below.

But, the next question i have is what is the best way to put a button to export to csv and show like 50+ entries in list

0 Karma

jeffland
SplunkTrust
SplunkTrust

Usually, dashboard panels already have such an "Export" button, even with the ability to limit the number of results. It's the small button next to the "Open in search" button at the bottom (it's only visible while you hover over the panel with the mouse).
If its more complicated than that, you should post that as a new question I think 🙂

0 Karma
Get Updates on the Splunk Community!

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

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...