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
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...