- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ialahdal
Path Finder
10-09-2019
02:52 AM
I am trying to list all sourcetypes in an index using dc
Using index="test" | stats dc(sourcetype) as sourcetypes
only shows the total number of sourcetypes but does not list them individually.
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

richgalloway

SplunkTrust
10-09-2019
04:45 AM
To list them individually you must tell Splunk to do so.
index="test" | stats count by sourcetype
Alternative commands are
| metadata type=sourcetypes index=test
or
| tstats count where index=test by sourcetype
---
If this reply helps you, Karma would be appreciated.
If this reply helps you, Karma would be appreciated.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

richgalloway

SplunkTrust
10-09-2019
04:45 AM
To list them individually you must tell Splunk to do so.
index="test" | stats count by sourcetype
Alternative commands are
| metadata type=sourcetypes index=test
or
| tstats count where index=test by sourcetype
---
If this reply helps you, Karma would be appreciated.
If this reply helps you, Karma would be appreciated.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ialahdal
Path Finder
10-13-2019
10:24 PM
What I was looking for is closer to index="test" | stats dc(sourcetype) by sourcetype
but thanks I was able to find this because of your answer.
