Splunk Search

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

RVDowning
Contributor

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

Tags (3)

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

yannK
Splunk Employee
Splunk Employee

Please accept the answer to mark the question as resolved.

0 Karma

RVDowning
Contributor

Thanks much! That did the trick.

0 Karma

kristian_kolb
Ultra Champion
0 Karma

strive
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

RVDowning
Contributor

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

0 Karma

strive
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

strive
Influencer
0 Karma

strive
Influencer

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

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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