Splunk Search

How to write a search which lists out the indexes, hosts, sourcetypes of the events with TIME_FORMAT = %m/%d/%y?

pavanae
Builder

I have all the events logging from Linux were in the TIME_FORMAT = %d/%m/%y and Windows events were in TIME_FORMAT = %m/%d/%y. Now I need to list out all the Windows events which were logging into Splunk with the time format TIME_FORMAT = %m/%d/%y.

By using the below search string, I am able to list out out all the indexes and their hosts and their sourcetypes. Now I need only the list of events with TIME_FORMAT = %m/%d/%y only.

| tstats values(host) AS Host, values(sourcetype) AS Sourcetype WHERE index=* by index
1 Solution

vasanthmss
Motivator

I guess there is no straight way to identify this.

you can try something like this,,

Below search gives you the list of host has windows operating system.

index=_internal source=*metrics.log os=Windows earliest=-1h@h   | dedup host | table host

If the above list of servers are correct then run the below search to get the index, source, sourcetype details.
Overall Query

  | tstats values(host) AS Host, values(sourcetype) AS Sourcetype WHERE index=* [search index=_internal source=*metrics.log os=Windows earliest=-1h@h   | dedup host | table host] by index

Hope this will helps you.

V

View solution in original post

vasanthmss
Motivator

I guess there is no straight way to identify this.

you can try something like this,,

Below search gives you the list of host has windows operating system.

index=_internal source=*metrics.log os=Windows earliest=-1h@h   | dedup host | table host

If the above list of servers are correct then run the below search to get the index, source, sourcetype details.
Overall Query

  | tstats values(host) AS Host, values(sourcetype) AS Sourcetype WHERE index=* [search index=_internal source=*metrics.log os=Windows earliest=-1h@h   | dedup host | table host] by index

Hope this will helps you.

V

pavanae
Builder

Thanks like in the same is there any search which gives the list of host has Linux operating system.

0 Karma

vasanthmss
Motivator
index=_internal source=*metrics.log (os=Linux OR os=AIX)  earliest=-1h@h   | dedup host | table host
V
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Are you trying to change the output format or do you want to search for data in a particular format?

---
If this reply helps you, Karma would be appreciated.
0 Karma

pavanae
Builder

I want to search the date in particular format. like the date with timestamp format TIME_FORMAT = %m/%d/%y and not TIME_FORMAT = %d/%m/%y

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...