<?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: What is the best way to quickly search for a specific error across millions of events? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285074#M86210</link>
    <description>&lt;P&gt;Thanks!  I added &lt;/P&gt;

&lt;P&gt;|dedup 1 host "Update Title"&lt;/P&gt;

&lt;P&gt;And that now looks correct.  It gives me one unique entry (most recent) for each update per host that failed rather than listing the same update for each host each time it fails.  Much appreciated!&lt;/P&gt;</description>
    <pubDate>Tue, 20 Dec 2016 13:56:00 GMT</pubDate>
    <dc:creator>SplunkLunk</dc:creator>
    <dc:date>2016-12-20T13:56:00Z</dc:date>
    <item>
      <title>What is the best way to quickly search for a specific error across millions of events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285069#M86205</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;

&lt;P&gt;I want to search my Windows boxes for a specific error in the System log.  I also want to do this search every seven days.  That means it will have to search millions of entries each time when I'm only looking for one error type.  I thought in one of the first training sessions they provided a way create an efficient search which would weed out some entries first before performing the actual search.  I hope I'm making sense.  The query I want to run is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= host=* source=WinEventLog:System  | xmlkv | search EventID=20 updateTitle!="Update for System Center Endpoint Protection*" updateTitle!="Windows Malicious Software Removal Tool*"
|rename _time as Time updateTitle AS "Update Title"
|sort -Time
|table Time, Name, "Update Title"
|convert timeformat="%a %b %d, %Y %I:%M:%S %p" ctime(Time) As Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will provide a report of failed Windows updates which my admins are asking about.  Like I mentioned, it would need to search through all System event logs and our Splunk admins have set a timeout which the query would probably hit.  Any suggestions?  Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 21:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285069#M86205</guid>
      <dc:creator>SplunkLunk</dc:creator>
      <dc:date>2016-12-19T21:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to quickly search for a specific error across millions of events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285070#M86206</link>
      <description>&lt;P&gt;I would try to do a few simple things.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Add an index pattern if you can, e.g., "index=wineventlog*"&lt;/LI&gt;
&lt;LI&gt;Add a sourcetype pattern if you can, e.g., sourcetype="XmlWinEventLog:System"&lt;/LI&gt;
&lt;LI&gt;Add the event ID to the first level of the search ("Event.System.EventID"=20), e.g., without any of the other changes it would be  &lt;CODE&gt;index= host=* source=WinEventLog:System "Event.System.EventID"=20&lt;/CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 19 Dec 2016 21:27:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285070#M86206</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2016-12-19T21:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to quickly search for a specific error across millions of events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285071#M86207</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Doing #3 helped significantly.  I was wondering what is the correct syntax to remove duplicates by host and only keep the most recent alert.  Some updates fail and then retry so I really only need to keep the latest failure.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 13:35:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285071#M86207</guid>
      <dc:creator>SplunkLunk</dc:creator>
      <dc:date>2016-12-20T13:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to quickly search for a specific error across millions of events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285072#M86208</link>
      <description>&lt;P&gt;You can use &lt;CODE&gt;dedup&lt;/CODE&gt; or &lt;CODE&gt;stats&lt;/CODE&gt; to eliminate duplicates by host. In your case, &lt;CODE&gt;dedup&lt;/CODE&gt; is probably simpler.  In your case, I am not real clear on what the field "Name" is supposed to be. If "Name" is a stand in for the host, then do the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=* source=WinEventLog:System "Event.System.EventID"=20 
 | xmlkv 
 | search updateTitle!="Update for System Center Endpoint Protection*" updateTitle!="Windows Malicious Software Removal Tool*"
 | rename _time as Time updateTitle AS "Update Title"
 | sort -Time
 | dedup 1 Name
 | table Time, Name, "Update Title"
 | convert timeformat="%a %b %d, %Y %I:%M:%S %p" ctime(Time) As Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If "Name" is not a stand-in for the host name, then  try the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=* source=WinEventLog:System "Event.System.EventID"=20 
 | xmlkv 
 | search updateTitle!="Update for System Center Endpoint Protection*" updateTitle!="Windows Malicious Software Removal Tool*"
 | rename _time as Time updateTitle AS "Update Title"
 | sort -Time
 | dedup 1 host
 | table Time, Name, "Update Title"
 | convert timeformat="%a %b %d, %Y %I:%M:%S %p" ctime(Time) As Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Dec 2016 13:42:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285072#M86208</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2016-12-20T13:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to quickly search for a specific error across millions of events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285073#M86209</link>
      <description>&lt;P&gt;If you want to try the &lt;CODE&gt;stats&lt;/CODE&gt; approach, substitute the &lt;CODE&gt;dedup&lt;/CODE&gt; command with the following depending on which field is the host name you were referring to:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats first(Time) as first("Update Title") as "Update Title" by Name&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats first(Time) as first("Update Title") as "Update Title" first(Name) as Name by host&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 13:45:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285073#M86209</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2016-12-20T13:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to quickly search for a specific error across millions of events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285074#M86210</link>
      <description>&lt;P&gt;Thanks!  I added &lt;/P&gt;

&lt;P&gt;|dedup 1 host "Update Title"&lt;/P&gt;

&lt;P&gt;And that now looks correct.  It gives me one unique entry (most recent) for each update per host that failed rather than listing the same update for each host each time it fails.  Much appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 13:56:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-quickly-search-for-a-specific-error/m-p/285074#M86210</guid>
      <dc:creator>SplunkLunk</dc:creator>
      <dc:date>2016-12-20T13:56:00Z</dc:date>
    </item>
  </channel>
</rss>

