<?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 Regex for extracting Windows event subject line in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extracting-Windows-event-subject-line/m-p/370943#M160543</link>
    <description>&lt;P&gt;LogName=Application&lt;BR /&gt;
SourceName=Oracle&lt;BR /&gt;
EventCode=0&lt;BR /&gt;
EventType=2&lt;BR /&gt;
Type=Error&lt;BR /&gt;
ComputerName=server1.xxx.ds.abcde.com&lt;BR /&gt;
TaskCategory=%1&lt;BR /&gt;
OpCode=Info&lt;BR /&gt;
RecordNumber=5143664&lt;BR /&gt;
Keywords=Classic&lt;BR /&gt;
Message=Log: Oracle&lt;BR /&gt;
Source: INTERFACES&lt;BR /&gt;
Level: Error&lt;BR /&gt;
Subject: &lt;/P&gt;

&lt;P&gt;Object reference not set to an instance of an object.&lt;/P&gt;

&lt;P&gt;Created On (UTC): 6/26/2017 3:03:03 PM&lt;BR /&gt;
Created On (Local Machine): 6/26/2017 11:03:03 AM&lt;/P&gt;

&lt;P&gt;I want to extract only the Subject Field.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2017 15:35:04 GMT</pubDate>
    <dc:creator>macadminrohit</dc:creator>
    <dc:date>2017-06-26T15:35:04Z</dc:date>
    <item>
      <title>Regex for extracting Windows event subject line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extracting-Windows-event-subject-line/m-p/370943#M160543</link>
      <description>&lt;P&gt;LogName=Application&lt;BR /&gt;
SourceName=Oracle&lt;BR /&gt;
EventCode=0&lt;BR /&gt;
EventType=2&lt;BR /&gt;
Type=Error&lt;BR /&gt;
ComputerName=server1.xxx.ds.abcde.com&lt;BR /&gt;
TaskCategory=%1&lt;BR /&gt;
OpCode=Info&lt;BR /&gt;
RecordNumber=5143664&lt;BR /&gt;
Keywords=Classic&lt;BR /&gt;
Message=Log: Oracle&lt;BR /&gt;
Source: INTERFACES&lt;BR /&gt;
Level: Error&lt;BR /&gt;
Subject: &lt;/P&gt;

&lt;P&gt;Object reference not set to an instance of an object.&lt;/P&gt;

&lt;P&gt;Created On (UTC): 6/26/2017 3:03:03 PM&lt;BR /&gt;
Created On (Local Machine): 6/26/2017 11:03:03 AM&lt;/P&gt;

&lt;P&gt;I want to extract only the Subject Field.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 15:35:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-extracting-Windows-event-subject-line/m-p/370943#M160543</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2017-06-26T15:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for extracting Windows event subject line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extracting-Windows-event-subject-line/m-p/370944#M160544</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(?:Subject\:)(?:[\r\n]{2})(?&amp;lt;Subject&amp;gt;.+)(?:[\r\n]{2})(?=Created)&lt;/CODE&gt;&lt;BR /&gt;
or&lt;BR /&gt;
&lt;CODE&gt;(?:Subject\:)(?:[\r\n]{2})(?&amp;lt;Subject&amp;gt;.+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Both work.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/wcPRgS/1"&gt;https://regex101.com/r/wcPRgS/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also as splunk syntax:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| rex field=_raw "(?:Subject\:)(?:[\r\n]{2})(?&amp;lt;Subject&amp;gt;.+)"&lt;/CODE&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;PS: &lt;BR /&gt;
&lt;STRONG&gt;woodcock-style&lt;/STRONG&gt;: MY ANSWER IS THE BEST ANSWER ON THIS SITE. ONLY MY ANSWER IS CORRECT. I NEED KARMA MORE THAN ANYBODY. LIKE, SHARE AND SUBSCRIBE AND ALSO ACCEPT. THANKS! &lt;span class="lia-unicode-emoji" title=":grinning_squinting_face:"&gt;😆&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 16:30:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-extracting-Windows-event-subject-line/m-p/370944#M160544</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2017-06-26T16:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for extracting Windows event subject line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extracting-Windows-event-subject-line/m-p/370945#M160545</link>
      <description>&lt;P&gt;I tried the above regex, none of them extracts the fields. My main aim is to extract a new field called Subject from the event logs.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 15:41:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-extracting-Windows-event-subject-line/m-p/370945#M160545</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2017-06-27T15:41:24Z</dc:date>
    </item>
  </channel>
</rss>

