{"id":719,"date":"2015-11-13T02:00:10","date_gmt":"2015-11-13T10:00:10","guid":{"rendered":"http:\/\/3.209.169.194\/blogs\/erin\/?p=719"},"modified":"2017-04-13T09:19:29","modified_gmt":"2017-04-13T16:19:29","slug":"filtering-events-in-trace-profiler-and-extended-events","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/","title":{"rendered":"Filtering Events in Trace\/Profiler and Extended Events"},"content":{"rendered":"<p>It seems very wrong to write a post that talks about Trace, after all I\u2019ve done to advocate that everyone start using Extended Events (XE). However, I know there are a lot of you who still use Trace because you\u2019re running SQL Server 2008R2 and earlier, so you all get a free pass. Until you upgrade. If you\u2019re running SQL Server 2012 or higher, I strongly recommend that you use XE. But that\u2019s the not the main point of this post. What I really want to do is step through filtering a .trc or .xel file to remove selected events.<\/p>\n<p><strong>Trace<\/strong><\/p>\n<p>Now, if you\u2019ve worked with Trace for a long time, you may be wondering why you would ever filter events because, let\u2019s be honest, you might not know you can do that (I didn&#8217;t for ages).\u00a0 You can! The Profiler UI isn\u2019t where you typically perform data analysis, but one reason you might filter out events is if you\u2019re using Distributed Replay and you need to remove events to avoid generating errors during the reply. To do this, open the .trc file in the Profiler UI, then select File | Properties\u2026 Within the Trace File Properties window, go to the Events Selection tab, then select Column Filters\u2026 Within the Edit Filter window, you can chose a column (or multiple columns) on which to filter your data. If I want to remove all events before a specific time, I would edit the EndTime:<\/p>\n<figure id=\"attachment_720\" aria-describedby=\"caption-attachment-720\" style=\"width: 415px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2015\/11\/trace.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-720 size-full\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2015\/11\/trace.jpg\" alt=\"EndTime filter in Trace\" width=\"415\" height=\"327\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2015\/11\/trace.jpg 415w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2015\/11\/trace-300x236.jpg 300w\" sizes=\"(max-width: 415px) 100vw, 415px\" \/><\/a><figcaption id=\"caption-attachment-720\" class=\"wp-caption-text\">EndTime filter in Trace<\/figcaption><\/figure>\n<p>This removes all events before 11:31PM on November 12, 2015. After you have removed the events, you can save the remaining data as a new .trc file through File | Save As | Trace File\u2026<\/p>\n<p><strong>Extended Events<\/strong><\/p>\n<p>Filtering events from an Extended Events file is even easier. Open the .xel file within Management Studio, then select Extended Events | Filters (you can also select the Filters icon in the Extended Events toolbar). Within the Filters window, you can choose to filter on time, and\/or any of the other fields captured for the events:<\/p>\n<figure id=\"attachment_721\" aria-describedby=\"caption-attachment-721\" style=\"width: 648px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2015\/11\/xe.jpg\"><img decoding=\"async\" class=\"wp-image-721 size-full\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2015\/11\/xe.jpg\" alt=\"Date and logical_reads filter in Extended Events\" width=\"648\" height=\"412\" \/><\/a><figcaption id=\"caption-attachment-721\" class=\"wp-caption-text\">Date and logical_reads filter in Extended Events<\/figcaption><\/figure>\n<p>Once you select Apply, all events before 11:31PM will be removed, as well as those with less than 1000 logical_reads. The remaining events can again be saved to a new file (Extended Events | Export to | XEL File\u2026), or you can just run analysis against the filtered data. You can remove the filter at any time by going back to the Filters window and selecting Clear All.<\/p>\n<p><strong>Summary<\/strong><\/p>\n<p>Hopefully this helps if you ever need to remove events from a .trc or .xel file.\u00a0 Note that I always save the filtered data as a new file &#8211; I prefer to keep the original <em>just in case<\/em> I need all the events for some reason.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It seems very wrong to write a post that talks about Trace, after all I\u2019ve done to advocate that everyone start using Extended Events (XE). However, I know there are a lot of you who still use Trace because you\u2019re running SQL Server 2008R2 and earlier, so you all get a free pass. Until you [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37,44],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Filtering Events in Trace\/Profiler and Extended Events - Erin Stellato<\/title>\n<meta name=\"description\" content=\"In this post we&#039;ll step through removing events from a trace file in the Profiler UI, and from an Extended Events file in SSMS.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Filtering Events in Trace\/Profiler and Extended Events - Erin Stellato\" \/>\n<meta property=\"og:description\" content=\"In this post we&#039;ll step through removing events from a trace file in the Profiler UI, and from an Extended Events file in SSMS.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/\" \/>\n<meta property=\"og:site_name\" content=\"Erin Stellato\" \/>\n<meta property=\"article:published_time\" content=\"2015-11-13T10:00:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T16:19:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2015\/11\/trace.jpg\" \/>\n<meta name=\"author\" content=\"Erin Stellato\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Erin Stellato\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/\",\"name\":\"Filtering Events in Trace\/Profiler and Extended Events - Erin Stellato\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#website\"},\"datePublished\":\"2015-11-13T10:00:10+00:00\",\"dateModified\":\"2017-04-13T16:19:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158\"},\"description\":\"In this post we'll step through removing events from a trace file in the Profiler UI, and from an Extended Events file in SSMS.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Filtering Events in Trace\/Profiler and Extended Events\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/\",\"name\":\"Erin Stellato\",\"description\":\"The SQL Sequel\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158\",\"name\":\"Erin Stellato\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g\",\"caption\":\"Erin Stellato\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/erin\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/author\/erin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Filtering Events in Trace\/Profiler and Extended Events - Erin Stellato","description":"In this post we'll step through removing events from a trace file in the Profiler UI, and from an Extended Events file in SSMS.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/","og_locale":"en_US","og_type":"article","og_title":"Filtering Events in Trace\/Profiler and Extended Events - Erin Stellato","og_description":"In this post we'll step through removing events from a trace file in the Profiler UI, and from an Extended Events file in SSMS.","og_url":"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/","og_site_name":"Erin Stellato","article_published_time":"2015-11-13T10:00:10+00:00","article_modified_time":"2017-04-13T16:19:29+00:00","og_image":[{"url":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2015\/11\/trace.jpg"}],"author":"Erin Stellato","twitter_misc":{"Written by":"Erin Stellato","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/","url":"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/","name":"Filtering Events in Trace\/Profiler and Extended Events - Erin Stellato","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#website"},"datePublished":"2015-11-13T10:00:10+00:00","dateModified":"2017-04-13T16:19:29+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158"},"description":"In this post we'll step through removing events from a trace file in the Profiler UI, and from an Extended Events file in SSMS.","breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/filtering-events-in-trace-profiler-and-extended-events\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/erin\/"},{"@type":"ListItem","position":2,"name":"Filtering Events in Trace\/Profiler and Extended Events"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/erin\/","name":"Erin Stellato","description":"The SQL Sequel","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/erin\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158","name":"Erin Stellato","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g","caption":"Erin Stellato"},"sameAs":["http:\/\/3.209.169.194\/blogs\/erin"],"url":"https:\/\/www.sqlskills.com\/blogs\/erin\/author\/erin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts\/719"}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/comments?post=719"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts\/719\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/media?parent=719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/categories?post=719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/tags?post=719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}