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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...