<?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 write the regex to extract this field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266152#M80037</link>
    <description>&lt;P&gt;I forgot to mention that the point of regular expressions is to match patterns so if you had any other text than "r1_de" then it will not pick it up. Instead the regex should look like the one below, where it will pick up on digits and letters rather than hardcoded values &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(?&amp;lt;=\w\_)\w{2}&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jul 2016 23:21:43 GMT</pubDate>
    <dc:creator>skoelpin</dc:creator>
    <dc:date>2016-07-19T23:21:43Z</dc:date>
    <item>
      <title>How to write the regex to extract this field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266149#M80034</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;Can someone please suggest the regex for this field extraction?&lt;/P&gt;

&lt;P&gt;We need to extract &lt;CODE&gt;de&lt;/CODE&gt; from below context with field as &lt;STRONG&gt;Name&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;csc-3.0.1/r1_de_ *:1012
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 22:36:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266149#M80034</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2016-07-19T22:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract this field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266150#M80035</link>
      <description>&lt;P&gt;Hey @splunker9999  This will work. The way I learned it was by going to regex101.com and pasting the text and writing regex to make it work&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(?&amp;lt;=r1\_)de&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 22:53:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266150#M80035</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2016-07-19T22:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract this field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266151#M80036</link>
      <description>&lt;P&gt;Hi , This doesn't works.&lt;/P&gt;

&lt;P&gt;I used below &lt;BR /&gt;
^[^/\n]*/\w+\d+_(?P[a-z]+)&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 23:14:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266151#M80036</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2016-07-19T23:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract this field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266152#M80037</link>
      <description>&lt;P&gt;I forgot to mention that the point of regular expressions is to match patterns so if you had any other text than "r1_de" then it will not pick it up. Instead the regex should look like the one below, where it will pick up on digits and letters rather than hardcoded values &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(?&amp;lt;=\w\_)\w{2}&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 23:21:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266152#M80037</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2016-07-19T23:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract this field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266153#M80038</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.. | rex "_(?&amp;lt;Name&amp;gt;\w+)_" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;OR&lt;/EM&gt;&lt;/STRONG&gt;*&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.. | rex "_(?&amp;lt;Name&amp;gt;\w{2})_" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jul 2016 01:38:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266153#M80038</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-20T01:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract this field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266154#M80039</link>
      <description>&lt;P&gt;It would help if you could provide many examples of the data, so that we can understand what's variable and what's always the same, as that is key to design a good regex.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 07:23:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-this-field/m-p/266154#M80039</guid>
      <dc:creator>gabriel_vasseur</dc:creator>
      <dc:date>2016-07-20T07:23:57Z</dc:date>
    </item>
  </channel>
</rss>

