<?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: Use regex to pull out a phrase with a specific word in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621087#M106988</link>
    <description>&lt;P&gt;I read the OP was wanting to put all MFAs in a single table rather than in separate tables.&amp;nbsp; To put them into separate tables requires separate searches using a regex specific to the desired MFA.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Nov 2022 15:37:19 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-11-16T15:37:19Z</dc:date>
    <item>
      <title>Use regex to pull out a phrase with a specific word?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/620919#M106970</link>
      <description>&lt;P&gt;Right now I'm using regex to pull data with the phrase "MFA challenge succeeded" using the following regex:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;MFA&amp;gt;[a-z,A-Z,\s,\bcode\b]+)account\s+(?&amp;lt;account&amp;gt;\w+)\s+with\s+email\s+(?&amp;lt;email&amp;gt;[^ ]+).\s+\w+\s+\w+\s+\w+\s+\w+\s+(?&amp;lt;keycloak_id&amp;gt;[a-z,0-9,-]+)"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;from the following field:&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;message: MFA challenge succeeded for account aaaaaaa. Email is example@example.com. Keycloak session id is 11111111-1111-1111-1111-1111111111111&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;However in the message field the&amp;nbsp;&lt;EM&gt;MFA challenge succeeded&lt;/EM&gt; will often be different, such as:&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;MFA challenge issued&lt;BR /&gt;MFA code issued&lt;BR /&gt;MFA challenge failed.&lt;/P&gt;
&lt;P data-unlink="true"&gt;I need a way to use regex to pull out messages where it says MFA challenge issued, MFA code issued, MFA challenge failed and then display them in a table&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 15:01:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/620919#M106970</guid>
      <dc:creator>jhilton90</dc:creator>
      <dc:date>2022-11-16T15:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Use regex to pull out a phrase with a specific word</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/620923#M106971</link>
      <description>&lt;P&gt;The regex is looking for the phrase " with email ", but that text is not in the example event.&amp;nbsp; Can you make sure the provided examples are correct, please?&lt;/P&gt;&lt;P&gt;Entries in a regex character class are not separated by commas.&amp;nbsp; Use &lt;FONT face="courier new,courier"&gt;([a-zA-Z\s]|\bcode\b)&lt;/FONT&gt; in place of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;[a-z,A-Z,\s,\bcode\b]&lt;/FONT&gt; and&amp;nbsp;&lt;FONT face="courier new,courier"&gt;[a-z0-9-]&lt;/FONT&gt; in place of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;[a-z,0-9,-]&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;This rex command works with the provided text.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;MFA&amp;gt;MFA (challenge succeeded|challenge issued|challenge failed|code issued)) for account (?&amp;lt;account&amp;gt;\w+)\. Email is (?&amp;lt;email&amp;gt;\S+)\. Keycloak session id is (?&amp;lt;keycloak&amp;gt;\S+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Nov 2022 15:51:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/620923#M106971</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-11-15T15:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Use regex to pull out a phrase with a specific word</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621037#M106984</link>
      <description>&lt;P&gt;Thanks Rich, I've used the following code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=keycloak "MFA"
| rex "(?&amp;lt;MFA&amp;gt;MFA (challenge succeeded|challenge issued|challenge failed|code issued)) for account (?&amp;lt;account&amp;gt;\w+)\. Email is (?&amp;lt;email&amp;gt;\S+)\. Keycloak session id is (?&amp;lt;keycloak&amp;gt;\S+)"
| where isnotnull (account)
| table account, email, keycloak_id, MFA, _time&lt;/LI-CODE&gt;&lt;P&gt;However, in the MFA column in the table it's only printing "MFA challenge issued"&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 11:31:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621037#M106984</guid>
      <dc:creator>jhilton90</dc:creator>
      <dc:date>2022-11-16T11:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Use regex to pull out a phrase with a specific word</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621066#M106985</link>
      <description>&lt;P&gt;Where there other events during the selected time window?&amp;nbsp; Can you please share them so I can verify the regex?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 14:31:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621066#M106985</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-11-16T14:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Use regex to pull out a phrase with a specific word</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621076#M106987</link>
      <description>&lt;P&gt;Yes there were other events as well such as:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;message: MFA code issued for account bbbbbbbb with email example@example.com using sms. Keycloak session id is dddddddd-4444-5555-6666-ggggggggggggg&lt;/LI-CODE&gt;&lt;P&gt;The events that say MFA code issued are going to be displayed in one table, then the events that say MFA challenge issued will be displayed in another table etc&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 15:00:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621076#M106987</guid>
      <dc:creator>jhilton90</dc:creator>
      <dc:date>2022-11-16T15:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Use regex to pull out a phrase with a specific word</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621087#M106988</link>
      <description>&lt;P&gt;I read the OP was wanting to put all MFAs in a single table rather than in separate tables.&amp;nbsp; To put them into separate tables requires separate searches using a regex specific to the desired MFA.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 15:37:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621087#M106988</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-11-16T15:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Use regex to pull out a phrase with a specific word</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621091#M106989</link>
      <description>&lt;P&gt;Sorry I should have been clearer. The regex used to extract MFA challenge issued, MFA code issued, MFA successful, MFA failed will all go into their own separate tables&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 15:59:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621091#M106989</guid>
      <dc:creator>jhilton90</dc:creator>
      <dc:date>2022-11-16T15:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Use regex to pull out a phrase with a specific word</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621100#M106990</link>
      <description>&lt;P&gt;Thanks for clarifying.&amp;nbsp; Separate tables call for separate searches and each search would have a &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command that matched only one of the MFA values.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 16:36:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621100#M106990</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-11-16T16:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Use regex to pull out a phrase with a specific word</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621101#M106991</link>
      <description>&lt;P&gt;I've tried using&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;MFA&amp;gt;MFA (code issued)) for account (?&amp;lt;account&amp;gt;\w+)\. Email is (?&amp;lt;email&amp;gt;\S+)\. Keycloak session id is (?&amp;lt;keycloak&amp;gt;\S+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But that doesn't seem to want to work, at least when I test it on regex101 it doesn't like it&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 16:38:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621101#M106991</guid>
      <dc:creator>jhilton90</dc:creator>
      <dc:date>2022-11-16T16:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Use regex to pull out a phrase with a specific word</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621107#M106993</link>
      <description>&lt;P&gt;Regex doesn't like it because it doesn't match the event.&amp;nbsp; Despite similarities around "MFA" the messages are not the same.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;message: MFA challenge succeeded for account aaaaaaa. Email is example@example.com. Keycloak session id is 11111111-1111-1111-1111-1111111111111&lt;/LI-CODE&gt;&lt;P&gt;has different noise words between the fields than does&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;message: MFA code issued for account bbbbbbbb with email example@example.com using sms. Keycloak session id is dddddddd-4444-5555-6666-ggggggggggggg&lt;/LI-CODE&gt;&lt;P&gt;The regex needs to match the event from which you are extracting fields.&amp;nbsp; Try this for "MFA code issued" events:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;MFA&amp;gt;MFA code issued) for account (?&amp;lt;account&amp;gt;\w+) with email (?&amp;lt;email&amp;gt;\S+) using sms\. Keycloak session id is (?&amp;lt;keycloak&amp;gt;\S+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 16:53:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Use-regex-to-pull-out-a-phrase-with-a-specific-word/m-p/621107#M106993</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-11-16T16:53:13Z</dc:date>
    </item>
  </channel>
</rss>

