<?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: Extraction using regular expressions in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330347#M98318</link>
    <description>&lt;P&gt;Hi honobe,&lt;/P&gt;

&lt;P&gt;based on the provided information this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; '&amp;lt;(?&amp;lt;Message_ID&amp;gt;[^&amp;gt;]+)&amp;gt;'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will match everything between &lt;CODE&gt;'&amp;lt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;gt;'&lt;/CODE&gt; and use the match in the new field called &lt;CODE&gt;Message_ID&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;This is a really basic example and can be optimised but I hope it helps to get you started ...&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;btw don't use field names with spaces&lt;/EM&gt; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2017 10:34:51 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2017-07-26T10:34:51Z</dc:date>
    <item>
      <title>Extraction using regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330345#M98316</link>
      <description>&lt;P&gt;I want to extract a character string using a regular expression.&lt;/P&gt;

&lt;P&gt;I am considering extracting the field (message ID) using the rex command, but I can not extract it with regular expressions.&lt;/P&gt;

&lt;P&gt;Message ID = '&amp;lt;　xxxxxxxx&amp;gt;'&lt;/P&gt;

&lt;P&gt;※I want to extract characters between ｢'&amp;lt;｣ and　｢&amp;gt;'｣&lt;BR /&gt;
※There is no space in the actual log.&lt;/P&gt;

&lt;P&gt;I want to extract xxxxxxxx and make the field of message ID have the following form.&lt;/P&gt;

&lt;P&gt;Message ID = xxxxxxxx&lt;/P&gt;

&lt;P&gt;What kind of regular expression can I use to extract xxxxxxxx?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 09:52:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330345#M98316</guid>
      <dc:creator>honobe</dc:creator>
      <dc:date>2017-07-26T09:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction using regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330346#M98317</link>
      <description>&lt;P&gt;Try the following run-anywhere example.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw = "Message ID = '&amp;lt;　xxxxxxxx&amp;gt;'"
| rex field=_raw "Message ID = '&amp;lt;(?&amp;lt;MessageID&amp;gt;[^&amp;gt;]+)&amp;gt;'"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can test the rex with your sample events. Eventually, create a Field Extraction Knowledge Object for the same.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 10:29:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330346#M98317</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-26T10:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction using regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330347#M98318</link>
      <description>&lt;P&gt;Hi honobe,&lt;/P&gt;

&lt;P&gt;based on the provided information this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; '&amp;lt;(?&amp;lt;Message_ID&amp;gt;[^&amp;gt;]+)&amp;gt;'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will match everything between &lt;CODE&gt;'&amp;lt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;gt;'&lt;/CODE&gt; and use the match in the new field called &lt;CODE&gt;Message_ID&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;This is a really basic example and can be optimised but I hope it helps to get you started ...&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;btw don't use field names with spaces&lt;/EM&gt; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 10:34:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330347#M98318</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-07-26T10:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction using regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330348#M98319</link>
      <description>&lt;P&gt;typing too slow...again&lt;/P&gt;

&lt;P&gt;Just a little tip: there is actually no need to escape the &lt;CODE&gt;&amp;gt;&lt;/CODE&gt; inside of the &lt;CODE&gt;[...]&lt;/CODE&gt; it will also work without the escaping &lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 10:37:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330348#M98319</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-07-26T10:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction using regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330349#M98320</link>
      <description>&lt;P&gt;Thank you very much.&lt;BR /&gt;
Thanks to your answer, I was able to solve the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 11:38:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330349#M98320</guid>
      <dc:creator>honobe</dc:creator>
      <dc:date>2017-07-26T11:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction using regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330350#M98321</link>
      <description>&lt;P&gt;Thank you very much.&lt;BR /&gt;
Thanks to your answer, I was able to solve the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 11:39:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330350#M98321</guid>
      <dc:creator>honobe</dc:creator>
      <dc:date>2017-07-26T11:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction using regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330351#M98322</link>
      <description>&lt;P&gt;Thanks @Mus, I have corrected. But \ in regular expression also tells &lt;CODE&gt;match exactly&lt;/CODE&gt;. It works either way, I missed removing it.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 11:49:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-using-regular-expressions/m-p/330351#M98322</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-26T11:49:00Z</dc:date>
    </item>
  </channel>
</rss>

