Splunk Search

tstats and inputlookup

jeradb
Explorer

My current search is - 

 

| tstats count AS event_count WHERE index=* BY host, _time span=1h
| append [ | inputlookup Domain_Computers | fields cn, operatingSystem, operatingSystemVersion
| eval host = coalesce(host, cn)]
| fillnull value="0" total_events
| stats sparkline(sum(event_count)) AS event_count_sparkline sum(event_count) AS total_events BY host

How do I get operatingSystem to display in my table?   When I add it to the end of my search BY host, operatingSystem my stats break in the table.

Labels (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Add the operating system to the list of values returned by stats rather than as one of the group-by options.

| stats sparkline(sum(event_count)) AS event_count_sparkline sum(event_count) AS total_events, values(operatingSystem as operatingSystems BY host

 

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

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Add the operating system to the list of values returned by stats rather than as one of the group-by options.

| stats sparkline(sum(event_count)) AS event_count_sparkline sum(event_count) AS total_events, values(operatingSystem as operatingSystems BY host

 

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...