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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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