Splunk Search

How do you include host IP address in the following Splunk search?

rbrisseyii
Explorer

Hello,

All our servers should have more than 2 apps installed. We run this report for a list of systems missing apps:

| rest /services/deployment/server/clients splunk_server=local| table hostname applications*.stateOnClient | untable hostname applications value | stats count by hostname | where count < 3

However, I would also like to include the host's IP address in this, but I can't figure out how to include it.

Any pointers or better ways to go about this?

Tags (1)
0 Karma
1 Solution

KailA
Contributor

Hey !
I think you just missed the ip field.

Can you try something like that

| rest /services/deployment/server/clients splunk_server=local 
| table hostname applications*.stateOnClient ip
| eval hostname = hostname."___".ip
| untable hostname applications value 
| stats count by hostname 
| where count < 3
| rex field=hostname "(?<hostname>.*)___(?<ip>.*)"

Let me know if it works for you.

Kail

View solution in original post

0 Karma

KailA
Contributor

Hey !
I think you just missed the ip field.

Can you try something like that

| rest /services/deployment/server/clients splunk_server=local 
| table hostname applications*.stateOnClient ip
| eval hostname = hostname."___".ip
| untable hostname applications value 
| stats count by hostname 
| where count < 3
| rex field=hostname "(?<hostname>.*)___(?<ip>.*)"

Let me know if it works for you.

Kail

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...