<?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 Search to export structured CSV from Splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-to-export-structured-CSV-from-Splunk/m-p/477442#M133991</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Using Splunk on a raw log file I get the total templates (clusters) of logs using something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="my_host index="my_index" sourcetype="my_log" Content=*
| eval rex_template=replace("this", "*")
| cluster t=0.9 labelonly=true labelfield=Template match=termlist field=rex_template
| stats count AS Occurences, values(rex_template) AS REGEX_Expressions by Template
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, I want to extract the file of the structured logs (not templates). Each log line from the raw file has a corresponding structured row with columns, where each column is an attribute describing the log (e.g. Time, PID, BlockID, etc.)&lt;/P&gt;

&lt;P&gt;My search for this, is something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="my_host index="my_index" sourcetype="my_log" Content=*
| cluster t=0.9
| outputcsv structured_logs.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So we output the structured lines in a CSV file which we can export.&lt;/P&gt;

&lt;P&gt;Is there a way to download via terminal the structured file, using the first of the 2 searches above? This search generates just templates, not the whole file of structured logs  &lt;/P&gt;

&lt;P&gt;Thank you.&lt;BR /&gt;
I ssh to my Splunk VM trying to find the file(s) containing the structured logs without success so far.  &lt;/P&gt;</description>
    <pubDate>Thu, 05 Sep 2019 17:17:42 GMT</pubDate>
    <dc:creator>psychogyiokosta</dc:creator>
    <dc:date>2019-09-05T17:17:42Z</dc:date>
    <item>
      <title>Search to export structured CSV from Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-export-structured-CSV-from-Splunk/m-p/477442#M133991</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Using Splunk on a raw log file I get the total templates (clusters) of logs using something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="my_host index="my_index" sourcetype="my_log" Content=*
| eval rex_template=replace("this", "*")
| cluster t=0.9 labelonly=true labelfield=Template match=termlist field=rex_template
| stats count AS Occurences, values(rex_template) AS REGEX_Expressions by Template
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, I want to extract the file of the structured logs (not templates). Each log line from the raw file has a corresponding structured row with columns, where each column is an attribute describing the log (e.g. Time, PID, BlockID, etc.)&lt;/P&gt;

&lt;P&gt;My search for this, is something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="my_host index="my_index" sourcetype="my_log" Content=*
| cluster t=0.9
| outputcsv structured_logs.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So we output the structured lines in a CSV file which we can export.&lt;/P&gt;

&lt;P&gt;Is there a way to download via terminal the structured file, using the first of the 2 searches above? This search generates just templates, not the whole file of structured logs  &lt;/P&gt;

&lt;P&gt;Thank you.&lt;BR /&gt;
I ssh to my Splunk VM trying to find the file(s) containing the structured logs without success so far.  &lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 17:17:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-export-structured-CSV-from-Splunk/m-p/477442#M133991</guid>
      <dc:creator>psychogyiokosta</dc:creator>
      <dc:date>2019-09-05T17:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Search to export structured CSV from Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-export-structured-CSV-from-Splunk/m-p/477443#M133992</link>
      <description>&lt;P&gt;I think you want to do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="my_host index="my_index" sourcetype="my_log" Content=*
| cluster t=0.9
| table _raw
| outputcsv structured_logs.csv
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Sep 2019 22:33:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-export-structured-CSV-from-Splunk/m-p/477443#M133992</guid>
      <dc:creator>codebuilder</dc:creator>
      <dc:date>2019-09-05T22:33:38Z</dc:date>
    </item>
  </channel>
</rss>

