<?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: Regex to extract information in specific field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437840#M124677</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Give a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval msg="&amp;lt;Hdr Id=\"[ABC6_IN_S14093456789]-a411655e-069c-4ce5-b2d1-b0c22f54c4a3\" Ver=\"0.001\" Dtm=\"2019-05-02T15:59:55Z\" TmOff=\"-07:00\" /&amp;gt;" 
| rex field=msg "Id\=\"\[(?P&amp;lt;id&amp;gt;\w+)\]"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 May 2019 16:49:52 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2019-05-02T16:49:52Z</dc:date>
    <item>
      <title>Regex to extract information in specific field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437839#M124676</link>
      <description>&lt;P&gt;Dear Experts , &lt;BR /&gt;
Need experts advice to extract "ABC6_IN_S14093456789" from below information which is available in field. I think Regex could be used to extract that filed. your help is appreciated.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;Hdr Id="[ABC6_IN_S14093456789]-a411655e-069c-4ce5-b2d1-b0c22f54c4a3" Ver="0.001" Dtm="2019-05-02T15:59:55Z" TmOff="-07:00" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:20:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437839#M124676</guid>
      <dc:creator>kirangurram</dc:creator>
      <dc:date>2020-09-30T00:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract information in specific field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437840#M124677</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Give a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval msg="&amp;lt;Hdr Id=\"[ABC6_IN_S14093456789]-a411655e-069c-4ce5-b2d1-b0c22f54c4a3\" Ver=\"0.001\" Dtm=\"2019-05-02T15:59:55Z\" TmOff=\"-07:00\" /&amp;gt;" 
| rex field=msg "Id\=\"\[(?P&amp;lt;id&amp;gt;\w+)\]"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 May 2019 16:49:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437840#M124677</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-05-02T16:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract information in specific field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437841#M124678</link>
      <description>&lt;P&gt;thanks @vnravikumar . it works for some of the filed. it didnt work for the below sample.&lt;/P&gt;

&lt;P&gt;from the below sample , I want to extract "android-2203920248ea8f16"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;Hdr Id="[android-2203920248ea8f16]-d451c5a7-e8e8-470a-93e8-f2c576c3507b" Ver="0.001" Dtm="2019-05-02T15:59:52Z" TmOff="-05:00" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 May 2019 17:22:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437841#M124678</guid>
      <dc:creator>kirangurram</dc:creator>
      <dc:date>2019-05-02T17:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract information in specific field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437842#M124679</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this rex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Id\=\"\[(?P&amp;lt;id&amp;gt;)[\w-]+\]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 May 2019 17:57:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437842#M124679</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-05-02T17:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract information in specific field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437843#M124680</link>
      <description>&lt;P&gt;Please try below . (The logic is to say greedily collect all characters until it finds &lt;CODE&gt;]&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Id=\"\[(?P&amp;lt;my_id&amp;gt;[^\]]+)\]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Demo in &lt;A href="https://regex101.com/r/gzRrkc/1"&gt;Regex101&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So in Splunk it would be  (assuming _raw is your event)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex "Id=\"\[(?&amp;lt;my_id&amp;gt;[^\]]+)\]"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 May 2019 18:50:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437843#M124680</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-02T18:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract information in specific field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437844#M124681</link>
      <description>&lt;P&gt;thanks mate @koshyk. your answer served my purpose.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 01:34:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437844#M124681</guid>
      <dc:creator>kirangurram</dc:creator>
      <dc:date>2019-05-03T01:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract information in specific field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437845#M124682</link>
      <description>&lt;P&gt;In Splunk &lt;CODE&gt;P&lt;/CODE&gt; is not needed, so can write:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | rex "Id=\"\[(?&amp;lt;my_id&amp;gt;[^\]]+)\]"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think &lt;CODE&gt;]&lt;/CODE&gt; does not need to be escaped between &lt;CODE&gt;[]&lt;/CODE&gt;, so this should also work &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | rex "Id=\"\[(?&amp;lt;my_id&amp;gt;[^]]+)\]"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 May 2019 05:19:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-information-in-specific-field/m-p/437845#M124682</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2019-05-03T05:19:57Z</dc:date>
    </item>
  </channel>
</rss>

