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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...