Splunk Search

How to add an additional column to my report (I need a hostname column).

agoktas
Communicator

Here is my search:

index=windows source="WMI:Services" State=Stopped StartMode=Auto | rex field=_raw "\nName=(?PIBM.{1,})" | chart count by SvcName | rename SvcName as "Service Name"

And I need to add another column to the right of the "Service Name" column called "Host". This way I have the windows service name associated with the host that I'm looking for.

How do I adjust my search string to add this column to the statistics table view?

Thanks!

1 Solution

sideview
SplunkTrust
SplunkTrust

I think you just need.

index=windows source="WMI:Services" State=Stopped StartMode=Auto | rex field=_raw "nName=(?PIBM.{1,})" | stats count by SvcName host | rename SvcName as "Service Name"

View solution in original post

sideview
SplunkTrust
SplunkTrust

I think you just need.

index=windows source="WMI:Services" State=Stopped StartMode=Auto | rex field=_raw "nName=(?PIBM.{1,})" | stats count by SvcName host | rename SvcName as "Service Name"

agoktas
Communicator

Thank you so much! That works perfectly! Apparently I'm a total noob when it comes to tabl'ing out my results. 😉

0 Karma

sideview
SplunkTrust
SplunkTrust

no worries. Here's a link to give you some insight into the difference between the stats and chart commands - http://answers.splunk.com/answers/32001/difference-stats-and-chart.html

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...