<?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: Simple regex problem in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Simple-regex-problem/m-p/43876#M10351</link>
    <description>&lt;P&gt;I am not sure of the answer to your rex problem, but I do have a suggestion for the search -&lt;/P&gt;

&lt;P&gt;You may not need the rex.  Splunk automatically creates a number of fields from your timestamp: date_mday, date_wday, date_month, date_hour&lt;/P&gt;

&lt;P&gt;So your search could be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*" earliest_time=-30d sourcetype="WinEventLog:Application" | search Message="Faulting application name: w3wp.exe*" | 
cluster field=date_hour t=0.99 countfield=numErrors 
| sort -numErrors | table numErrors i_hours
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 04 Jan 2012 14:34:34 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2012-01-04T14:34:34Z</dc:date>
    <item>
      <title>Simple regex problem</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-regex-problem/m-p/43875#M10350</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;

&lt;P&gt;I have hit a problem with Splunk which I am hoping someone might be able to offer some help with. I've just written a search which aims to collate IIS crashes to provide an overview of number of crashes versus hour of the day so i can see if there are any regular patterns.&lt;/P&gt;

&lt;P&gt;The regex seems to work fine but i can't cluster on the fields extracted by the regex - i have previously done this successfully. Any ideas? My search is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*" earliest_time=-30d sourcetype="WinEventLog:Application" | search Message="Faulting application name: w3wp.exe*" | 
rex field=_raw "(?&amp;lt;i_month&amp;gt;\d{1,2})\/(?&amp;lt;i_date&amp;gt;\d{1,2})\/(?&amp;lt;i_year&amp;gt;\d{2,4}) (?&amp;lt;i_hours&amp;gt;\d{1,2}):(?&amp;lt;i_minutes&amp;gt;\d{1,2}):(?&amp;lt;i_seconds&amp;gt;\d{1,2}).*" | 
cluster field=i_hours t=0.99 countfield=numErrors 
| sort -numErrors | table numErrors i_hours
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Many thanks&lt;BR /&gt;
Neil&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2012 10:04:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-regex-problem/m-p/43875#M10350</guid>
      <dc:creator>neilstuartcraig</dc:creator>
      <dc:date>2012-01-04T10:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Simple regex problem</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-regex-problem/m-p/43876#M10351</link>
      <description>&lt;P&gt;I am not sure of the answer to your rex problem, but I do have a suggestion for the search -&lt;/P&gt;

&lt;P&gt;You may not need the rex.  Splunk automatically creates a number of fields from your timestamp: date_mday, date_wday, date_month, date_hour&lt;/P&gt;

&lt;P&gt;So your search could be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*" earliest_time=-30d sourcetype="WinEventLog:Application" | search Message="Faulting application name: w3wp.exe*" | 
cluster field=date_hour t=0.99 countfield=numErrors 
| sort -numErrors | table numErrors i_hours
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Jan 2012 14:34:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-regex-problem/m-p/43876#M10351</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-01-04T14:34:34Z</dc:date>
    </item>
  </channel>
</rss>

