Hi all,
Can anyone tell me why this code won't work? I'm trying to use a text field to update a lookup file via outputlookup.
In previous code, I retrieve the value and display it as a single figure. This code below is to allow the user to enter a new value and submit it to the lookup csv file, so I'm changing only the value
field for the $sla$
field.
CSV file looks like this:
sla value
ram 8
lat 1000
etc....
<label>Value</label>
<populatingSearch fieldForValue="value" fieldForLabel="name" >
| inputlookup sla_lookup.csv | search sla=$sla$ | fields value | eval value=$value$ | outputlookup sla_lookup.csv
</populatingSearch>
</input>
</fieldset>
Thanks in advance!
When I hit the submit button, the end of the page URL changes to this:
form_test?earliest=0&latest=&form.sla=ram
make sure that your are using outputlookup command to create the file.
the file already exists, and can be read successfully in the previous code 🙂
your file is in this following directory?
$SPLUNK_HOME/etc/system/lookups
Nope, its in the app's folder:
$SPLUNK_HOME/etc/apps/APPNAME/lookups
1.you can't use the token in populatingSearch tag
2.using search in this tag most be not inline.
3.you most use count or table to pick data in the field.
4. something like this:
|inputlookup file_name|stats count by field_name
This is code before the first section I posted, its works fine:
<input type="dropdown" token="sla" searchWhenChanged="true" >
<label>Choose SLA:</label>
<search>
<query>| inputlookup sla_lookup.csv </query>
<earliest>-5m</earliest>
<latest>now</latest>
</search>
<selectFirstChoice>true</selectFirstChoice>
<fieldForLabel>name</fieldForLabel>
<fieldForValue>sla</fieldForValue>
</input>
so your csv file have only one field: sla
i think that your ok with this preview code.
Two fields.
sla and value
select the field that you want to populate in your dropdown with this code:
|inputlookup file_name.csv |table sla
cool. How do I fix the submit button?