Splunk Search

When using sparkline to display a table, why am I unable to list "host" field information?

jward6004
Explorer

I'm not able to populate the host field with information when using the search below. When I look at the events tab, I see these common fields shown such as host, ComputerName, ServerType but for some reason it's not populating in the table. Did I leave it out of my stats pipe and that's why it's not working?

Search:

index=example host=*fx* source="WinEventLog:Application" Type="Error" AND SourceName!="EmailManagerService" Message!="*Certificate enrollment for PROFLOWERS*" 
| eval source_exception = SourceName.":".Message
| stats sparkline max(_time) as lasttime count(source_exception) as Total by source_exception
| eval lasttime=strftime(lasttime, "%Y/%m/%d %T.%3Q")
| table Total, lasttime, host, sparkline, source_exception
| sort -Total
0 Karma
1 Solution

woodcock
Esteemed Legend

Your stats line throws away the host value. Try something like this:

index=example host=*fx* source="WinEventLog:Application" Type="Error" AND SourceName!="EmailManagerService" Message!="*Certificate enrollment for PROFLOWERS*" 
| eval source_exception = SourceName.":".Message
| stats sparkline max(_time) AS lasttime count(source_exception) AS Total values(host) AS host BY source_exception
| eval lasttime=strftime(lasttime, "%Y/%m/%d %T.%3Q")
| table Total, lasttime, host, sparkline, source_exception
| sort -Total

View solution in original post

0 Karma

woodcock
Esteemed Legend

Your stats line throws away the host value. Try something like this:

index=example host=*fx* source="WinEventLog:Application" Type="Error" AND SourceName!="EmailManagerService" Message!="*Certificate enrollment for PROFLOWERS*" 
| eval source_exception = SourceName.":".Message
| stats sparkline max(_time) AS lasttime count(source_exception) AS Total values(host) AS host BY source_exception
| eval lasttime=strftime(lasttime, "%Y/%m/%d %T.%3Q")
| table Total, lasttime, host, sparkline, source_exception
| sort -Total
0 Karma

jward6004
Explorer

Thanks @woodcock

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...