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!

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...

Get Early Access to AI Playbook Authoring: Apply for the Alpha Private Preview ...

Passionate about security automation? Apply now to our AI Playbook Authoring Alpha private preview ...

Reduce and Transform Your Firewall Data with Splunk Data Management

Managing high-volume firewall data has always been a challenge. Noisy events and verbose traffic logs often ...