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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...