Splunk Dev

How do I programmatically determine if my app is running on Splunk Cloud?

LukeMurphey
Champion

I have an app that needs to determine if it is running on Splunk Cloud. How do I determine if my Splunk install is running on Splunk Cloud versus on-prem?

Tags (2)
0 Karma
1 Solution

LukeMurphey
Champion

You can determine if the Splunk install is Splunk cloud by looking at the /services/server/info/server-info (e.g. https://127.0.0.1:8089/services/server/info/server-info) endpoint. If the install is running on Splunk Cloud, it will have a field named "instance_type" that has a value of "cloud".

You can make your Splunk Enterprise instance include this value by making a file in your Splunk install under $SPLUNK_HOME/etc/system/local/server.conf that sets the instance type to cloud, like this:

[general]
instanceType = cloud

This is useful when you want to test your app on Splunk Enterprise but have it emulate that way it would behave on Cloud (presuming that your app is designed to act differently on Cloud).

View solution in original post

0 Karma

LukeMurphey
Champion

You can determine if the Splunk install is Splunk cloud by looking at the /services/server/info/server-info (e.g. https://127.0.0.1:8089/services/server/info/server-info) endpoint. If the install is running on Splunk Cloud, it will have a field named "instance_type" that has a value of "cloud".

You can make your Splunk Enterprise instance include this value by making a file in your Splunk install under $SPLUNK_HOME/etc/system/local/server.conf that sets the instance type to cloud, like this:

[general]
instanceType = cloud

This is useful when you want to test your app on Splunk Enterprise but have it emulate that way it would behave on Cloud (presuming that your app is designed to act differently on Cloud).

0 Karma
Get Updates on the Splunk Community!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...