Splunk Enterprise

Check Windows Service status and return state or not found

lbrhyne
Path Finder

Hello...

I'm trying to create a lookup table of windows hosts running CrowdStrike, Tenable, Bitlocker, Splunk, and DHCP then return the state of the service. If the service is not installed, then note that the service is not installed. The problem I have is the service status in not reporting back as expected in each column.

HostCrowdStrikeTenableSplunkBitlocker
PC-01RunningNot installedRunningStopped

 

 

 

 

index=windows  source="kiwi syslog server" Name="CSFalconService" OR Name="Tenable Nessus Agent" OR Name="SplunkForwarder" OR Name="Dhcp" OR Name="BDESVC"
| stats values(*) AS * max(_indextime) as indextime BY host

| eval crowdstrike=if(Name=="CSFalconService", State ,"CS Agent Not Installed")
| eval tenable=if(Name=="Tenable Nessus Agent", State , "Tenable Agent Not Installed")
| eval splunk=if(Name=="SplunkForwarder", State, "Splunk Agent Not Installed")
| eval bitlocker=if(Name=="BDESVC", State,"Bitlocker Service Not Installed")

| table host crowdstrike tenable splunk bitlocker

 

 

 

 

Any help would be greatly appreciated!

Labels (1)
0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @lbrhyne,

Please try below;

index=windows  source="kiwi syslog server" (Name="CSFalconService" OR Name="Tenable Nessus Agent" OR Name="SplunkForwarder" OR Name="Dhcp" OR Name="BDESVC")
| chart latest(State) as State over Name by host 
| fillnull value="Not Installed" 
| transpose header_field=Name
If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

lbrhyne
Path Finder

Thank you @scelikok !

This worked perfectly! Almost. The query return the data in the format I was looking for, however it only returning 11 rows of data, where there should be a 1000+.

On another note... Leave it to me to totally overthink the logic. Thanks again.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...