<?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 How do i create a regular expression to extract a particular field from comma separated log entry regardless of its length in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313175#M93749</link>
    <description>&lt;P&gt;Can u help we with below.&lt;/P&gt;

&lt;P&gt;I would like to create regular expression to extract a particular field from comma separated log entry regardless of its length.&lt;/P&gt;

&lt;P&gt;Log entry sample&lt;/P&gt;

&lt;P&gt;2017-02-21 14:25:59,2017-02-21 14:25:59,0.000,101.214.24.6,17.28.191.41,45604,22,TCP,.A....,0,0,1,52,0,0,151129516,151129615,0,0,0,0,0,0,72.128.190.41,0.0.0.0,0,0,00:00:00:00:00:00,00:00:00:00:00:00,00:00:00:00:00:00,00:00:00:00:00:00,0-0-0,0-0-0,0-0-0,0-0-0,0-0-0,0-0-0,0-0-0,0-0-0,0-0-0,0-0-0,    0.000,    0.000,    0.000,&lt;STRONG&gt;72.128.157.2&lt;/STRONG&gt;,1/2,2,2017-02-21 14:26:00.535&lt;/P&gt;

&lt;P&gt;Above log entry is a single linke and has multiple fields which is is comma separated.  I would like to extract the field which is marked in BOLD. That is next hop IP for netflow logs.&lt;BR /&gt;
Basically i would like to only extract the '45th' field in this log entry, regardless of variable data lengths from each fields or type of data.&lt;/P&gt;

&lt;P&gt;Can u pls help.  I tried while extracting fields and let splunk to do it, but when the data size varies, splunk fails to detect certain fields.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Feb 2017 15:35:34 GMT</pubDate>
    <dc:creator>shobithk</dc:creator>
    <dc:date>2017-02-21T15:35:34Z</dc:date>
    <item>
      <title>How do i create a regular expression to extract a particular field from comma separated log entry regardless of its length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313175#M93749</link>
      <description>&lt;P&gt;Can u help we with below.&lt;/P&gt;

&lt;P&gt;I would like to create regular expression to extract a particular field from comma separated log entry regardless of its length.&lt;/P&gt;

&lt;P&gt;Log entry sample&lt;/P&gt;

&lt;P&gt;2017-02-21 14:25:59,2017-02-21 14:25:59,0.000,101.214.24.6,17.28.191.41,45604,22,TCP,.A....,0,0,1,52,0,0,151129516,151129615,0,0,0,0,0,0,72.128.190.41,0.0.0.0,0,0,00:00:00:00:00:00,00:00:00:00:00:00,00:00:00:00:00:00,00:00:00:00:00:00,0-0-0,0-0-0,0-0-0,0-0-0,0-0-0,0-0-0,0-0-0,0-0-0,0-0-0,0-0-0,    0.000,    0.000,    0.000,&lt;STRONG&gt;72.128.157.2&lt;/STRONG&gt;,1/2,2,2017-02-21 14:26:00.535&lt;/P&gt;

&lt;P&gt;Above log entry is a single linke and has multiple fields which is is comma separated.  I would like to extract the field which is marked in BOLD. That is next hop IP for netflow logs.&lt;BR /&gt;
Basically i would like to only extract the '45th' field in this log entry, regardless of variable data lengths from each fields or type of data.&lt;/P&gt;

&lt;P&gt;Can u pls help.  I tried while extracting fields and let splunk to do it, but when the data size varies, splunk fails to detect certain fields.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 15:35:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313175#M93749</guid>
      <dc:creator>shobithk</dc:creator>
      <dc:date>2017-02-21T15:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do i create a regular expression to extract a particular field from comma separated log entry regardless of its length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313176#M93750</link>
      <description>&lt;P&gt;If your next hop IP is always 45th segment (comma as separator), then try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "^([^,]+,){44}(?&amp;lt;next_hop_IP&amp;gt;[^,]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Feb 2017 16:03:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313176#M93750</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-21T16:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do i create a regular expression to extract a particular field from comma separated log entry regardless of its length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313177#M93751</link>
      <description>&lt;P&gt;HI&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Event
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2017-02-15 09:59:51,787@$@VWNV02AX01571@$@72f62f43-7269-4ca9-add5-3b623982a5fc@$@@$@5e3de831-cde6-4b83-be76-0235345063c3@$@OHHNCacheCommonBO@$@LogDynamicObjectsByDelegates@$@LogDynamicObjects@$@2017-02-15 09:59:51.787@$@2017-02-15 09:59:51.787@$@0@$@@$@&lt;/P&gt;

&lt;P&gt;How do i delimit by @$@&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 12:05:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313177#M93751</guid>
      <dc:creator>puneethgowda</dc:creator>
      <dc:date>2017-03-03T12:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do i create a regular expression to extract a particular field from comma separated log entry regardless of its length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313178#M93752</link>
      <description>&lt;P&gt;Hi somesoni&lt;/P&gt;

&lt;P&gt;We want to use regular expression to extract below Even &lt;/P&gt;

&lt;P&gt;Based on 1st accuranc of @$@ will be first column and 2 ND accuranc will be 2nd column like that many fields need to be extracted &lt;BR /&gt;
2017-02-15 09:59:51,787@$@VWNV02AX01571@$@72f62f43-7269-4ca9-add5-3b623982a5fc@$@@$@5e3de831-cde6-4b83-be76-0235345063c3@$@OHHNCacheCommonBO@$@LogDynamicObjectsByDelegates@$@LogDynamicObjects@$@2017-02-15 09:59:51.787@$@2017-02-15 09:59:51.787@$@0@$@@$@&lt;/P&gt;

&lt;P&gt;How do i delimit by @$@&lt;BR /&gt;
2017-02-15 09:59:51,787@$@VWNV02AX01571@$@72f62f43-7269-4ca9-add5-3b623982a5fc@$@@$@5e3de831-cde6-4b83-be76-0235345063c3@$@OHHNCacheCommonBO@$@LogDynamicObjectsByDelegates@$@LogDynamicObjects@$@2017-02-15 09:59:51.787@$@2017-02-15 09:59:51.787@$@0@$@@$@&lt;/P&gt;

&lt;P&gt;How do i delimit by @$@&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2017 05:24:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313178#M93752</guid>
      <dc:creator>puneethgowda</dc:creator>
      <dc:date>2017-03-04T05:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do i create a regular expression to extract a particular field from comma separated log entry regardless of its length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313179#M93753</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; | makeresults | eval key=" 2017-02-15 09:59:51,787@$@VWNV02AX01571@$@72f62f43-7269-4ca9-add5-3b623982a5fc@$@@$@5e3de831-cde6-4b83-be76-0235345063c3@$@OHHNCacheCommonBO@$@LogDynamicObjectsByDelegates@$@LogDynamicObjects@$@2017-02-15 09:59:51.787@$@2017-02-15 09:59:51.787@$@0@$@@$@" |  rex mode=sed field=key "s/\@\$\@/,/g"| rex field=key "^([^,]*,){5}(?&amp;lt;next_hop_IP&amp;gt;[^,]*)" | table key,next_hop_IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In above case I have converted "@$@" to comma and then split based on same logic. Have a try using above for getting the 6th field&lt;/P&gt;</description>
      <pubDate>Sun, 05 Mar 2017 00:02:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313179#M93753</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-03-05T00:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do i create a regular expression to extract a particular field from comma separated log entry regardless of its length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313180#M93754</link>
      <description>&lt;P&gt;In few events we have , inside fields &lt;/P&gt;</description>
      <pubDate>Sun, 05 Mar 2017 10:36:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-create-a-regular-expression-to-extract-a-particular/m-p/313180#M93754</guid>
      <dc:creator>puneethgowda</dc:creator>
      <dc:date>2017-03-05T10:36:28Z</dc:date>
    </item>
  </channel>
</rss>

