All Apps and Add-ons

Sideview Utils - Textfield Default Values from URL

ianshefferman
Explorer

My question is fairly identical to this old one here: http://splunk-base.splunk.com/answers/83479/pass-foo-value-to-textfield-default

It seems that user was having the same problem as me, and his issue did not appear to get resolved.

I have a view that looks pretty much like this: bpaste.net/show/kDAzkyf0yiOGc1geSM5p/

I want the Textfields to display URL parameter values as their default value.

When I visit the URL with parameters like "/app/search/viewname?IP=1.1.1.1&time=whatever", the HTML module properly substitutes the $foo$ values ($IP$ and $time$), but the Textfields simply remain blank. They are definitely spelled and cased properly. I also tried adding a "default" param to each Textfield, but that does not work ($IP$ remains as a literal $IP$).

I am running the latest versions of both Sideview and Splunk.

1 Solution

sideview
SplunkTrust
SplunkTrust

It's not intuitive, but as with Pulldown prepopulation, you need to add an autoRun="True" attribute to the top module in the view. In this case to the URLLoader module.

That will cause an initial push when the page loads and it's only when that push happens that the prepopulation will happen.

Note that of course the autoRun push will also dispatch all the searches on the page. If you dont want that to happen you can explore using a Button module with its allowAutoSubmit param set to False, to prevent this.

Back to the weirdness of autoRun being required here - With a Pulldown module it's maybe a bit more forgivable, because the autoRun is often also necessary to kick off the Pulldown's search. With TextField it's just weird I admit. The good news is that I think it's fixable with TextField so I'll take a look. Specifically I think in a near-future version I can correct this behavior and get your TextField's prepopulating without the need for you to add an autoRun="True".

Also, that other question was indeed answered if you read the comment thread he had a couple other typos and issues going on, but we got him sorted in the end.

View solution in original post

sideview
SplunkTrust
SplunkTrust

It's not intuitive, but as with Pulldown prepopulation, you need to add an autoRun="True" attribute to the top module in the view. In this case to the URLLoader module.

That will cause an initial push when the page loads and it's only when that push happens that the prepopulation will happen.

Note that of course the autoRun push will also dispatch all the searches on the page. If you dont want that to happen you can explore using a Button module with its allowAutoSubmit param set to False, to prevent this.

Back to the weirdness of autoRun being required here - With a Pulldown module it's maybe a bit more forgivable, because the autoRun is often also necessary to kick off the Pulldown's search. With TextField it's just weird I admit. The good news is that I think it's fixable with TextField so I'll take a look. Specifically I think in a near-future version I can correct this behavior and get your TextField's prepopulating without the need for you to add an autoRun="True".

Also, that other question was indeed answered if you read the comment thread he had a couple other typos and issues going on, but we got him sorted in the end.

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!

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 ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...