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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...