<?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 extract two fields separated by delimiter comma &amp;quot;,&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-two-fields-separated-by-delimiter-comma-quot-quot/m-p/138391#M37983</link>
    <description>&lt;P&gt;If you don't feel comfortable or have direct access to the conf files you can do this also in the web UI&lt;/P&gt;

&lt;P&gt;Simply put the regex into a transform settings &amp;gt; fields &amp;gt; transformations&lt;/P&gt;

&lt;P&gt;Then you create a new extraction in settings &amp;gt; fields &amp;gt; field extractions, instead of inline you use tranformation and give the name of the transformation&lt;/P&gt;

&lt;P&gt;This setup has the advantage that you can use the same regex/transformation in multiple extractions, therefore if the regex changes you only have to fix it once and not in every extraction.&lt;/P&gt;

&lt;P&gt;you can do most of the changes in the web UI which is mostly good enough, but not all of it..&lt;/P&gt;</description>
    <pubDate>Wed, 24 Sep 2014 13:46:34 GMT</pubDate>
    <dc:creator>mathiask</dc:creator>
    <dc:date>2014-09-24T13:46:34Z</dc:date>
    <item>
      <title>How to extract two fields separated by delimiter comma ","?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-two-fields-separated-by-delimiter-comma-quot-quot/m-p/138388#M37980</link>
      <description>&lt;P&gt;Here is my output from splunk &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    2014.09.19 13:33:37.739,2014.09.19       13:33:37.726,13,dsd45sd4,gdm=DT30&amp;amp;kslsdj=LiveToday,/cpt/mtp/fgkt/,124.235.124.2,gzip,NONE_FOUND,data,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want   &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;gdm=DT30&amp;amp;kslsdj=LiveToday     
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;data
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;field  please help &lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2014 11:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-two-fields-separated-by-delimiter-comma-quot-quot/m-p/138388#M37980</guid>
      <dc:creator>akash_akkis</dc:creator>
      <dc:date>2014-09-24T11:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract two fields separated by delimiter comma ","?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-two-fields-separated-by-delimiter-comma-quot-quot/m-p/138389#M37981</link>
      <description>&lt;P&gt;Is the value you want is &lt;BR /&gt;
field1="gdm=DT30&amp;amp;kslsdj=LiveToday" &lt;BR /&gt;
field2="data" ?&lt;/P&gt;

&lt;P&gt;The extraction regex will depend quite a bit whether the position is stable in relation to the separators ","&lt;/P&gt;

&lt;P&gt;possible would be something like&lt;/P&gt;

&lt;P&gt;[^,]+,[^,]+,[^,]+,(?&amp;lt;field1&amp;gt;[^,]+),[^,]+,[^,]+,[^,]+,[^,]+,(?&amp;lt;field2&amp;gt;[^,]+),&lt;/P&gt;

&lt;P&gt;This is not tested it could be that a backslash is required before the comma or that the questionmark has to be repositioned&lt;BR /&gt;
you can simply test it by using a search on the corresponding data using the command rex like&lt;/P&gt;

&lt;P&gt;&amp;lt;search&amp;gt; | rex field=_raw "[^,]+,[^,]+,[^,]+,(?&amp;lt;field1&amp;gt;[^,]+),[^,]+,[^,]+,[^,]+,[^,]+,(?&amp;lt;field2&amp;gt;[^,]+),"&lt;/P&gt;

&lt;P&gt;If the fields get extracted correctly you can configure them using the settings &amp;gt; fields &amp;gt; field extractions to extract them automatically on every search on this source or sourcetype or host&lt;/P&gt;

&lt;P&gt;you can also use the Interactive field extractor of splunk I find it a good start but it sometimes produces weird expressions so I tend to rework the manually.&lt;/P&gt;

&lt;P&gt;Here some documentation sources&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Splexicon:Fieldextraction"&gt;http://docs.splunk.com/Splexicon:Fieldextraction&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/ExtractfieldsinteractivelywithIFX&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/rex"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/rex&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/Managesearch-timefieldextractions"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/Managesearch-timefieldextractions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2014 12:31:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-two-fields-separated-by-delimiter-comma-quot-quot/m-p/138389#M37981</guid>
      <dc:creator>mathiask</dc:creator>
      <dc:date>2014-09-24T12:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract two fields separated by delimiter comma ","?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-two-fields-separated-by-delimiter-comma-quot-quot/m-p/138390#M37982</link>
      <description>&lt;P&gt;Another method is to use the props/transforms combination that uses the comma as a delimiter. Here is an example:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [sourcetype]
 REPORT-fields = commafields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [commafields]
 DELIMS = ","
 FIELDS = field1, field2, field3, field4, uri, field6, field7, field8, field9, date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is a link to more information:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2014 13:35:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-two-fields-separated-by-delimiter-comma-quot-quot/m-p/138390#M37982</guid>
      <dc:creator>tgow</dc:creator>
      <dc:date>2014-09-24T13:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract two fields separated by delimiter comma ","?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-two-fields-separated-by-delimiter-comma-quot-quot/m-p/138391#M37983</link>
      <description>&lt;P&gt;If you don't feel comfortable or have direct access to the conf files you can do this also in the web UI&lt;/P&gt;

&lt;P&gt;Simply put the regex into a transform settings &amp;gt; fields &amp;gt; transformations&lt;/P&gt;

&lt;P&gt;Then you create a new extraction in settings &amp;gt; fields &amp;gt; field extractions, instead of inline you use tranformation and give the name of the transformation&lt;/P&gt;

&lt;P&gt;This setup has the advantage that you can use the same regex/transformation in multiple extractions, therefore if the regex changes you only have to fix it once and not in every extraction.&lt;/P&gt;

&lt;P&gt;you can do most of the changes in the web UI which is mostly good enough, but not all of it..&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2014 13:46:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-two-fields-separated-by-delimiter-comma-quot-quot/m-p/138391#M37983</guid>
      <dc:creator>mathiask</dc:creator>
      <dc:date>2014-09-24T13:46:34Z</dc:date>
    </item>
  </channel>
</rss>

