Getting Data In

Force namespace for modular input

jguarini
Path Finder

can some one please explain how to force the namepsace in a modular input setup screen? ie. when saving a modular input intended to be ran from app 'foo', the inputs.conf is actually saved in foo/local/ instead of the current namespace.

thanks

Tags (1)
0 Karma

jguarini
Path Finder

so here is a method that I found that changes the namespace to whatever app you want when configuring a new modular input. This applies to custom xml one might use to create a custom modular input page.

place the following code within the main <elements> tag and change YOURAPPNAME to the app that the input should belong to


<element name="hideme" type="hidden">
    <view name="create"/>
    <view name="edit"/>
</element>
<element name="__ns" type="select" label="Destination app">
    <view name="create"/>
    <key name="hideUnlessFieldSet">hideme</key>
    <options>
        <opt value="YOURAPPNAME" label="YOURAPPNAME"/>
    </options>
</element>

0 Karma

LukeMurphey
Champion

You can influence using the manager. The manager retains the context of the app that you clicked the manager link from. In other words, if you open the manager from the search app then the config will be made in the search app. You can observe this in the URL; note that the URL below is the for the search app (see the third part of the path):

/en-US/manager/search/data/inputs/some_modular_input

The link below make the modular input in the app "some_other_app":

/en-US/manager/some_other_app/data/inputs/some_modular_input

I know that isn't what you probably looking for. But I confirmed that this does work.

0 Karma

jguarini
Path Finder

thanks for the response

ok, looks like I need to expand on my original question to avoid the obvious.

I have a custom setup page that is defined in an manager.xml file, which overrides the scheme defined in the modular input script. I use an admin_external handler to populate various settings/options on the setup page.

how can I programmatically override the namespace such that when the input is saved it isn't written to the current namespace as defined by the URI in the address bar of the web browser?

thanks

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!

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...