Splunk Search

request optimization with best practices

jip31
Motivator

hello

I use the request below but i would like to have an example of doing this code more performant following splunk best practices
could you help me please?

 index="windows" sourcetype="wineventlog:Application" SourceName="*" 
Type="Critique" OR Type="Avertissement" OR Type="Erreur" 
| dedup host 
| stats count by host   

| join host [search index="windows-wmi" sourcetype="WMI:ModelPC" |rex "Model=(?<model>.*)"|stats values(model) as Model by host]
| stats count values(host) by Model | rename count as Total | table Model Total | sort -Total limit=10
0 Karma
1 Solution

koshyk
Super Champion

Please try like below ( I haven't tested it, but just the concept)

[index="windows" sourcetype="wineventlog:Application" SourceName="*"  (Type="Critique" OR Type="Avertissement" OR Type="Erreur" ) | stats count by host | fields host]   index="windows-wmi" sourcetype="WMI:ModelPC"  
|rex "Model=(?<model>.*)"|stats values(model) as Model by host

View solution in original post

0 Karma

koshyk
Super Champion

Please try like below ( I haven't tested it, but just the concept)

[index="windows" sourcetype="wineventlog:Application" SourceName="*"  (Type="Critique" OR Type="Avertissement" OR Type="Erreur" ) | stats count by host | fields host]   index="windows-wmi" sourcetype="WMI:ModelPC"  
|rex "Model=(?<model>.*)"|stats values(model) as Model by host
0 Karma

jip31
Motivator

thanks a lot

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

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