Getting Data In

How to agregate data from different sourcetypes?

jip31jip31
Explorer

hello

I use the request below for retrieving some information from the Windows event viewer but in my dashboard, I need to aggregate other information from another sourcetype.
This sourcetype comes from another sourcetype ([WinHostMon://computer]] or from WMI.conf ([WMI:Computer])
My question is. how to aggregate data in my SPL command for these 2 cases?
Thanks

index="wineventlog" sourcetype="wineventlog:*" SourceName="*" Type="Critique" OR Type="Avertissement" 
| dedup host  
| stats count  
| rename count AS "Number of machines" 
| eventstats sum(count) as Total 
| eval percent=round((count/Total)*100,1) 
| eval host=host."(count: ".count.", percent: ".percent.")" 
| fields - count Total

index="wineventlog" sourcetype="wineventlog:*" SourceName="*" Type="Critique" OR Type="Avertissement" 
| dedup host  
| stats count  
| rename count AS "Number of machines" 
| eventstats sum(count) as Total 
| eval percent=round((count/Total)*100,1) 
| eval host=host."(count: ".count.", percent: ".percent.")" 
| fields - count Total

index="wineventlog" sourcetype="wineventlog:*" SourceName="*" Type="Critique" OR Type="Avertissement" 
| dedup host  
| stats count  
| rename count AS "Number of machines" 
| eventstats sum(count) as Total 
| eval percent=round((count/Total)*100,1) 
| eval host=host."(count: ".count.", percent: ".percent.")" 
| fields - count Total

We formatted your code so it was easier to see the three queries.

0 Karma

DalJeanis
Legend

We formatted your code so it was easier to see the three queries. However, they were identical. Please update to add the second query.

0 Karma

jip31jip31
Explorer

NOBODY FOR HELPING ME??

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Your query is difficult to understand. It looks like it might be two or three searches run together. Can you please edit the question?

---
If this reply helps you, Karma would be appreciated.
0 Karma

jip31
Motivator

HI

sorry the exact request is :
index="wineventlog" sourcetype="wineventlog:" SourceName="" Type="Critique" OR Type="Avertissement" | dedup host | stats count | rename count AS "Number of machines" | eventstats sum(count) as Total | eval percent=round((count/Total)*100,1) | eval host=host."(count: ".count.", percent: ".percent.")" | fields - count

0 Karma

jip31
Motivator

ok thanks

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Did your query get mangled by the forum? It looks like it might be two queries stuck together.

BTW, for better performance, use stats dc(host) instead of dedup host | stats count.

---
If this reply helps you, Karma would be appreciated.
0 Karma

p_gurav
Champion

Is there any common field present in all sourcetype?

0 Karma

jip31
Motivator

no sorry...

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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...