<?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: Using rex command to extract Message field in Windows Event Logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550676#M158683</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234009"&gt;@Alfred&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes, you can use a table comand after the rex comand&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "(Message=(?&amp;lt;message&amp;gt;[a-zA-z ].*)Subject)" | table message&lt;/LI-CODE&gt;&lt;P&gt;rex comand can extract fields in search time&lt;/P&gt;&lt;P&gt;If you want define the extraction at index time you can put the regex expression on the props.conf file&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[your sourcetype]
EXTRACT-message =  (Message=(?&amp;lt;message&amp;gt;[a-zA-z ].*)Subject)&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.3/Knowledge/Exampleconfigurationswithprops.conf" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.3/Knowledge/Exampleconfigurationswithprops.conf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 18:49:11 GMT</pubDate>
    <dc:creator>aasabatini</dc:creator>
    <dc:date>2021-05-06T18:49:11Z</dc:date>
    <item>
      <title>Using rex command to extract Message field in Windows Event Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550597#M158679</link>
      <description>&lt;P&gt;I want to extract from the Message field in the Windows Event Log just the first few words until the period - example would be:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Message=&lt;U&gt;A&lt;/U&gt;&lt;/SPAN&gt;&lt;U&gt; user account was unlocked&lt;/U&gt;&lt;SPAN&gt;.&lt;/SPAN&gt; Subject: Security ID: xxxxxxxxxxxxxxxx Account Name: xxxxxxxxxx Account Domain: xxxxxxxxx Logon ID: xxxxxxxxxx Target Account: Security ID: xxxxxxxxxxxxxx-xxxxxxxx Account Name: xxxxxxxxxx Account Domain: xxxxxxxxxx&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 05:44:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550597#M158679</guid>
      <dc:creator>Alfred</dc:creator>
      <dc:date>2021-05-06T05:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using rex command to extract Message field in Windows Event Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550601#M158680</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234009"&gt;@Alfred&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the best way to extract these fields is:&lt;/P&gt;&lt;P&gt;the key value automatic extraction&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.3/Knowledge/Automatickey-valuefieldextractionsatsearch-time" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.3/Knowledge/Automatickey-valuefieldextractionsatsearch-time&lt;/A&gt;&lt;/P&gt;&lt;P&gt;anyway if you need a rex for other reason this is a good way to extract the message field&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "(Message=(?&amp;lt;message&amp;gt;[a-zA-z ].*)Subject)"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 06 May 2021 06:44:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550601#M158680</guid>
      <dc:creator>aasabatini</dc:creator>
      <dc:date>2021-05-06T06:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using rex command to extract Message field in Windows Event Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550661#M158681</link>
      <description>&lt;P&gt;Thanks aasabatini ...&amp;nbsp; my goal is as follows :&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the Message ( extracted) field I need to table only the first sentence instead of the whole message&amp;nbsp; &amp;nbsp;- your rex command seem to be correct but applying it did not change the Message output in the query , I still see the whole message&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 15:36:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550661#M158681</guid>
      <dc:creator>Alfred</dc:creator>
      <dc:date>2021-05-06T15:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using rex command to extract Message field in Windows Event Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550669#M158682</link>
      <description>&lt;P&gt;I found an extraction created after running the rex command you sent -&amp;nbsp; called "name " - I wonder if I can give a name to the rex extraction ... so I can call it in a table&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 16:40:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550669#M158682</guid>
      <dc:creator>Alfred</dc:creator>
      <dc:date>2021-05-06T16:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using rex command to extract Message field in Windows Event Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550676#M158683</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234009"&gt;@Alfred&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes, you can use a table comand after the rex comand&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "(Message=(?&amp;lt;message&amp;gt;[a-zA-z ].*)Subject)" | table message&lt;/LI-CODE&gt;&lt;P&gt;rex comand can extract fields in search time&lt;/P&gt;&lt;P&gt;If you want define the extraction at index time you can put the regex expression on the props.conf file&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[your sourcetype]
EXTRACT-message =  (Message=(?&amp;lt;message&amp;gt;[a-zA-z ].*)Subject)&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.3/Knowledge/Exampleconfigurationswithprops.conf" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.3/Knowledge/Exampleconfigurationswithprops.conf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 18:49:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550676#M158683</guid>
      <dc:creator>aasabatini</dc:creator>
      <dc:date>2021-05-06T18:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using rex command to extract Message field in Windows Event Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550695#M158684</link>
      <description>&lt;P&gt;That solved it - Thanks for all your help&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 21:23:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-rex-command-to-extract-Message-field-in-Windows-Event-Logs/m-p/550695#M158684</guid>
      <dc:creator>Alfred</dc:creator>
      <dc:date>2021-05-06T21:23:10Z</dc:date>
    </item>
  </channel>
</rss>

