Splunk Search

List of Sourcetypes, separeted by logfilenames

matze4matze
Engager

Hi everyone,

I got three Dashboards to list my different sourcetypes.

ALL, test, production

ALL:
| metadata type=sourcetypes | search totalCount>0 | eval termkey="sourcetype" | fields sourcetype | where sourcetype LIKE "system-%" | sort sourcetype

TEST:
| metadata type=sourcetypes | search totalCount>0 | eval termkey="sourcetype" | fields sourcetype | where sourcetype LIKE "system-%test%" | sort sourcetype

PRODUCTION:
| metadata type=sourcetypes | search totalCount>0 | eval termkey="sourcetype" | fields sourcetype | where sourcetype LIKE "system-%prod%" | sort sourcetype

My Question:
How do I make a search like this: At TEST I want to exclude all PROD, because of some different named logfiles.
-> need an inverted searchstring: something like: ALL SOURCETYPES != %prod%

Greetings
Matt

Tags (1)
0 Karma
1 Solution

matze4matze
Engager

where (sourcetype LIKE "system%") AND (not sourcetype LIKE "%test%")

Done 😉

View solution in original post

matze4matze
Engager

where (sourcetype LIKE "system%") AND (not sourcetype LIKE "%test%")

Done 😉

Get Updates on the Splunk Community!

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...