<?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: regex to avoid the 2016-MM-DD events in a splunk search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262640#M78840</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | regex _raw!="\d{4}-\d\d-\d\d"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 31 Aug 2016 14:18:37 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-08-31T14:18:37Z</dc:date>
    <item>
      <title>regex to avoid the 2016-MM-DD events in a splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262637#M78837</link>
      <description>&lt;P&gt;The following were some of the events &lt;/P&gt;

&lt;P&gt;html tags 2016-04-21 09:42:38,574 DEBUG  lksjfd laskdfj lskfj alsdkfj&lt;/P&gt;

&lt;P&gt;htmltags2016-05-31T13:50:41.883450Z jhgsd kkjahdf klasjh&lt;/P&gt;

&lt;P&gt;htmltags2016-06-11T13:50:41.883450Z kdf ouier lsijcf lkhefr&lt;/P&gt;

&lt;P&gt;[ 2016-04-21 09:42:38,574]&lt;/P&gt;

&lt;P&gt;abc.def.net 2016-05-31T13&lt;/P&gt;

&lt;P&gt;Now, I am trying to write a query which can display the events which shouldn't contain 2016-MM-DD format which is YYYY-MM-DD format&lt;/P&gt;

&lt;P&gt;For example it shouldn't display any one of the above mentioned events since they all contains the YYYY-MM-DD format&lt;/P&gt;

&lt;P&gt;Note :-&lt;BR /&gt;
YY- YEAR&lt;BR /&gt;
MM-MONTH&lt;BR /&gt;
DD-DATE&lt;/P&gt;

&lt;P&gt;Any ideas &lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:04:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262637#M78837</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2016-08-31T14:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: regex to avoid the 2016-MM-DD events in a splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262638#M78838</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;your search | regex _raw!="\d{4}-\d{2}-\d{2}"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will "retain" all YYYY-MM-DD format events and results will be all events other than YYYY-MM-DD format events.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:13:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262638#M78838</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-08-31T14:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: regex to avoid the 2016-MM-DD events in a splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262639#M78839</link>
      <description>&lt;P&gt;Give this a try&lt;BR /&gt;
&lt;STRONG&gt;Updated to show host/source&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | regex _raw!=".*2016-\d{2}-\d{2}.*" | stats count by host, source 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search "*2016-*" | stats count by host, source 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:14:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262639#M78839</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-31T14:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: regex to avoid the 2016-MM-DD events in a splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262640#M78840</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | regex _raw!="\d{4}-\d\d-\d\d"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:18:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262640#M78840</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-31T14:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: regex to avoid the 2016-MM-DD events in a splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262641#M78841</link>
      <description>&lt;P&gt;and how to list out the hosts and sources that satisfies my search?&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:20:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262641#M78841</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2016-08-31T14:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: regex to avoid the 2016-MM-DD events in a splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262642#M78842</link>
      <description>&lt;P&gt;to list out the hosts and sources that satisfies my search - &lt;/P&gt;

&lt;P&gt;your search | regex _raw!="\d{4}-\d{2}-\d{2}" | table host source&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:21:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262642#M78842</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-08-31T14:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: regex to avoid the 2016-MM-DD events in a splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262643#M78843</link>
      <description>&lt;P&gt;Hi Pavanae.   I agree with the other answers here, although it's not been made clear whether or not the specific format of your timestamp needs to be part of the exclusion - i.e. should the exclusion encapsulate both YYYY-MM-DD and YYYY-DD-MM?&lt;/P&gt;

&lt;P&gt;Also as a general rule - and if possible - it's better to know what you're looking for - rather than what you're not.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:41:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262643#M78843</guid>
      <dc:creator>tin_fish</dc:creator>
      <dc:date>2016-08-31T14:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: regex to avoid the 2016-MM-DD events in a splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262644#M78844</link>
      <description>&lt;P&gt;what if we want to display only the windows events. is there any unique search stanza to display only the windows hosts and filtr out the other os's?&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:44:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262644#M78844</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2016-08-31T14:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: regex to avoid the 2016-MM-DD events in a splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262645#M78845</link>
      <description>&lt;P&gt;Since both the timestamp and OS info for the hosts are written in totally different logs, you can't achieve this using same base search. My suggestion would be to create a lookup table with all host and their corresponding OS and use that lookup to filter out hosts from above query. &lt;/P&gt;

&lt;P&gt;Query to generate lookup&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*metrics.log os=* earliest=-1h@h  | stats latest(os) as os by host | outputlookup host_os.csv 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Use lookup to exclude hosts&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search [| inputlookup host_os.csv | where os="Windows" | table host ] | regex _raw!=".*2016-\d{2}-\d{2}.*" | stats count by host, source
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:57:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262645#M78845</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-31T14:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: regex to avoid the 2016-MM-DD events in a splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262646#M78846</link>
      <description>&lt;P&gt;So without using the lookup's can I below the below search result was accurate?&lt;/P&gt;

&lt;P&gt;index=* [ search index=_internal os=Windows sourcetype=splunkd | stats count by hostname | rename hostname as host | fields host ] | regex _raw!=".&lt;EM&gt;2016-\d{2}-\d{2}.&lt;/EM&gt;" | regex _raw!=".&lt;EM&gt;2016/\d{2}/\d{2}.&lt;/EM&gt;" | stats values(source) as sources values(sourcetype) as sourcetypes by host&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 19:07:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262646#M78846</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2016-08-31T19:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: regex to avoid the 2016-MM-DD events in a splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262647#M78847</link>
      <description>&lt;P&gt;Yes it will be. Lookups will be good for performance as you don't have to go through internal logs every time.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 21:21:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-avoid-the-2016-MM-DD-events-in-a-splunk-search/m-p/262647#M78847</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-31T21:21:06Z</dc:date>
    </item>
  </channel>
</rss>

