Dashboards & Visualizations

How to add time range to the exported PDF in dashboard?

prateedshetty
Path Finder

While sharing the pdf with the stakeholders they have requested to know what the timerange is. Is there anyway we can print this in PDF from the input time picker?

0 Karma
1 Solution

mayurr98
Super Champion

hey try this :
You can add a single value panel as mentioned below to get the search timeline.

 <dashboard>
       <label>ShowSearchDate</label>
       <description/>
       <row>
         <panel>
           <single>
             <searchString>|gentimes start=-1 | addinfo | convert ctime(*) | eval reportDate=info_min_time." to ".info_max_time | table reportDate</searchString>
             <earliestTime>-60m@m</earliestTime>
             <latestTime>now</latestTime>
             <option name="drilldown">none</option>
             <option name="beforeLabel">Report Date:</option>
             <option name="linkView">search</option>
             <option name="afterLabel">.</option>
           </single>
         </panel>
       </row>
       <row>
         <panel>
           <chart>
             <title>Internal Sourcetype Distribution Report</title>
             <searchString>index=_internal | stats count by sourcetype</searchString>
             <earliestTime>-60m@m</earliestTime>
             <latestTime>now</latestTime>
           </chart>
         </panel>
       </row>
     </dashboard>

just change query with your report query in second panel and apply same time_range to both the panels

let me know if this helps you!

View solution in original post

mayurr98
Super Champion

hey try this :
You can add a single value panel as mentioned below to get the search timeline.

 <dashboard>
       <label>ShowSearchDate</label>
       <description/>
       <row>
         <panel>
           <single>
             <searchString>|gentimes start=-1 | addinfo | convert ctime(*) | eval reportDate=info_min_time." to ".info_max_time | table reportDate</searchString>
             <earliestTime>-60m@m</earliestTime>
             <latestTime>now</latestTime>
             <option name="drilldown">none</option>
             <option name="beforeLabel">Report Date:</option>
             <option name="linkView">search</option>
             <option name="afterLabel">.</option>
           </single>
         </panel>
       </row>
       <row>
         <panel>
           <chart>
             <title>Internal Sourcetype Distribution Report</title>
             <searchString>index=_internal | stats count by sourcetype</searchString>
             <earliestTime>-60m@m</earliestTime>
             <latestTime>now</latestTime>
           </chart>
         </panel>
       </row>
     </dashboard>

just change query with your report query in second panel and apply same time_range to both the panels

let me know if this helps you!

prateedshetty
Path Finder

It worked! Thanks Mayur.

  1. So I added this query in the Dashboard source edit.
  2. Then added a Time input field.
  3. Made the query use Shared time picker.

Worked as expected! 🙂

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