<?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 is my rex command extracting other text strings in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619874#M215446</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247446"&gt;@jhilton90&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;could you share some sample of your data?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 07 Nov 2022 12:44:45 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-11-07T12:44:45Z</dc:date>
    <item>
      <title>Why is my rex command extracting other text strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619871#M215444</link>
      <description>&lt;P&gt;I am using the following rex command to extract an id number, which is in the following format: 1e4gd5g7-4fy6-fg567-3d46-3gth63f57h35. I am also using the rex command to extract email addresses. However, it seems to extract the wrong information, let me show you:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=keycloak "MFA"
| regex _raw="MFA challenge failed"
| rex "(?i) is (?P&amp;lt;keycloak_id&amp;gt;[^\"]+)"
| rex "(?i) is (?P&amp;lt;email_address&amp;gt;.+?)\.\s+"
| table Account_ID, email_address, keycloak_id, _time&lt;/LI-CODE&gt;&lt;P&gt;However, this is the output that I get:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%"&gt;Account_ID&lt;/TD&gt;&lt;TD width="25%"&gt;email_address&lt;/TD&gt;&lt;TD width="25%"&gt;keycloak_id&lt;/TD&gt;&lt;TD width="25%"&gt;_time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;aaaaaaa&lt;/TD&gt;&lt;TD width="25%"&gt;'OTP is invalid'&lt;/TD&gt;&lt;TD width="25%"&gt;'OTP is invalid'. Keycloak session id is&amp;nbsp;1e4gd5g7-4fy6-fg567-3d46-3gth63f57h35&lt;/TD&gt;&lt;TD width="25%"&gt;2022-11-07 09:56:17.00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm really struggling to properly extract the right information that I'm looking for.&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 12:10:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619871#M215444</guid>
      <dc:creator>jhilton90</dc:creator>
      <dc:date>2022-11-07T12:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my rex command extracting other text strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619874#M215446</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247446"&gt;@jhilton90&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;could you share some sample of your data?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 12:44:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619874#M215446</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-07T12:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my rex command extracting other text strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619876#M215447</link>
      <description>&lt;P&gt;You have a flimsy anchor - for example, " is " occurs multiple times in your event. You need to provide more context to the anchor so the right place can be found in your events.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 12:49:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619876#M215447</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-11-07T12:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my rex command extracting other text strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619884#M215452</link>
      <description>&lt;P&gt;The keycloak_id and email_address are in the same field. Basically the field goes like this:&lt;/P&gt;&lt;P&gt;message: MFA challenge succeeded for account aaaaaa with email &lt;A href="mailto:example@example.com" target="_blank"&gt;example@example.com&lt;/A&gt;. Keycloak session id is 44t4tegr-44fg-4444-4444-444444444444&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 13:38:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619884#M215452</guid>
      <dc:creator>jhilton90</dc:creator>
      <dc:date>2022-11-07T13:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my rex command extracting other text strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619885#M215453</link>
      <description>&lt;P&gt;The keycloak_id and email_address are in the same field. Basically the field goes like this:&lt;/P&gt;&lt;P&gt;message: MFA challenge succeeded for account aaaaaa with email&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="mailto:example@example.com" target="_blank" rel="nofollow noopener noreferrer"&gt;example@example.com&lt;/A&gt;. Keycloak session id is 44t4tegr-44fg-4444-4444-444444444444&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 13:47:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619885#M215453</guid>
      <dc:creator>jhilton90</dc:creator>
      <dc:date>2022-11-07T13:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my rex command extracting other text strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619888#M215454</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247446"&gt;@jhilton90&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "account\s+(?&amp;lt;account&amp;gt;\w+)\s+with\s+email\s+(?&amp;lt;email&amp;gt;[^ ]+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/6zSc2W/1" target="_blank"&gt;https://regex101.com/r/6zSc2W/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 13:59:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619888#M215454</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-07T13:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my rex command extracting other text strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619889#M215455</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=keycloak "MFA"
| regex _raw="MFA challenge failed"
| rex "(?i) account (?P&amp;lt;Account_ID&amp;gt;\S+)\s"
| rex "(?i) session id is (?P&amp;lt;keycloak_id&amp;gt;\S+)"
| rex "(?i) email (?P&amp;lt;email_address&amp;gt;\S+)\.\s+"
| table Account_ID, email_address, keycloak_id, _time&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Nov 2022 14:08:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619889#M215455</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-11-07T14:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my rex command extracting other text strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619891#M215456</link>
      <description>&lt;P&gt;Let me give it a go! Great resource by the way, thank you&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 14:15:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-rex-command-extracting-other-text-strings/m-p/619891#M215456</guid>
      <dc:creator>jhilton90</dc:creator>
      <dc:date>2022-11-07T14:15:02Z</dc:date>
    </item>
  </channel>
</rss>

