All Apps and Add-ons

Splunk Add-on Builder REST API - Passing Global Account values to REST URL


In the Splunk Add-on Builder, I configured a modular input using a REST API to pull data from FortiOS/FortiGate. I am trying to pass global account values (setup parameters), but the recommended variables from the following link do not work when I test the connection:

Here is the error message:

[ERROR] - [test] HTTPError reason=HTTP Error Unable to find the server at %7b%7bglobal_account.username%7d%7d when sending request to url=https://{{global_account.username}}/api/v2/cmdb/firewall/address?with_meta=true&vdom=*&access_token={{global_account.password}} method=GET

I'm guessing the variable syntax is incorrect, or am I wrong to try and pass the global account values to the URL?

0 Karma


So I happen to be working with the Zoom API and your link to the documentation helped me out, so I'll use their endpoint API as a reference. Per the documentation they suggest using the namespace, so the URL parameter should have the value ${settings.additional_parameters.param_name}

I'm using JWT for authentication, and have created a Text property in Add-on Setup Paramaters with Global Account Settings checked. This parameter's Internal Name = jwt_token . Yes, adding "token" is redundant... I have also created another Data Input Parameter called Query URL, internal name = query_url

So my REST URL looks like this:${query_url}?access_token=${__settings__.additional_parameters.jwt_token}&pag...

In Data Input Parameters I add which API endpoint I will be targeting, in this particular case =users and on the Add-on Setup Parameters tab there will be an "Additional Parameters", and that is where I add my JWT. If you're having problems with the built in Username & Password, I'd suggest building your own parameters for those values. Hope this helps!

0 Karma


Looks like the URL is wrong.
I would expect a URL of https://MyFortigate.somewhere/api.... and not the global_account.username

0 Karma


@laurie_gellatly - thanks for your input. I have since forgone using the global account values, since the variables I need are FortiGate URL and API Token, and don't complete align with username/password.

However, I felt it was interesting that these variable names do not work when passing them to the REST URL (as specified in the documentation). I'm wondering if anyone has found the successful variable names for the global variables.

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...