Splunk Search

How to create a time chart with data from 3 sourcetypes?

raindrop18
Communicator

I want to combine my search results to one time chart. I have tried this but did give me result only from the first source.

index="login" sourcetype="success" | timechart count | appendcols [search index="login" sourcetype="Failed" | timechart count] appendcols [search index="login" sourcetype="no-account" | timechart count]

Tags (2)
1 Solution

srioux
Communicator

Try using:

index="login" sourcetype="success" OR sourcetype="Failed" OR sourcetype="no-account" | timechart count by sourcetype

This'll create your initial search with all results, but your timechart will be a count split by sourcetype values.

View solution in original post

srioux
Communicator

Try using:

index="login" sourcetype="success" OR sourcetype="Failed" OR sourcetype="no-account" | timechart count by sourcetype

This'll create your initial search with all results, but your timechart will be a count split by sourcetype values.

raindrop18
Communicator

thanks you both, works as expected.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Or, for a massive performance boost, try this under Splunk 6+:

| tstats count where index="login" AND (sourcetype="success" OR sourcetype="Failed" OR sourcetype="no-account") by sourcetype _time span=auto | timechart count by sourcetype
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...