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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...