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!

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...