<?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 Extracting a specific message from a changing field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-a-specific-message-from-a-changing-field/m-p/602205#M209614</link>
    <description>&lt;P&gt;Hi everyone. I am a new user to Splunk.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recently, I have met some trouble with trying to extract a certain message out from a field I want. I have a field called Message, which logs the message sent to a web server. However, I only want to retrieve a specific field when the message contains the desired field that I want.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example: I want to retrieve the user's name when service is invoked.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="44.4439448441247%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Time&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Message&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="69px"&gt;2021-05-15T01:51:52.321Z&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="69px"&gt;Session ID 1234 has been created&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="47px"&gt;2021-05-15T01:51:52.321Z&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="47px"&gt;Invoked by user David from IP 127.256.25.16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;2021-05-15T01:51:52.321Z&lt;/TD&gt;&lt;TD height="25px"&gt;Configuration Reading - Start&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence, I only want to extract the name David, when that specific message log containing the name appears. Does anyone have any clue how I can extract that field specifically when it appears?&lt;/P&gt;&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;EDITED:&lt;BR /&gt;Hey Splunk Users,&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you met the same problem as I did, where the message logs change constantly, do make sure to search for the message you are looking for first, before drilling down for the specific field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my case:&lt;BR /&gt;| search Message="Invoked by user *"&lt;BR /&gt;| rex field=Message "Invoked by user (?&amp;lt;user&amp;gt;\w+)"&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2022 06:48:36 GMT</pubDate>
    <dc:creator>Michael_Scott</dc:creator>
    <dc:date>2022-06-22T06:48:36Z</dc:date>
    <item>
      <title>Extracting a specific message from a changing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-a-specific-message-from-a-changing-field/m-p/602205#M209614</link>
      <description>&lt;P&gt;Hi everyone. I am a new user to Splunk.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recently, I have met some trouble with trying to extract a certain message out from a field I want. I have a field called Message, which logs the message sent to a web server. However, I only want to retrieve a specific field when the message contains the desired field that I want.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example: I want to retrieve the user's name when service is invoked.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="44.4439448441247%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Time&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Message&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="69px"&gt;2021-05-15T01:51:52.321Z&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="69px"&gt;Session ID 1234 has been created&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="47px"&gt;2021-05-15T01:51:52.321Z&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="47px"&gt;Invoked by user David from IP 127.256.25.16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;2021-05-15T01:51:52.321Z&lt;/TD&gt;&lt;TD height="25px"&gt;Configuration Reading - Start&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence, I only want to extract the name David, when that specific message log containing the name appears. Does anyone have any clue how I can extract that field specifically when it appears?&lt;/P&gt;&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;EDITED:&lt;BR /&gt;Hey Splunk Users,&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you met the same problem as I did, where the message logs change constantly, do make sure to search for the message you are looking for first, before drilling down for the specific field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my case:&lt;BR /&gt;| search Message="Invoked by user *"&lt;BR /&gt;| rex field=Message "Invoked by user (?&amp;lt;user&amp;gt;\w+)"&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 06:48:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-a-specific-message-from-a-changing-field/m-p/602205#M209614</guid>
      <dc:creator>Michael_Scott</dc:creator>
      <dc:date>2022-06-22T06:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting a specific message from a changing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-a-specific-message-from-a-changing-field/m-p/602206#M209615</link>
      <description>&lt;P&gt;Depending on your actual events, this might work&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "Invoked by user (?&amp;lt;user&amp;gt;.+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 Jun 2022 07:56:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-a-specific-message-from-a-changing-field/m-p/602206#M209615</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-17T07:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting a specific message from a changing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-a-specific-message-from-a-changing-field/m-p/602207#M209616</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Well the full message is usually like this:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;Message&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="100%"&gt;Invoked by user David from IP 10.143.235.76&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;I did try to extract the name and the IP Address at the same time, but it still does not extract it as intended.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 08:27:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-a-specific-message-from-a-changing-field/m-p/602207#M209616</guid>
      <dc:creator>Michael_Scott</dc:creator>
      <dc:date>2022-06-17T08:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting a specific message from a changing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-a-specific-message-from-a-changing-field/m-p/602208#M209617</link>
      <description>&lt;P&gt;If the user is just a single word&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=Message "Invoked by user (?&amp;lt;user&amp;gt;\w+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 08:29:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-a-specific-message-from-a-changing-field/m-p/602208#M209617</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-17T08:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting a specific message from a changing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-a-specific-message-from-a-changing-field/m-p/602742#M209801</link>
      <description>&lt;P&gt;Hi there, sorry for getting back to you a bit late.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I actually had to add another line in my query, which is&amp;nbsp;&lt;/P&gt;&lt;P&gt;| search Message="Invoked by user *"&lt;BR /&gt;| rex field=Message "Invoked by user (?&amp;lt;user&amp;gt;\w+)"&lt;/P&gt;&lt;P&gt;This will first return the message I'm looking for, and the user in the message. Thanks a lot for the assistance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 06:49:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-a-specific-message-from-a-changing-field/m-p/602742#M209801</guid>
      <dc:creator>Michael_Scott</dc:creator>
      <dc:date>2022-06-22T06:49:22Z</dc:date>
    </item>
  </channel>
</rss>

