<?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: How to export &amp;quot;Structured Logs&amp;quot; from Splunk to CSV file in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436176#M76119</link>
    <description>&lt;P&gt;That's helpful to know thank you. Still the lookup file i export as you described are the "templates", that is the lines generated in Statistics tab. &lt;/P&gt;

&lt;P&gt;Is there a way to export the structured logs from the Events tab, similarly to the way you described above?&lt;/P&gt;

&lt;P&gt;Also, since Splunk interface (i use a web browser to use Splunk, i do not have it installed locally) shows in the Event tab the 'structured logs' this means that Splunk saves  the logs somewhere. However if i access my VM where Splunk is installed, i try:&lt;/P&gt;

&lt;P&gt;grep -r 'string i want to find' in the Splunk's filepath and i get no results with files containing this string, indicating that there is no file with the structured logs to download.&lt;/P&gt;

&lt;P&gt;How can i get access to the Event tabs content?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2019 08:47:37 GMT</pubDate>
    <dc:creator>psychogyiokosta</dc:creator>
    <dc:date>2019-08-29T08:47:37Z</dc:date>
    <item>
      <title>How to export "Structured Logs" from Splunk to CSV file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436170#M76113</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;

&lt;P&gt;I am new with Splunk, I have the following question/issue:&lt;/P&gt;

&lt;P&gt;My goal is to parse a raw log file with Splunk and save and download/extract the new generated structured log file as a csv file.&lt;/P&gt;

&lt;P&gt;I ran this SPL search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="vm-nc-23" index="deeplog" sourcetype="hdfs_log" Content=*
| eval rex_template=replace(Content,"[_]*[-]*\d+","*")
| cluster t=0.5 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;Which outputs a set of n(=35) templates (the 'Content' field of logs, where variables/parameters are replaced with wildcards).&lt;/P&gt;

&lt;P&gt;The templates can be viewed at the "Statistics" Tab and can be exported as a CSV file. &lt;/P&gt;

&lt;P&gt;Instead, I would like to export the structured logs which include the additional field 'Template' among others (Time, PID, Component, Content, Level, etc.) from our SPL search. The structured logs can be vieweb in "Events" Tab.&lt;/P&gt;

&lt;P&gt;I am confident that there isn't an option for exporting this from Splunk GUI. Any advice on how I could achieve this?&lt;/P&gt;

&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 14:58:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436170#M76113</guid>
      <dc:creator>psychogyiokosta</dc:creator>
      <dc:date>2019-08-08T14:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to export "Structured Logs" from Splunk to CSV file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436171#M76114</link>
      <description>&lt;P&gt;This is an image of what i can export (templates):  &lt;A href="https://paste.pics/6BWYU"&gt;https://paste.pics/6BWYU&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This is an image of what i want to export (structured logs): &lt;A href="https://paste.pics/6BX0W"&gt;https://paste.pics/6BX0W&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 15:10:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436171#M76114</guid>
      <dc:creator>psychogyiokosta</dc:creator>
      <dc:date>2019-08-08T15:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to export "Structured Logs" from Splunk to CSV file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436172#M76115</link>
      <description>&lt;P&gt;Do you mean that you can only see the lognames in your events tab? But you want to see the contents of the log files from splunk search commands?&lt;/P&gt;

&lt;P&gt;You have to index those logs so that you can extract what you wanted and export into csvs. You can't export log-files as such from splunk.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 04:38:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436172#M76115</guid>
      <dc:creator>nareshinsvu</dc:creator>
      <dc:date>2019-08-09T04:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to export "Structured Logs" from Splunk to CSV file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436173#M76116</link>
      <description>&lt;P&gt;I would like to export the structured log lines shown in Events Tab (&lt;A href="https://paste.pics/6BWYU"&gt;https://paste.pics/6BWYU&lt;/A&gt;).&lt;/P&gt;

&lt;P&gt;Instead, i can only download the templates, shown in Statistics (&lt;A href="https://paste.pics/6BX0W"&gt;https://paste.pics/6BX0W&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 15:31:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436173#M76116</guid>
      <dc:creator>psychogyiokosta</dc:creator>
      <dc:date>2019-08-09T15:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to export "Structured Logs" from Splunk to CSV file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436174#M76117</link>
      <description>&lt;P&gt;Not sure if you are looking to outputlookup into csv?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your base search&amp;gt; | outputlookup structured_logs.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After this, you can read your lookupfile using &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup outputlookup structured_logs.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or find it under &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;%SPLUNK_HOME%\etc\apps\search\lookups folder
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Aug 2019 01:58:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436174#M76117</guid>
      <dc:creator>nareshinsvu</dc:creator>
      <dc:date>2019-08-12T01:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to export "Structured Logs" from Splunk to CSV file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436175#M76118</link>
      <description>&lt;P&gt;Using the following SPL query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="vm-nc-23" index="deeplog" sourcetype="hdfs_log" Content=*

| eval rex_template=replace(Content,"[_]*[-]*\d+","*")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i found out that i am able to extract manually the .csv file of the "structured" logs, that is the logs with the fields that Splunk defines.&lt;BR /&gt;
In these fields, there is also 1 field called "rex_template which extracts the Template of a given log line, as we have defined it here:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval rex_template=replace(Content,"[_]*[-]*\d+","*")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This way of selecting the templates looks very basic. What would we do if we want to extract the structured logs, where the rex_template column is  better structured?&lt;/P&gt;

&lt;P&gt;an example of the current "basic" template extraction would be this:&lt;/P&gt;

&lt;P&gt;Received block blk* src: /&lt;EM&gt;.&lt;/EM&gt;.&lt;EM&gt;.&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":face_blowing_a_kiss:"&gt;😘&lt;/span&gt; dest: /&lt;EM&gt;.&lt;/EM&gt;.&lt;EM&gt;.&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":face_blowing_a_kiss:"&gt;😘&lt;/span&gt; of size * Receiving block blk* src: /&lt;EM&gt;.&lt;/EM&gt;.&lt;EM&gt;.&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":face_blowing_a_kiss:"&gt;😘&lt;/span&gt; dest: /&lt;EM&gt;.&lt;/EM&gt;.&lt;EM&gt;.&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":face_blowing_a_kiss:"&gt;😘&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;This is "ugly", instead i would like to have for example:&lt;/P&gt;

&lt;P&gt;Received block blk&amp;lt;&lt;EM&gt;&amp;gt;  Receiving block blk&amp;lt;&lt;/EM&gt;&amp;gt; &lt;/P&gt;

&lt;P&gt;(Note: src: /&lt;EM&gt;.&lt;/EM&gt;.&lt;EM&gt;.&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":face_blowing_a_kiss:"&gt;😘&lt;/span&gt; dest: /&lt;EM&gt;.&lt;/EM&gt;.&lt;EM&gt;.&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":face_blowing_a_kiss:"&gt;😘&lt;/span&gt; of size * we would like not to have this as well, it is not useful for my purpose)&lt;/P&gt;

&lt;P&gt;Thank you all in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 17:44:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436175#M76118</guid>
      <dc:creator>psychogyiokosta</dc:creator>
      <dc:date>2019-08-19T17:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to export "Structured Logs" from Splunk to CSV file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436176#M76119</link>
      <description>&lt;P&gt;That's helpful to know thank you. Still the lookup file i export as you described are the "templates", that is the lines generated in Statistics tab. &lt;/P&gt;

&lt;P&gt;Is there a way to export the structured logs from the Events tab, similarly to the way you described above?&lt;/P&gt;

&lt;P&gt;Also, since Splunk interface (i use a web browser to use Splunk, i do not have it installed locally) shows in the Event tab the 'structured logs' this means that Splunk saves  the logs somewhere. However if i access my VM where Splunk is installed, i try:&lt;/P&gt;

&lt;P&gt;grep -r 'string i want to find' in the Splunk's filepath and i get no results with files containing this string, indicating that there is no file with the structured logs to download.&lt;/P&gt;

&lt;P&gt;How can i get access to the Event tabs content?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 08:47:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-quot-Structured-Logs-quot-from-Splunk-to-CSV-file/m-p/436176#M76119</guid>
      <dc:creator>psychogyiokosta</dc:creator>
      <dc:date>2019-08-29T08:47:37Z</dc:date>
    </item>
  </channel>
</rss>

