<?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 customize raw data into fields using regex before exporting to CSV? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-raw-data-into-fields-using-regex-before/m-p/159240#M44930</link>
    <description>&lt;UL&gt;
&lt;LI&gt;A more permanent solution would be using &lt;STRONG&gt;transforms.conf&lt;/STRONG&gt; and &lt;STRONG&gt;props.conf&lt;/STRONG&gt;. Docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles"&gt;here&lt;/A&gt;. &lt;/LI&gt;
&lt;LI&gt;or use the field extractor ? Docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;here&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;or maybe you just love that web gui ? You can manage extractions there as well. &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/Knowledge/Managesearch-timefieldextractions"&gt;Here&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;HR /&gt;

&lt;P&gt;Example: &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Add a new error code field&lt;/STRONG&gt;&lt;BR /&gt;
This example shows how to create a new "error code" field by configuring a field extraction in props.conf. The field can be identified by the occurrence of device_id= followed by a word within brackets and a text string terminating with a colon. The field should be extracted from events related to the testlog source type.&lt;/P&gt;

&lt;P&gt;In props.conf, add:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[testlog]
EXTRACT-errors = device_id=\[w+\](?&amp;lt;err_code&amp;gt;[^:]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or get jiggy with that GUI:&lt;BR /&gt;
&lt;IMG src="http://docs.splunk.com/images/f/f4/60NewFieldExtraction.png" alt="alt text" /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Feb 2015 23:43:44 GMT</pubDate>
    <dc:creator>aljohnson_splun</dc:creator>
    <dc:date>2015-02-24T23:43:44Z</dc:date>
    <item>
      <title>How to customize raw data into fields using regex before exporting to CSV?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-raw-data-into-fields-using-regex-before/m-p/159237#M44927</link>
      <description>&lt;P&gt;We are ingesting syslog logs. While doing a search and exporting to csv, we would like the raw data column to be split into readable fields. Do I need to use regex? &lt;/P&gt;

&lt;P&gt;What can I post here so you can see the raw data?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 22:37:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-customize-raw-data-into-fields-using-regex-before/m-p/159237#M44927</guid>
      <dc:creator>zoeygirl45</dc:creator>
      <dc:date>2015-02-24T22:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize raw data into fields using regex before exporting to CSV?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-raw-data-into-fields-using-regex-before/m-p/159238#M44928</link>
      <description>&lt;P&gt;you could post a few lines from your logs itself... &lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 22:52:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-customize-raw-data-into-fields-using-regex-before/m-p/159238#M44928</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2015-02-24T22:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize raw data into fields using regex before exporting to CSV?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-raw-data-into-fields-using-regex-before/m-p/159239#M44929</link>
      <description>&lt;P&gt;You can try using the "erex" command that Splunk has. This command basically creates your rex call for you.&lt;/P&gt;

&lt;P&gt;Here's how it works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... YOUR SEARCH ... | erex FIELD_NAME examples="2345,3455,9283"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After your search, use the erex command by replacing &lt;CODE&gt;FIELD_NAME&lt;/CODE&gt; with a name of your choice and then post &lt;STRONG&gt;real&lt;/STRONG&gt; examples of the data that you want to be put in this field (you only need two or three examples). These examples of yours will replace the dummy data that I have above in between quotes. Your examples must be comma separated and surrounded by quotes.&lt;/P&gt;

&lt;P&gt;After your search runs, the rex command that it creates for you can be found under the "Jobs" tab.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 23:23:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-customize-raw-data-into-fields-using-regex-before/m-p/159239#M44929</guid>
      <dc:creator>rlough</dc:creator>
      <dc:date>2015-02-24T23:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize raw data into fields using regex before exporting to CSV?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-raw-data-into-fields-using-regex-before/m-p/159240#M44930</link>
      <description>&lt;UL&gt;
&lt;LI&gt;A more permanent solution would be using &lt;STRONG&gt;transforms.conf&lt;/STRONG&gt; and &lt;STRONG&gt;props.conf&lt;/STRONG&gt;. Docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles"&gt;here&lt;/A&gt;. &lt;/LI&gt;
&lt;LI&gt;or use the field extractor ? Docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;here&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;or maybe you just love that web gui ? You can manage extractions there as well. &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/Knowledge/Managesearch-timefieldextractions"&gt;Here&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;HR /&gt;

&lt;P&gt;Example: &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Add a new error code field&lt;/STRONG&gt;&lt;BR /&gt;
This example shows how to create a new "error code" field by configuring a field extraction in props.conf. The field can be identified by the occurrence of device_id= followed by a word within brackets and a text string terminating with a colon. The field should be extracted from events related to the testlog source type.&lt;/P&gt;

&lt;P&gt;In props.conf, add:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[testlog]
EXTRACT-errors = device_id=\[w+\](?&amp;lt;err_code&amp;gt;[^:]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or get jiggy with that GUI:&lt;BR /&gt;
&lt;IMG src="http://docs.splunk.com/images/f/f4/60NewFieldExtraction.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 23:43:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-customize-raw-data-into-fields-using-regex-before/m-p/159240#M44930</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2015-02-24T23:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize raw data into fields using regex before exporting to CSV?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-raw-data-into-fields-using-regex-before/m-p/159241#M44931</link>
      <description>&lt;P&gt;If this is syslog, and your timestamps and events are being recognized correctly, you can use the Field Extractor Utility to extract fields as you desire. And then using the fields and outputcsv commands, you can format how you want your CSV to look.&lt;/P&gt;

&lt;P&gt;Other options as mentioned are using props and transforms to create your own extractions and fields.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 00:10:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-customize-raw-data-into-fields-using-regex-before/m-p/159241#M44931</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-02-25T00:10:00Z</dc:date>
    </item>
  </channel>
</rss>

