Knowledge Management

Is it possible to pass "CUSTOM_URL" variable into workflow_actions.conf?

himynamesdave
Contributor

Hi all -

I am building a Splunk App and have run into something I've never needed to do before...

During app setup (in setup.xml), user enters a "CUSTOM_URL" for their deployment and that data is saved to the KV store.

My aim is to pass this "CUSTOM_URL" variable into workflow_actions.conf. As an example:

 ```
[Workflow action example 0]
...
link.method = get
link.target = blank
link.uri = https://[CUSTOM_URL]/$SOME_FIELD_FROM_SEARCH$
type = link
...
```

Is this possible? If so, are there any examples available?

As always, thank you for your help Splunkers!

-dave

0 Karma
1 Solution

jkat54
SplunkTrust
SplunkTrust

Absolutely.

Check out selfSignedWebSSL.py in /bin of this app https://splunkbase.splunk.com/app/3235/

Along with its restmap.conf and setup.xml

It will mostly take place in your rest endpoint's python code.

View solution in original post

0 Karma

jkat54
SplunkTrust
SplunkTrust

Absolutely.

Check out selfSignedWebSSL.py in /bin of this app https://splunkbase.splunk.com/app/3235/

Along with its restmap.conf and setup.xml

It will mostly take place in your rest endpoint's python code.

0 Karma

jkat54
SplunkTrust
SplunkTrust

You're looking for the configParser and need to wrap up the usage of it in the custom rest api code.

The example I shared passes many values to a custom rest endpoint which then verifies the required values were passed and if so, uses the config parser to write new config files.

It uses os.path so that it works fine on all OSes that support Python 2.7

0 Karma

himynamesdave
Contributor

Perfect solution - thank you.

Will post my code for anyone reading this in future once implemented...

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...