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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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