<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is it possible to execute a different search query for exporting to CSV? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-execute-a-different-search-query-for-exporting/m-p/396782#M25956</link>
    <description>&lt;P&gt;if you want to export the data, you will need to click on that export button, but if you want to save in a csv file inside splunk, you can aways use outputlookup or outputcsv.&lt;/P&gt;

&lt;P&gt;Unfortunately, there is no Export with the post search drilldown, so you will need to change the table if you want to exporte those values only, like:&lt;/P&gt;

&lt;P&gt;| table TIME_STAMP TIME_SPENT SERVICE_NAME SUCCESS_STATE DOCUMENT_ID SERVICE_INPUT  SERVICE_OUTPUT TRANSACTION_TYPE MACHINE_NAME&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 22:09:27 GMT</pubDate>
    <dc:creator>felipesewaybric</dc:creator>
    <dc:date>2020-09-29T22:09:27Z</dc:date>
    <item>
      <title>Is it possible to execute a different search query for exporting to CSV?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-execute-a-different-search-query-for-exporting/m-p/396781#M25955</link>
      <description>&lt;P&gt;Hello Splunk Experts,&lt;/P&gt;

&lt;P&gt;I have this Simple XML dashboard with a simple Query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;
          index="__" 
          sourcetype="__" 
          source="___" 
          DOCUMENT_ID="'$documentId$'" 
          SERVICE_NAME="$serviceName$" 
          SUCCESS_STATE="$successState$"
          | eval SERVICE_INPUT = replace(SERVICE_INPUT,"{{","")  
          | eval SERVICE_INPUT = replace(SERVICE_INPUT,"}}","")
          | eval SERVICE_OUTPUT = replace(SERVICE_OUTPUT,"{{","") 
          | eval SERVICE_OUTPUT = replace(SERVICE_OUTPUT,"}}","")
          | eval SIP = SERVICE_INPUT
          | eval SOP = SERVICE_OUTPUT
          | eval SERVICE_INPUT = substr(SERVICE_INPUT,1,15) + toString("...")
          | eval SERVICE_OUTPUT = substr(SERVICE_OUTPUT,1,15) + toString("...")
          | table TIME_STAMP, TIME_SPENT, SERVICE_NAME, SUCCESS_STATE, DOCUMENT_ID, SERVICE_INPUT , SERVICE_OUTPUT , TRANSACTION_TYPE, MACHINE_NAME, SIP, SOP 

      &amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;$dateFrom.earliest$&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;$dateFrom.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
    &amp;lt;option name="count"&amp;gt;50&amp;lt;/option&amp;gt;
    &amp;lt;option name="showPager"&amp;gt;true&amp;lt;/option&amp;gt;
    &amp;lt;drilldown&amp;gt;
      &amp;lt;set token="serviceInput"&amp;gt;$row.SIP$&amp;lt;/set&amp;gt;
      &amp;lt;set token="serviceOutput"&amp;gt;$row.SOP$&amp;lt;/set&amp;gt;
    &amp;lt;/drilldown&amp;gt;
  &amp;lt;/table&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The values for SERVICE_INPUT , SERVICE_OUTPUT will be quite huge and hence I am shortening the length of these values to be displayed on the results table. However, I have a drilldown beneath the main search results table, upon clicking a particular row, the complete XML message for SERVICE_INPUT and SERVICE_OUTPUT is being printed with the help of $row.SIP$ and $row.SOP$ values captured through the tokens. &lt;/P&gt;

&lt;P&gt;Now, I want to export the search results into a CSV with the entire row ie Untrimmed SERVICE_INPUT and SERVICE_OUTPUT. &lt;/P&gt;

&lt;P&gt;I want these columns to be exported to the CSV,  "TIME_STAMP", TIME_SPENT, SERVICE_NAME, SUCCESS_STATE, DOCUMENT_ID, SERVICE_INPUT , SERVICE_OUTPUT , TRANSACTION_TYPE, MACHINE_NAME".&lt;/P&gt;

&lt;P&gt;Also I want to omit SIP and SOP values as they will be redundant for each row. In short, I need the untrimmed SERVICE_INPUT and SERVICE_OUTPUT to be exported by leaving out SIP and SOP from the export.csv file.&lt;/P&gt;

&lt;P&gt;How do I go about doing this? Any help will he highly appreciated. &lt;/P&gt;

&lt;P&gt;Thanks and Regards,&lt;/P&gt;

&lt;P&gt;Sabari Nathan Krishnan&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:04:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-execute-a-different-search-query-for-exporting/m-p/396781#M25955</guid>
      <dc:creator>sabarinathankay</dc:creator>
      <dc:date>2020-09-29T22:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to execute a different search query for exporting to CSV?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-execute-a-different-search-query-for-exporting/m-p/396782#M25956</link>
      <description>&lt;P&gt;if you want to export the data, you will need to click on that export button, but if you want to save in a csv file inside splunk, you can aways use outputlookup or outputcsv.&lt;/P&gt;

&lt;P&gt;Unfortunately, there is no Export with the post search drilldown, so you will need to change the table if you want to exporte those values only, like:&lt;/P&gt;

&lt;P&gt;| table TIME_STAMP TIME_SPENT SERVICE_NAME SUCCESS_STATE DOCUMENT_ID SERVICE_INPUT  SERVICE_OUTPUT TRANSACTION_TYPE MACHINE_NAME&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:09:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-execute-a-different-search-query-for-exporting/m-p/396782#M25956</guid>
      <dc:creator>felipesewaybric</dc:creator>
      <dc:date>2020-09-29T22:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to execute a different search query for exporting to CSV?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-execute-a-different-search-query-for-exporting/m-p/396783#M25957</link>
      <description>&lt;P&gt;Store &lt;CODE&gt;$row.SIP$&lt;/CODE&gt; and &lt;CODE&gt;$row.SOP$&lt;/CODE&gt; as tokens named &lt;CODE&gt;$rowSIP$&lt;/CODE&gt; and &lt;CODE&gt;$rowSOP$&lt;/CODE&gt; and then make a 2nd drilldown with this SPL:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="__" 
sourcetype="__" 
source="___" earliest=$dateFrom.earliest$ latest=$dateFrom.latest$
DOCUMENT_ID="'$documentId$'" 
SERVICE_NAME="$serviceName$" 
SUCCESS_STATE="$successState$"
| eval SERVICE_INPUT = replace(SERVICE_INPUT,"{{","")  
| eval SERVICE_INPUT = replace(SERVICE_INPUT,"}}","")
| eval SERVICE_OUTPUT = replace(SERVICE_OUTPUT,"{{","") 
| eval SERVICE_OUTPUT = replace(SERVICE_OUTPUT,"}}","")
| search SERVICE_INPUT = $rowSIP$ AND SERVICE_OUTPUT = $rowSOP$
| table TIME_STAMP, TIME_SPENT, SERVICE_NAME, SUCCESS_STATE, DOCUMENT_ID, SERVICE_INPUT , SERVICE_OUTPUT , TRANSACTION_TYPE, MACHINE_NAME
| sendemail ......
| outputcsv ....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Nov 2018 06:19:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-execute-a-different-search-query-for-exporting/m-p/396783#M25957</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-11-30T06:19:37Z</dc:date>
    </item>
  </channel>
</rss>

