Getting Data In

How can I tell which Splunk server I am on, from a search? (Search head hostname)

Jason
Motivator

I am logging on to one of many Splunk Search Heads behind a load-balancer. How do I tell which one I'm on from a search, so I don't have to go in to the manager? The search needs to run properly with only lowest "user" permissions and return the hostname of the box I'm currently using to search.

Tags (2)
0 Karma
1 Solution

Jason
Motivator

Even a regular user can get the hostname by querying REST (v4.3+). There are likely other methods, but querying the logged in user information will return the hostname in the splunk_server field. Make sure to limit it to the local splunk_server to get data only from the search head.

| rest /services/authentication/users splunk_server=local | dedup splunk_server | table splunk_server

View solution in original post

Jason
Motivator

Even a regular user can get the hostname by querying REST (v4.3+). There are likely other methods, but querying the logged in user information will return the hostname in the splunk_server field. Make sure to limit it to the local splunk_server to get data only from the search head.

| rest /services/authentication/users splunk_server=local | dedup splunk_server | table splunk_server
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...