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
Champion

Just like that - fieldName=value 🙂

View solution in original post

0 Karma

jeffland
Champion

Just like that - fieldName=value 🙂

View solution in original post

0 Karma

jeffland
Champion

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
Champion

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
Champion

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