Splunk Search

Can the same data returned from a search be used to populate both a table and a graph?

Contributor

Can the same data returned from a search be used to populate both a table and a graph?

Tags (3)

Splunk Employee
Splunk Employee

Same version in simple XML


<searchTemplate>index=_internal | bucket _time span=1h | stats count by _time source log_level</searchTemplate>
<row>
<table>
<searchPostProcess>timechart count by source</searchPostProcess>
</table>
</row>
<row>
<chart>
<searchPostProcess>timechart count by source</searchPostProcess>
</chart>
</row>

Splunk Employee
Splunk Employee

Please accept the answer to mark the question as resolved.

0 Karma

Contributor

Thanks much! That did the trick.

0 Karma

Ultra Champion
0 Karma

Influencer

I am not sure if it is possible with Simple XML. I have given example for advanced xml. Let me try if it is possible with simple xml

0 Karma

Contributor

Probably simple unless advanced is needed, and so far the requirements don't seem to require advanced.

0 Karma

Influencer

Here is the sample

  <module name="HiddenSearch" layoutPanel="panel_row1_col1" group="DashboardName">
<param name="search">`Search_Macro`</param>
<module name="ViewstateAdapter">
    <module name="HiddenFieldPicker">
        <param name="strictMode">True</param>
        <module name="JobProgressIndicator">
            <module name="EnablePreview">
                <param name="enable">True</param>
                <param name="display">False</param>
                <module name="HiddenChartFormatter">
                    <param name="charting.primaryAxisTitle.text">X_Axis_Label</param>
                    <param name="charting.secondaryAxisTitle.text">Y_Axis_Label</param>
                    <param name="charting.legend.labelStyle.overflowMode">ellipsisEnd</param>
                    <param name="charting.tooltip.content.fieldStyle.overflowMode">ellipsisEnd</param>
                    <param name="charting.legend.placement">bottom</param>
                    <param name="charting.chart">line</param>
                    <param name="charting.chart.nullValueMode">gaps</param>
                    <module name="FlashChart">
                        <param name="width">100%</param>
                        <module name="ViewRedirector">
                          <param name="viewTarget">flashtimeline</param>
                        </module>
                    </module>
                    <module name="Paginator">
                        <param name="entityName">results</param>
                        <module name="SimpleResultsTable">
                        </module>
                        <module name="Paginator">
                            <param name="entityName">results</param>
                        </module>
                    </module>
                    <module name="ViewRedirectorLink">
                        <param name="viewTarget">flashtimeline</param>
                    </module>
                </module>
            </module>
        </module>
    </module>
</module>
</module>  

Using Simple XML

 <form>
 <label>My Dashboard</label>  
  <searchTemplate>
   index=main sourcetype=jvm_gcdump earliest=-2h@h | bucket _time span=5m | stats avg(HeapSpaceBeforeGC) as BeforeGC avg(HeapSpaceAfterGC) as AfterGC avg(TotalHeapSpace) as TotalHeap by _time
  </searchTemplate>

  <row>
          <chart>
            <title>Line Chart</title>
            <searchPostProcess>timechart first(BeforeGC) first(AfterGC) first(TotalHeap)</searchPostProcess>
             <option name="charting.chart">line</option>
          </chart>
  </row>  
  <row>
          <table>
            <title>Table Chart</title>
            <searchPostProcess>timechart first(BeforeGC) first(AfterGC) first(TotalHeap)</searchPostProcess>
          </table>
  </row> 
</form>
0 Karma

Influencer
0 Karma

Influencer

Yes it is possible. Are you using advanced xml or simple xml?

0 Karma