Reporting

Search Optimization on my query

bapun18
Communicator

Hi,
I have a query that is giving me results in around 60-70 seconds I wanted to reduce the time, seems NOT is taking more time and my search is parsing for around 35-40 seconds. Please help me to optimize the below query so that it will run within 30 seconds.

index=syslogs earliest=-5m
| fields _time host SYSLOG_mne SYSLOG_message
| rename host as device_ip
| dedup device_ip
| search NOT
[| inputlookup my_devices_lookup
| dedup device_ip
| table device_ip]
| fields _time device_ip SYSLOG_mne SYSLOG_message
| stats values(device_ip) by _time SYSLOG_mne SYSLOG_message

Labels (2)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @bapun18,

Please try this below;

 index=syslogs earliest=-5m
| lookup my_devices_lookup device_ip as host OUTPUTNEW device_ip as found
| where isnull(found)
| stats values(device_ip) by _time SYSLOG_mne SYSLOG_message

 

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

scelikok
SplunkTrust
SplunkTrust

Hi @bapun18,

Please try this below;

 index=syslogs earliest=-5m
| lookup my_devices_lookup device_ip as host OUTPUTNEW device_ip as found
| where isnull(found)
| stats values(device_ip) by _time SYSLOG_mne SYSLOG_message

 

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
Get Updates on the Splunk Community!

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

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...