<?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 question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/661299#M228312</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;you could try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| rex field=field "(?&amp;lt;foo&amp;gt;999[a-zA-Z0-9]{3})_*"&lt;/LI-CODE&gt;&lt;P&gt;Then you have this in field foo. You should change [a-ZA-Z0-9] if those 3 characters could be something else than those.&lt;/P&gt;&lt;P&gt;r. Ismo&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2023 06:27:12 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2023-10-19T06:27:12Z</dc:date>
    <item>
      <title>regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/661297#M228310</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I'm trying to work out how to strip down a field&amp;nbsp;&lt;/P&gt;&lt;P&gt;field="blah_&lt;STRONG&gt;6chars&lt;/STRONG&gt;_blah_blah"&lt;/P&gt;&lt;P&gt;the &lt;STRONG&gt;6chars&lt;/STRONG&gt; is what I want to extract and the 6 chars are always prefixed with 999.&lt;BR /&gt;the 6 chars prefixed with 999 might be in a different place in the field.&amp;nbsp; i.e.&amp;nbsp;&amp;nbsp;blah_blah_&lt;STRONG&gt;6chars&lt;/STRONG&gt;_blah&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;6chars&lt;/STRONG&gt; example value=999aaa&lt;/P&gt;&lt;P&gt;so the regex should find&amp;nbsp; all occurences of 999 in the field and extract the 999 and the next 3 chars and create an additional field with the result&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 06:17:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/661297#M228310</guid>
      <dc:creator>splunk_novice99</dc:creator>
      <dc:date>2023-10-19T06:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/661299#M228312</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;you could try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| rex field=field "(?&amp;lt;foo&amp;gt;999[a-zA-Z0-9]{3})_*"&lt;/LI-CODE&gt;&lt;P&gt;Then you have this in field foo. You should change [a-ZA-Z0-9] if those 3 characters could be something else than those.&lt;/P&gt;&lt;P&gt;r. Ismo&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 06:27:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/661299#M228312</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-10-19T06:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/661304#M228314</link>
      <description>&lt;P&gt;You need to be precise in data description. &amp;nbsp;I assume that the six characters starting with 999 are bounded by underscore (_), beginning of the string, or end of the string. &amp;nbsp;Something like the following would do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=field "^([^_]+_)*(?&amp;lt;six_char&amp;gt;999.{3})(_[^_]+)*$"&lt;/LI-CODE&gt;&lt;P&gt;Here is an emulation you can play with and compare with real data.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval field=mvappend("blah_999ars_blah_blah", "blah_blah_999cha_blah", "9996ch_blah_blah_blah", "blah_blah_blah_999har")
| mvexpand field
``` data emulation above ```&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Oct 2023 06:38:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/661304#M228314</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-10-19T06:38:05Z</dc:date>
    </item>
  </channel>
</rss>

