{"id":68,"date":"2016-02-20T15:26:09","date_gmt":"2016-02-20T15:26:09","guid":{"rendered":"http:\/\/eventlogxp.com\/blog\/?p=68"},"modified":"2016-03-10T06:23:12","modified_gmt":"2016-03-10T06:23:12","slug":"advanced-filtering-how-to-filter-events-by-event-descriptions","status":"publish","type":"post","link":"https:\/\/eventlogxp.com\/blog\/advanced-filtering-how-to-filter-events-by-event-descriptions\/","title":{"rendered":"Advanced filtering. How to filter events by event description"},"content":{"rendered":"<p>A key instrument for event logs analysis is the function of event filtering. All known event log analysis tools have filtering feature, and I suppose, it is the most demanded feature of these applications. Setting filter for the most of event fields is easy. As a rule, all the event log applications let you filter by timeframe, event level, source, event IDs, users or computers with a more or less friendly user interface.<\/p>\n<p>However, sometimes you may need to filter events by extra details, which you can see in the event description. Let&#8217;s take the task of\u00a0 displaying logon events from RDP users. <a href=\"http:\/\/eventlogxp.com\/blog\/exploring-who-logged-on-the-system\/\">Previously <\/a>I described how to display all the logon events, but now we need to make a more complex filter.<\/p>\n<p>We know that logon events are 4624 and 4625 (successful logon and unsuccessful logon attempt). In this <a href=\"http:\/\/eventlogxp.com\/blog\/logon-type-what-does-it-mean\/\">post<\/a>, I showed how to interpret logon types and you can see that Logon type for RDP access is 10. So we need to filter by event ID= 4624 or 4625 and Logon type = 10. And this filter should be applied to Security log.<\/p>\n<p>Although Windows Event Viewer does not provide user interface to filter events by extra event details, you can query event log by using structured XML queries. This feature is available since Windows 2008\/Vista. Structured XML query is a special language based on XPath 1.0 syntax intended to retrieve events from event logs. \u00a0You can find information about the structured XML queries and XPath expressions at <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/dd996910(v=vs.85).aspx\" target=\"_blank\">https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/dd996910(v=vs.85).aspx<\/a><\/p>\n<p>Here is a XML filter query for our task:<\/p>\n<blockquote><p>&lt;QueryList&gt;<br \/>\n&lt;Query Id=&#8221;0&#8243; Path=&#8221;Security&#8221;&gt;<br \/>\n&lt;Select Path=&#8221;Security&#8221;&gt;<br \/>\n*[System[(EventID=4624 or EventID=4625)]]<br \/>\nand<br \/>\n*[EventData[Data[@Name=&#8217;LogonType&#8217;] and Data=10]]<br \/>\n&lt;\/Select&gt;<br \/>\n&lt;\/Query&gt;<br \/>\n&lt;\/QueryList&gt;<\/p><\/blockquote>\n<p>Using the power of XML query, you may filter events by virtually any criteria. Our Event Log Explorer &#8220;understands&#8221; the structured XML queries as well as built-in Event Viewer. But unlike Event Viewer, you don&#8217;t need to use full XML queries. Event Log Explorer accepts short XPath expressions like:<\/p>\n<blockquote><p>*[System[(EventID=4624 or EventID=4625)]] \u00a0and<br \/>\n*[EventData[Data[@Name=&#8217;LogonType&#8217;] and Data=10]]<\/p><\/blockquote>\n<p>However, despite the advantages of XML filtering, it is not easy to use it, especially if you don\u2019t used to write XML queries on a regular basis.<\/p>\n<p>So now, I will show how we simplified this process with our software.<\/p>\n<p>Select View-&gt;Filter from the Event Log Explorer main menu to display Filter dialog.<\/p>\n<p>First of all, you should type <strong><em>4624,4625<\/em><\/strong> into Event ID(s) filed because we need only logon events.<\/p>\n<p>Event Log Explorer provides two basic ways of filtering events by description.<\/p>\n<h4>Filtering events by description text<\/h4>\n<p>You can just type any text in &#8220;Text in description&#8221; field and Event Log Explorer will display all events that contain this text in the description. You may just try to type<\/p>\n<blockquote><p><strong><em>Logon Type: \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a010<\/em><\/strong><\/p><\/blockquote>\n<p>And this MAY really work. However, it is not reliable at all. You should not rely on the number of tabs inside description, moreover you cannot just type the tabulation symbols in the input line (I pasted it from the event description, and you should not copy it from this article &#8211; it won&#8217;t work &#8211; there\u00a0are three tabulation symbols between &#8220;:&#8221; and &#8220;10&#8221;). Thereby, I suggest using this simple way, only for simple filters, e.g. when you need to display events containing a specific file name in the description.<\/p>\n<p>The same &#8220;Text in description&#8221; filed has an extra feature when you enable RegExp checkbox near it. In this case, you can filter events with the power of regular expressions. When RegExp checkbox enabled, Event Log Explorer will search all event descriptions for occurrence of the regular expressions you typed in &#8220;Text in description&#8221; filed. Our expression should look like<\/p>\n<blockquote><p><strong><em>Logon Type:\\s*10<\/em><\/strong><\/p><\/blockquote>\n<p>or<\/p>\n<blockquote><p><strong><em>Logon Type:[ \\t]*10<\/em><\/strong><\/p><\/blockquote>\n<p>You probably think that this way is not much better than using structured XML queries. Instead of learning XPath syntax, I recommend you to learn regular expressions?<\/p>\n<p>Although I don\u2019t see alternatives to regular expression filters for some specific log analysis tasks, Event Log Explorer lets you fulfill this very task (displaying RDP logon events) much easier.<\/p>\n<h4>Filtering events by description parameters<\/h4>\n<p>Event Log Explorer gives you a user friendly ability to filter Security log by description parameters. In fact, you just tell the program the following:<\/p>\n<p><em>Logon type\u00a0\u00a0 equals\u00a0\u00a0 10<\/em><\/p>\n<p>To make entering the filter condition easy, I recommend select an even in the event list that contains Logon type in the description (you should do this before opening Filter dialog).<\/p>\n<p>Use <em>Filter by description params<\/em> group to create your filter conditions:<\/p>\n<p><a href=\"http:\/\/eventlogxp.com\/blog\/wp-content\/uploads\/2016\/02\/event_filter_descr_params.png\" rel=\"attachment wp-att-71\" data-rel=\"lightbox-gallery-PKVcFL5m\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" class=\"size-medium wp-image-71\" src=\"http:\/\/eventlogxp.com\/blog\/wp-content\/uploads\/2016\/02\/event_filter_descr_params-300x142.png\" alt=\"event filter by description parameters\" width=\"300\" height=\"142\" srcset=\"https:\/\/eventlogxp.com\/blog\/wp-content\/uploads\/2016\/02\/event_filter_descr_params-300x142.png 300w, https:\/\/eventlogxp.com\/blog\/wp-content\/uploads\/2016\/02\/event_filter_descr_params-660x312.png 660w, https:\/\/eventlogxp.com\/blog\/wp-content\/uploads\/2016\/02\/event_filter_descr_params.png 694w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>I believe that this way significantly saves your time for security log analysis.<\/p>\n<p>Note that this approach works only when you analyze Security event logs because the security log descriptions are well-structured. When you analyze other logs, you may need to use regular expressions or XPath filter queries.<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Feventlogxp.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F68&#038;t=Advanced%20filtering.%20How%20to%20filter%20events%20by%20event%20description&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Feventlogxp.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F68&#038;p&#091;images&#093;&#091;0&#093;=https%3A%2F%2Feventlogxp.com%2Fblog%2Fwp-content%2Fuploads%2F2016%2F02%2Fadvanced_filter.jpg&#038;p&#091;title&#093;=Advanced%20filtering.%20How%20to%20filter%20events%20by%20event%20description\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none\" src=\"https:\/\/eventlogxp.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Feventlogxp.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F68&#038;text=Check%20this%20Event%20Log%20Explorer%20blog%20post\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none\" src=\"https:\/\/eventlogxp.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-reddit nolightbox\" data-provider=\"reddit\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Reddit\" href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Feventlogxp.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F68&#038;title=Advanced%20filtering.%20How%20to%20filter%20events%20by%20event%20description\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img alt=\"reddit\" title=\"Share on Reddit\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none\" src=\"https:\/\/eventlogxp.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/reddit.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-pinterest nolightbox\" data-provider=\"pinterest\" target=\"_blank\" rel=\"nofollow\" title=\"Pin it with Pinterest\" href=\"https:\/\/pinterest.com\/pin\/create\/button\/?url=https%3A%2F%2Feventlogxp.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F68&#038;media=https%3A%2F%2Feventlogxp.com%2Fblog%2Fwp-content%2Fuploads%2F2016%2F02%2Fadvanced_filter.jpg&#038;description=Advanced%20filtering.%20How%20to%20filter%20events%20by%20event%20description\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img alt=\"pinterest\" title=\"Pin it with Pinterest\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none\" src=\"https:\/\/eventlogxp.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/pinterest.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Feventlogxp.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F68&#038;title=Advanced%20filtering.%20How%20to%20filter%20events%20by%20event%20description\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none\" src=\"https:\/\/eventlogxp.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=Advanced%20filtering.%20How%20to%20filter%20events%20by%20event%20description&#038;body=Check%20this%20Event%20Log%20Explorer%20blog%20post:%20https%3A%2F%2Feventlogxp.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F68\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none\" src=\"https:\/\/eventlogxp.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>A key instrument for event logs analysis is the function of event filtering. All known event log analysis tools have filtering feature, and I suppose, it is the most demanded feature of these applications. Setting filter for the most of event fields is easy. As a rule, all the event log applications let you filter by timeframe, event level, source, event IDs, users or computers\u2026 <span class=\"read-more\"><a href=\"https:\/\/eventlogxp.com\/blog\/advanced-filtering-how-to-filter-events-by-event-descriptions\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":74,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10,40,42,2],"tags":[19,34,21,33,49,4,18,35],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/eventlogxp.com\/blog\/wp-json\/wp\/v2\/posts\/68"}],"collection":[{"href":"https:\/\/eventlogxp.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eventlogxp.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eventlogxp.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/eventlogxp.com\/blog\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":11,"href":"https:\/\/eventlogxp.com\/blog\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":99,"href":"https:\/\/eventlogxp.com\/blog\/wp-json\/wp\/v2\/posts\/68\/revisions\/99"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eventlogxp.com\/blog\/wp-json\/wp\/v2\/media\/74"}],"wp:attachment":[{"href":"https:\/\/eventlogxp.com\/blog\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eventlogxp.com\/blog\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eventlogxp.com\/blog\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}