Dashboards & Visualizations

simple xml - setting global not form variables

mortenb123
Path Finder

Hi all

Found that Splunk do not let you schedule PDFs if you have forms on your dashboard. (even though it has default settings).

I then have to manually update the time interval for every search in the dashboard.
aka add the following to every search

    <earliest>-1d@d</earliest>
    <latest>@d</latest>

I like it to be a token aka $myearliest$, but how do I declare this, tried with set and eval, but they need some parent setting I was unable get to work.

Thanks

0 Karma
1 Solution

chimell
Motivator

Hi
you can not use only $myearliest$ token just add ".earliest''

<input type="time" token="myearliest">
     <label></label>
     <default>
      <earliest>-1d@d</earliest>
     <latest>@d</latest>
     </default>
   </input>

   <search>
         <query>enter you search code here</query>
         <earliest>$myearliest.earliest$</earliest>
         <latest>$myearliest.latest$</latest>
    </search>

View solution in original post

mortenb123
Path Finder

Hi gyslainlatsa

Thanks for your answer.

I tried adding the input settings to the top and into the row with the search itself.
but my dashboard only says "search is waiting for input"

0 Karma

gyslainlatsa
Motivator

if your dashboad displays "search is waiting for input", check if all the tokens have default values that were indicated in your xml code.

0 Karma

chimell
Motivator

Hi
you can not use only $myearliest$ token just add ".earliest''

<input type="time" token="myearliest">
     <label></label>
     <default>
      <earliest>-1d@d</earliest>
     <latest>@d</latest>
     </default>
   </input>

   <search>
         <query>enter you search code here</query>
         <earliest>$myearliest.earliest$</earliest>
         <latest>$myearliest.latest$</latest>
    </search>

mortenb123
Path Finder

Had to add to the first panel, and there is shows like a time form component, but it is obviously global so it works on all the other searches in the dashboard also. And I can schedule automatic PDF based on the delivery.
Thanks

0 Karma

gyslainlatsa
Motivator

hi,

try like this:

<input type="time" token="field1">
    <label></label>
    <default>
      <earliest>0</earliest>
      <latest></latest>
    </default>
  </input>

  <search>
        <query>index=* OR index=_* |stats count by source</query>
        <earliest>$field1.earliest$</earliest>
        <latest>$field1.latest$</latest>
   </search>

mortenb123
Path Finder

Thanks this is correct, turns out the PDF scheduler checks on

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...