Splunk Search

Single search in multiple charts

gimbil
Explorer

Hi All,

I have a search such as
search logs | ... |timchart count(eval(X="a")), count(eval(X="b)), count(eval(X="c")), …

Is there any way I can show the result, i.e., count of "a","b","c" and so one each on one chart in simple xml?

Thanks

Tags (3)
0 Karma

yong_ly
Path Finder

you could build a form with that basic root search and create three different panels charts subsearches or a saved search.

Since 'chart' represents on container and panel, I think you'd need to specific a search for it..

http://docs.splunk.com/Documentation/Splunk/6.0/Viz/PanelreferenceforSimplifiedXML

But since you're working in XML, it's relatively easy to just copy and modify the same container..

0 Karma

somesoni2
Revered Legend

You can try searchTemplate and searchPostProcess modules of simple xml as follow:-

 <form>
 <label>PostProcess Example</label>  
  <!-- Search that returns all of the data that requested by subsequent panels -->
  <searchTemplate>
   search logs | ... |...
  </searchTemplate>

  <row>
          <chart>
            <title>Count of A over time</title>
            <searchPostProcess>timechart  count(eval(X="a"))</searchPostProcess>
             <option name="height">300px</option>
             <option name="charting.chart">area</option>
             <option name="charting.chart.stackMode">stacked</option>
          </chart>
  </row>  
  <row>
          <chart>
            <title>Count of B over time</title>
            <searchPostProcess>timechart  count(eval(X="b"))</searchPostProcess>
             <option name="height">300px</option>
             <option name="charting.chart">area</option>
             <option name="charting.chart.stackMode">stacked</option>
          </chart>
  </row> 
  <row>
          <chart>
            <title>Count of C over time</title>
            <searchPostProcess>timechart  count(eval(X="c"))</searchPostProcess>
             <option name="height">300px</option>
             <option name="charting.chart">area</option>
             <option name="charting.chart.stackMode">stacked</option>
          </chart>
  </row> 
</form>
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...