Getting Data In

How to obtain the Splunk instance's version from app (SimpleXML or SplunkJS) in 6.4 or older?

rjthibod
Champion

Splunk 6.5 added global environment tokens that are accessible in SimpleXML (http://docs.splunk.com/Documentation/Splunk/6.5.0/Viz/tokens#Use_global_tokens_to_access_environment...), one of which reports the version of the Splunk instance, $env:version$.

How does one obtain the equivalent version number from an app in Splunk 6.4 or older?

I am most interested in obtaining this value using SplunkJS or SimpleXML, e.g., a function call in SplunkJS or a rest search.

I am aware some of the global environment tokens are accessible via the REST API, but I cannot seem to find anything that reports the version. A SplunkJS function call would be the most ideal.

Here is a related question for the splunk_server value: https://answers.splunk.com/answers/506296/is-there-a-javascript-token-with-the-hostname-of-t.html

0 Karma
1 Solution

lweber
Path Finder

have a look at the server/info REST endpoint: http://docs.splunk.com/Documentation/Splunk/6.4.0/RESTREF/RESTintrospect#GET_server.2Finfo_method_de...

it will return a version property which is what you are looking for

View solution in original post

0 Karma

lweber
Path Finder

have a look at the server/info REST endpoint: http://docs.splunk.com/Documentation/Splunk/6.4.0/RESTREF/RESTintrospect#GET_server.2Finfo_method_de...

it will return a version property which is what you are looking for

0 Karma

rjthibod
Champion

Thank you. Don't know how I missed that.

0 Karma

rjthibod
Champion

For those curious, this is the actual query that is probably the simplest. It assumes your user can be authenticated to call the REST endpoint.

| rest splunk_server=local count=1 /services/server/info | table version

0 Karma

asimagu
Builder

is this what you were after??

| rest /services/apps/local | table title version
0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...