Splunk Search

text box input

splunkpoornima
Communicator

Hi all

in a form i need a Text box .in that whatever the value i am giving it should reterive only those task having those value as duration

i used the below code...

<form>
  <label>Sample form</label>
  <searchTemplate>
    source="C:\Users\20875\Desktop\taskmanager_log.txt"|transaction TaskBP startswith=START endswith=Succeeded|table TaskBP duration|where duration$duration$
  </searchTemplate>
  <fieldset>
      <input type="text" token="duration">
        <label>range</label>
        <default></default>
        <seed>600</seed>
      </input>
      <!-- Add default TimePicker -->
      <input type="time" />
  </fieldset>
  <row>
      <!-- Show results as a table -->
      <table>
        <option name="showPager">true</option>
        <option name="count">20</option>
      </table>
  </row>
</form>

so if i run the code, i am getting wrong output

alt text

plz suggest me the correction in the code...

Thanks in advance

poornima

Tags (1)
0 Karma

Drainy
Champion

| where duration==$duration$ ? or perhaps | search duration=$duration$

0 Karma

Drainy
Champion

Ayn: Check your email! Splunkppornima: Did you try the search condition instead? Also, all of what Ayn said. You really need to go and learn how to debug these problems to run Splunk effectively

0 Karma

Ayn
Legend

Well did you inspect the search to see why you're not getting results?

0 Karma

splunkpoornima
Communicator

i am getting no results found when i give the values in the text box

i used the same where codition as drainy suggested

0 Karma

Ayn
Legend

...instead you are getting what? Hard to debug with just "it worked" or "it didn't work" as feedback. In my opinion you really need to learn debugging, so you can understand and solve issues yourself.

0 Karma

splunkpoornima
Communicator

hi drainy

thanks for ur response ...

i tried with the answer u had given ..but still i am not getting

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Enhance Security Operations with Automated Threat Analysis in the Splunk EcosystemAre you leveraging ...

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...