Splunk Search

how to use a macro in a form

nmr5316
New Member

I want to display output differently according to the value of radio button selected how do i do it.....

this is the macro i am trying to make
[foobar(1)]
args = foo
definition = "foo = $foo$"

original code


index=$username$ $url$ | foobar($username$)

 <fieldset>

<input type="radio" token="username">
        <choice value="abc">ABC</choice>
        <choice value="def">DEF</choice>

    </input>

    <input type="text" token="url" >
          <label>Enter URL:</label>
    </input>
<input type="time" />

</fieldset>
Tags (1)
0 Karma

woodcock
Esteemed Legend

You do it the same way as on the search bar, like this:

index=$username$ $url$ | `foobar($username$)`

You forgot to use the grave character to surround the macro call.

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...