<?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: How to extract Time and User from events using regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127272#M34512</link>
    <description>&lt;UL&gt;
&lt;LI&gt;(server02 OR server01) AND 528 | rex "(?:[\S]+ ){6}(?&lt;DATETIME&gt;\S+\s\S+\s\d+:\d+:\d+\s\d{4})[\s\S]*?Name:\s(?&lt;USER&gt;\S+)\s" | Table DateTime, User&lt;/USER&gt;&lt;/DATETIME&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;It looks correct to me.. perfect matching case too&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jul 2014 19:39:11 GMT</pubDate>
    <dc:creator>uayub</dc:creator>
    <dc:date>2014-07-01T19:39:11Z</dc:date>
    <item>
      <title>How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127260#M34500</link>
      <description>&lt;P&gt;The following events are filtered by Snare and sent to Splunk from Windows Servers:&lt;/P&gt;

&lt;P&gt;Server.egcorp.com   MSWinEventLog   1   Security    255931  Tue Jul 01 02:56:52 2014    528 Security    JOHN    User    Success Audit   Server  Logon/Logoff    Successful Logon: User Name: JOHN Domain: egcorp Logon ID: (0x0,0xC8BCFD2) Logon Type: 2 Logon Process: User32 Authentication Package: Negotiate Workstation Name: Server Logon GUID: {122ff468-2a7e-bd13-abfc-3dbf4c3ac3d4} Caller User Name: Server$ Caller Domain: egcorp Caller Logon ID: (0x0,0x3E7) Caller Process ID: 532 Transited Services: - Source Network Address: 127.0.0.1 Source Port: 0 255930&lt;/P&gt;

&lt;P&gt;Objective: To extract the Time and the User from these events using regex to filter these two fields.&lt;BR /&gt;
Result:&lt;BR /&gt;
Jul 01 02:56:52 2014 JOHN&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;W&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 18:04:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127260#M34500</guid>
      <dc:creator>uayub</dc:creator>
      <dc:date>2014-07-01T18:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127261#M34501</link>
      <description>&lt;P&gt;Is that a single event you cited or multiple events?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 18:09:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127261#M34501</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-07-01T18:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127262#M34502</link>
      <description>&lt;P&gt;Multiple events&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 18:12:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127262#M34502</guid>
      <dc:creator>uayub</dc:creator>
      <dc:date>2014-07-01T18:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127263#M34503</link>
      <description>&lt;P&gt;Does the time stamp Splunk has found match your time string in the data?  If so, can you use that for your time?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 18:27:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127263#M34503</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2014-07-01T18:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127264#M34504</link>
      <description>&lt;P&gt;If that's multiple events then you'll have trouble using just regex to get your fields.  I see a date only in the first event and a user name only in the second (twice).  To parse these, you'll first need to combine them using a common field.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 18:31:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127264#M34504</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-07-01T18:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127265#M34505</link>
      <description>&lt;P&gt;The time stamps of Splunk and the event might not be the same.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 18:31:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127265#M34505</guid>
      <dc:creator>uayub</dc:creator>
      <dc:date>2014-07-01T18:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127266#M34506</link>
      <description>&lt;P&gt;RICHGALLOWAY - Sorry I misunderstood your question. The event that I listed above is in-fact just one event. But splunk receives multiple such events.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 18:33:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127266#M34506</guid>
      <dc:creator>uayub</dc:creator>
      <dc:date>2014-07-01T18:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127267#M34507</link>
      <description>&lt;P&gt;This regex string should do the trick.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?:[\S]+ ){6}(?&amp;lt;DateTime&amp;gt;\S+\s\S+\s\d+:\d+:\d+\s\d{4})[\s\S]*?Name:\s(?&amp;lt;User&amp;gt;\S+)\s
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Full Query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(server02 OR server01) AND 528 | rex "(?:[\S]+ ){6}(?&amp;lt;DateTime&amp;gt;\S+\s\S+\s\d+:\d+:\d+\s\d{4})[\s\S]*?Name:\s(?&amp;lt;User&amp;gt;\S+)\s" | table DateTime User
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Jul 2014 18:57:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127267#M34507</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-07-01T18:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127268#M34508</link>
      <description>&lt;P&gt;I tried:&lt;BR /&gt;
* (server02 OR server01) AND 528 | rex "(?:[\S]+ ){6}(?&lt;DATETIME&gt;\S+\s\S+\s\d+:\d+:\d+\s\d{4})[\s\S]*?Name:\s(?&lt;USER&gt;\S+)\s"&lt;/USER&gt;&lt;/DATETIME&gt;&lt;/P&gt;

&lt;P&gt;and I just go the raw events:&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 19:13:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127268#M34508</guid>
      <dc:creator>uayub</dc:creator>
      <dc:date>2014-07-01T19:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127269#M34509</link>
      <description>&lt;P&gt;Add this after the search.  "| table DateTime, User"&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 19:15:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127269#M34509</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-01T19:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127270#M34510</link>
      <description>&lt;P&gt;After applying this , the EVENTS shows the entire raw events but the STATISTICS  shows no results.. am I missing something ...&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 19:33:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127270#M34510</guid>
      <dc:creator>uayub</dc:creator>
      <dc:date>2014-07-01T19:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127271#M34511</link>
      <description>&lt;P&gt;Remember that Splunk is case sensitive.  The field names in the stats and table commands must match those in your rex string exactly.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 19:36:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127271#M34511</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-07-01T19:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127272#M34512</link>
      <description>&lt;UL&gt;
&lt;LI&gt;(server02 OR server01) AND 528 | rex "(?:[\S]+ ){6}(?&lt;DATETIME&gt;\S+\s\S+\s\d+:\d+:\d+\s\d{4})[\s\S]*?Name:\s(?&lt;USER&gt;\S+)\s" | Table DateTime, User&lt;/USER&gt;&lt;/DATETIME&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;It looks correct to me.. perfect matching case too&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 19:39:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127272#M34512</guid>
      <dc:creator>uayub</dc:creator>
      <dc:date>2014-07-01T19:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127273#M34513</link>
      <description>&lt;P&gt;Look closer.  '&lt;CODE&gt;datetime&lt;/CODE&gt;' &amp;lt;&amp;gt; '&lt;CODE&gt;DateTime&lt;/CODE&gt;'; '&lt;CODE&gt;user&lt;/CODE&gt;' &amp;lt;&amp;gt; '&lt;CODE&gt;User&lt;/CODE&gt;'&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 19:46:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127273#M34513</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-07-01T19:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127274#M34514</link>
      <description>&lt;UL&gt;
&lt;LI&gt;(server02 OR server01) AND 528 | rex "(?:[\S]+ ){6}(?&lt;DATETIME&gt;\S+\s\S+\s\d+:\d+:\d+\s\d{4})[\s\S]*?Name:\s(?&lt;USER&gt;\S+)\s" | table DateTime User&lt;/USER&gt;&lt;/DATETIME&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;In the Search all look correct. Only when I paste it in the Splunk Community page it comes different. Still no results are shown. I think the regex is not matching any user in the events.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 20:55:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127274#M34514</guid>
      <dc:creator>uayub</dc:creator>
      <dc:date>2014-07-01T20:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127275#M34515</link>
      <description>&lt;P&gt;I've never known these boards to change text like that.  Perhaps putting backticks around the pasted text will help.&lt;BR /&gt;
Does adding a '*' to the table command show any fields have been parsed?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2014 12:23:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127275#M34515</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-07-02T12:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract Time and User from events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127276#M34516</link>
      <description>&lt;P&gt;After adding the "*", it shows all fields including DateTime and User - but these fields are blank. The rest of the fields have valid data.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jul 2014 21:12:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-Time-and-User-from-events-using-regex/m-p/127276#M34516</guid>
      <dc:creator>uayub</dc:creator>
      <dc:date>2014-07-03T21:12:17Z</dc:date>
    </item>
  </channel>
</rss>

