Dashboards & Visualizations

read application variable into xml

fresned
Path Finder

in splunk is there a way to set an application variable in any of the .conf files that is accessible in the xml file? if so please provide and example

Tags (1)
0 Karma

Drainy
Champion

I think you are looking for http://docs.splunk.com/Documentation/Splunk/5.0/admin/Timesconf

In this conf you can define your own time periods/ranges to use within Splunk. You define this within $SPLUNK_HOME/etc/apps/APPNAME/local/

0 Karma

Drainy
Champion

Have you tried creating eventtypes or macros to do the same thing? Then you only need to edit them in the manager just the once

0 Karma

fresned
Path Finder

in the XML files I have a search there are hard coded values every time the name of an item gets updated, I find I have to go through a number of xml files and updated the value each time. So was look for a way not to have to go and update each file. so I have the following;sourcetype=sourcename TestType="Order" there are 12 xml files that have TestType="Order" and when the name changed to "Orders" I have to go and change each of the searches. where if it was a variable I would only need to update it in one place one time

0 Karma

Drainy
Champion

What sort of variable do you mean then? If its not time related then no, there isn't really any way to put a value in a file and have it interpreted in the XML. To do this you would use something like the ValueSetter in sideview utils or just type it in for each XML. I'd be more interested to know what use-cases (e.g. what sort of variables) you'd want to share across many dashboards.

0 Karma

fresned
Path Finder

I may have chose a bad example. I was looking anything I may want to use as a variable, not just a time as an example. I will try and see it this will do what I need.

0 Karma

fresned
Path Finder

I would like to set this up as a variable rather than a hard coded value.

layoutPanel="panel_row1_col1" autorun="True">
Last 4 hours
True
I would like to change Last 4 hours to be something like
$VARIABLENAME$ where $VARIABLENAME$ is set
in one of the .confg files. So in one place I could set all the xml files to be
$VARIABLENAME$ ='Last 2 hours' for example.

0 Karma

Drainy
Champion

Could you give an example of what you are trying to achieve or would like to?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Mastering Threat Intelligence in ES 8.5, Splunk AI Assistant v2, and More from Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

Break the Build: Inside the KubeDoom Lounge at .conf26

    You step up to the machine. The pixelated corridors of a certain 1993 FPS load in front of you, EMP Pulse ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...