Dashboards & Visualizations

Combining two results into one CSV file from Dashboard

earakam
Path Finder

Hi

I am trying to figure out this.

In dashboard, i have two different panels with different searches.
How can I combine those two results by clicking the "export" button on the bottom left to output as one CSV file.
I know that I can do this if i use CLI search or some scripts, but I specifically want to do this from UI in Dashboard.

Could someone help me with this?

Thank you.

Tags (1)
0 Karma
1 Solution

chimell
Motivator

Hi
If your xml code is like this:

<form>
   <label>Show Hide Using checkbox</label>
     <row>
     <panel>
       <table >
         <search>
           <query>index=_internal | stats c by sourcetype</query>
           <earliest>-60m@m</earliest>
           <latest>now</latest>
         </search>
       </table>
     </panel>
     <panel>
       <table >
         <search>
           <query>index=_internal | stats c by host</query>
           <earliest>-60m@m</earliest>
           <latest>now</latest>
         </search>
       </table>
     </panel>
   </row>
 </form>

I advise you firstly to combine your two searches in on search and use outputcsv command to export a result

index=_internal | stats c by sourcetype|appendcols[search index=_internal | stats c by host]|outputcsv myresult

Or secondly use this option in advance xml to export you result:

 <module name="Export"/>

View solution in original post

0 Karma

chimell
Motivator

Hi
If your xml code is like this:

<form>
   <label>Show Hide Using checkbox</label>
     <row>
     <panel>
       <table >
         <search>
           <query>index=_internal | stats c by sourcetype</query>
           <earliest>-60m@m</earliest>
           <latest>now</latest>
         </search>
       </table>
     </panel>
     <panel>
       <table >
         <search>
           <query>index=_internal | stats c by host</query>
           <earliest>-60m@m</earliest>
           <latest>now</latest>
         </search>
       </table>
     </panel>
   </row>
 </form>

I advise you firstly to combine your two searches in on search and use outputcsv command to export a result

index=_internal | stats c by sourcetype|appendcols[search index=_internal | stats c by host]|outputcsv myresult

Or secondly use this option in advance xml to export you result:

 <module name="Export"/>
0 Karma

earakam
Path Finder

thanks chimell!

0 Karma

chimell
Motivator

good thanks

0 Karma

chimell
Motivator

Hi
I forget to rename the second count c as c1 to make difference
use the following

 index=_internal | stats c by sourcetype|appendcols[search index=_internal | stats c as c1 by host]|outputcsv myresult
0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...