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!

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

Community Content Calendar, October Edition

Welcome to the October edition of our Community Spotlight! The Splunk Community is a treasure trove of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...