<?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: why does the regex not work? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88279#M22581</link>
    <description>&lt;P&gt;MuS&lt;BR /&gt;
Splunk gives the error: &lt;BR /&gt;
 Invalid regex: syntax error&lt;/P&gt;

&lt;P&gt;when i use this:&lt;BR /&gt;
(?i)((?&amp;lt;=MEthod: )|(?&amp;lt;=Metode: ))(?&lt;FIELDNAME&gt;\w+)&lt;/FIELDNAME&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Oct 2012 09:22:02 GMT</pubDate>
    <dc:creator>kennmunklarsen</dc:creator>
    <dc:date>2012-10-12T09:22:02Z</dc:date>
    <item>
      <title>why does the regex not work?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88276#M22578</link>
      <description>&lt;P&gt;Why does the following regex not both records:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i)(?:MEthod: ) | (?:Metode: )(?P&amp;lt;FIELDNAME&amp;gt;\w+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Records:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2012-10-12 09:27:53,903 Ch pw succeded  Brand: /vvv_erhverv Metode: EMPLOYEE LDAP 
2012-10-12 09:25:44,374 Login succeded  Brand: /ppp_medlem MEthod: SPECIAL  LDAP 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to match SPECIAL and EMPLOYEE&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 07:48:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88276#M22578</guid>
      <dc:creator>kennmunklarsen</dc:creator>
      <dc:date>2012-10-12T07:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: why does the regex not work?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88277#M22579</link>
      <description>&lt;P&gt;How about doing something like:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(?i)brand\:[^\:]+\:\s+(?P&amp;lt;fieldname&amp;gt;[^ ]+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;EDIT: Missed "&lt;CODE&gt;+&lt;/CODE&gt;"&lt;/P&gt;

&lt;P&gt;You can test regex out on the following site &lt;A href="http://gskinner.com/RegExr/"&gt;http://gskinner.com/RegExr/&lt;/A&gt;, (believe @Drainy shared this with me, to pass on some credit &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ) it generally works for most regex you will need.&lt;/P&gt;

&lt;P&gt;EDIT: And using your syntax, I believe the following should work&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(?i)((?:MEthod:\s+)|(?:Metode:\s+))(?P&amp;lt;FIELDNAME&amp;gt;\w+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You had a space between the pipe character.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 07:58:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88277#M22579</guid>
      <dc:creator>MHibbin</dc:creator>
      <dc:date>2012-10-12T07:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: why does the regex not work?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88278#M22580</link>
      <description>&lt;P&gt;I fiddled out this one:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(?i)((?&amp;lt;=MEthod: )|(?&amp;lt;=Metode: ))(?&amp;lt;FIELDNAME&amp;gt;\w+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;this will match only EMPLOYEE and SPECIAL&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 08:16:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88278#M22580</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2012-10-12T08:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: why does the regex not work?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88279#M22581</link>
      <description>&lt;P&gt;MuS&lt;BR /&gt;
Splunk gives the error: &lt;BR /&gt;
 Invalid regex: syntax error&lt;/P&gt;

&lt;P&gt;when i use this:&lt;BR /&gt;
(?i)((?&amp;lt;=MEthod: )|(?&amp;lt;=Metode: ))(?&lt;FIELDNAME&gt;\w+)&lt;/FIELDNAME&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 09:22:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88279#M22581</guid>
      <dc:creator>kennmunklarsen</dc:creator>
      <dc:date>2012-10-12T09:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: why does the regex not work?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88280#M22582</link>
      <description>&lt;P&gt;what happens if your run this:&lt;/P&gt;

&lt;P&gt;&lt;YOURSEARCHTOGETYOURDATA&gt; | regex _raw="(?i)((?&amp;lt;=MEthod: )|(?&amp;lt;=Metode: ))(?&lt;FIELDNAME&gt;\w+)"&lt;/FIELDNAME&gt;&lt;/YOURSEARCHTOGETYOURDATA&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 09:30:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88280#M22582</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2012-10-12T09:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: why does the regex not work?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88281#M22583</link>
      <description>&lt;P&gt;Blimey, why not just do;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i)(?:method|metode)\:\s(\w+) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;?&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 09:46:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-does-the-regex-not-work/m-p/88281#M22583</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2012-10-12T09:46:54Z</dc:date>
    </item>
  </channel>
</rss>

