<?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: Extract text from Message field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-Message-field/m-p/552266#M156732</link>
    <description>&lt;P&gt;Hey HMIPowell,&lt;/P&gt;&lt;P&gt;If your goal was to do this at search time (meaning in your search) you will use the rex command to accomplish this. There are multiple ways to do the regex and the final solution will depend on what the other logs in your search look like. One way to accomplish this field extraction is to use lookaheads and lookbehinds.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| yoursearch

| rex field=Message "((?&amp;lt;email&amp;gt;)?&amp;lt;=user)(.+?(?=with))"

| restofsearch&lt;/LI-CODE&gt;&lt;P&gt;This will extract the email field by taking the text between (and not including) the words 'user' and 'with'. This may not work in your environment if other similar logs are present.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 May 2021 19:13:25 GMT</pubDate>
    <dc:creator>96nick</dc:creator>
    <dc:date>2021-05-19T19:13:25Z</dc:date>
    <item>
      <title>How to extract text from Message field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-Message-field/m-p/552265#M156731</link>
      <description>&lt;P&gt;This should be something simple to figure out, but I can't get it to work.&amp;nbsp; I want to extract username from Message field of Sec Event Log&lt;/P&gt;
&lt;DIV class="shared-page"&gt;
&lt;DIV class="main-section-body"&gt;
&lt;DIV class="search"&gt;
&lt;DIV class="search-results"&gt;
&lt;DIV class="tab-content"&gt;
&lt;DIV class="tab-pane events-fields-container search-results-eventspane show-fields"&gt;
&lt;DIV class="search-results-wrapper"&gt;
&lt;DIV class="lazy-view-container lazy-events-viewer shared-eventsviewer-lazyeventsviewer"&gt;
&lt;DIV class="shared-eventsviewer"&gt;
&lt;DIV class="scrolling-table-wrapper shared-eventsviewer-list"&gt;&lt;BR /&gt;Message=NPS Extension for Azure MFA: CID: 6gof474f-4g9d-894f-asb-9abffedxs618 : Access Accepted for user Barry.Allen@LexLIndustries.org with Azure MFA response: Success and message: session r334r562-cf4f-7584-afc5-essdfs4dd67&lt;/DIV&gt;
&lt;DIV class="scrolling-table-wrapper shared-eventsviewer-list"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="scrolling-table-wrapper shared-eventsviewer-list"&gt;I want to pull the email address after 'user' in message and assign it to a field. Any help appreciated.&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 31 May 2022 13:48:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-Message-field/m-p/552265#M156731</guid>
      <dc:creator>HMIPowell</dc:creator>
      <dc:date>2022-05-31T13:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from Message field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-Message-field/m-p/552266#M156732</link>
      <description>&lt;P&gt;Hey HMIPowell,&lt;/P&gt;&lt;P&gt;If your goal was to do this at search time (meaning in your search) you will use the rex command to accomplish this. There are multiple ways to do the regex and the final solution will depend on what the other logs in your search look like. One way to accomplish this field extraction is to use lookaheads and lookbehinds.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| yoursearch

| rex field=Message "((?&amp;lt;email&amp;gt;)?&amp;lt;=user)(.+?(?=with))"

| restofsearch&lt;/LI-CODE&gt;&lt;P&gt;This will extract the email field by taking the text between (and not including) the words 'user' and 'with'. This may not work in your environment if other similar logs are present.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 19:13:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-Message-field/m-p/552266#M156732</guid>
      <dc:creator>96nick</dc:creator>
      <dc:date>2021-05-19T19:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from Message field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-Message-field/m-p/552280#M156737</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval Message="NPS Extension for Azure MFA: CID: 6gof474f-4g9d-894f-asb-9abffedxs618 : Access Accepted for user Barry.Allen@LexLIndustries.org with Azure MFA response: Success and message: session r334r562-cf4f-7584-afc5-essdfs4dd67"
| rex field=Message "user (?&amp;lt;email&amp;gt;.*) with"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 19 May 2021 20:27:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-Message-field/m-p/552280#M156737</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2021-05-19T20:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from Message field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-Message-field/m-p/552379#M156782</link>
      <description>&lt;P&gt;I was able to use the following to get what I needed.&lt;/P&gt;&lt;P&gt;| rex field=Message "\S*user (?&amp;lt;TestField&amp;gt;\S*)"&lt;/P&gt;&lt;P&gt;Thanks for some of the ideas&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 11:47:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-Message-field/m-p/552379#M156782</guid>
      <dc:creator>HMIPowell</dc:creator>
      <dc:date>2021-05-20T11:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from Message field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-Message-field/m-p/599796#M208766</link>
      <description>&lt;P&gt;What is&amp;nbsp;&lt;SPAN&gt;&amp;lt;TestField&amp;gt; here?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 06:12:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-Message-field/m-p/599796#M208766</guid>
      <dc:creator>vaishalireddy</dc:creator>
      <dc:date>2022-05-31T06:12:33Z</dc:date>
    </item>
  </channel>
</rss>

