Splunk Search

Multiple Server New Field

Chirag812
Explorer

Can we create a new field which contains the group of multiple servers name and that field I can use directly in all the query like report, alerts and so I no need to search for the server names all the time and I can just use the created one field directly.

For example index=* sourcetype=* host=X

So here I want to create x=Server A + Server B + Server C.

Is this possible in Splunk ? 

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @Chirag812 ,

the easiest way to have the same result is to insert the list of servers in a lookup (called e.g. servers.csv) with at least one column (host) and run something like this:

index=* sourcetype=* [ | inputlookup servers.csv | fields host ]

P.S.: when you create this lookup, remember to create also the Lookup Definition.

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @Chirag812 ,

the easiest way to have the same result is to insert the list of servers in a lookup (called e.g. servers.csv) with at least one column (host) and run something like this:

index=* sourcetype=* [ | inputlookup servers.csv | fields host ]

P.S.: when you create this lookup, remember to create also the Lookup Definition.

Ciao.

Giuseppe

Chirag812
Explorer

Hello Giuseppe,

Thank you for your quick answer. This will definitely be going to help me to achieve this.

 

0 Karma
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...