{"id":1109,"date":"2020-03-25T04:14:23","date_gmt":"2020-03-25T11:14:23","guid":{"rendered":"http:\/\/3.209.169.194\/blogs\/erin\/?p=1109"},"modified":"2020-03-25T04:15:21","modified_gmt":"2020-03-25T11:15:21","slug":"using-relog-creating-a-smaller-file","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/erin\/using-relog-creating-a-smaller-file\/","title":{"rendered":"Using relog: Creating a smaller file"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>Today I had to remember the steps for using relog. If you&#8217;ve never heard of relog, stay with me. It&#8217;s a tool for merging PerfMon files, and also for extracting smaller data sets from Perfmon. I still love PerfMon friends, I admit it. It&#8217;s been a staple for understanding performance on a Windows Server since I&#8217;ve started in IT. But I haven&#8217;t used relog in forever so I completely forgot the commands I needed.<\/p>\n<h2>The problem<\/h2>\n<p>I provided a PerfMon template to a customer a few weeks ago and asked them to start capturing data.\u00a0 I requested that they roll over the file daily, but that request got lost in the shuffle.\u00a0 They manually stopped and restarted the data collector intermittently, so when they sent me the file to review data from an issue they had over the weekend, it was almost 5GB in size.\u00a0 Oof.\u00a0 I loathe opening large PerfMon files in the UI because it takes a long to load.\u00a0 This is where using relog came in because I only needed to look at about an hour&#8217;s worth of data.<\/p>\n<h2>Finding the command I needed<\/h2>\n<p>I did a quick Google search looking for the syntax, and landed on a post from my friend <a href=\"https:\/\/twitter.com\/DBA_ANDY\">Andy Galbraith<\/a>, <a href=\"https:\/\/www.sqlservercentral.com\/blogs\/handling-perfmon-logs-with-relog\">Handling Perfmon Logs with Relog<\/a>.\u00a0 It&#8217;s a useful post if you want to merge multiple files, and I recommend it if you need that.\u00a0 I needed to separate out my data.<\/p>\n<p>My very first SQL Server presentation was on the topic of baselines, and I used to demo relog.\u00a0 I had to have the code somewhere right?\u00a0 Nope.\u00a0 I did find my old presentation and wow&#8230;that needs updating.\u00a0 Then I searched my old blog and found <a href=\"http:\/\/erinstellato.com\/2012\/03\/failed-perfom-data-correlation\/\">a post<\/a> where I had the syntax.\u00a0 Yay past me!<\/p>\n<p>However, no one else would ever find that post so I thought I&#8217;d share the syntax here.\u00a0 Also, if you go to the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows-server\/administration\/windows-commands\/relog\">official relog documentation<\/a> the syntax is there, but it&#8217;s not <em>quite <\/em>correct.<\/p>\n<h2>Using relog to extract data based on a date range<\/h2>\n<p>The parameters are -b for begin time and -e for end time.\u00a0 And for both parameters the documentation states:<\/p>\n<figure id=\"attachment_1110\" aria-describedby=\"caption-attachment-1110\" style=\"width: 567px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relog.jpg\"><img decoding=\"async\" class=\"size-full wp-image-1110\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relog.jpg\" alt=\"Date syntax for -b and -e\" width=\"567\" height=\"81\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relog.jpg 567w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relog-300x43.jpg 300w\" sizes=\"(max-width: 567px) 100vw, 567px\" \/><\/a><figcaption id=\"caption-attachment-1110\" class=\"wp-caption-text\">Date syntax for -b and -e<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Do you see a space between the year and the hour?\u00a0 Me neither.\u00a0 This syntax fails:<\/p>\n<p style=\"padding-left: 40px;\">relog SQLskills_DataCollector.blg -b 3\/21\/202019:00:00 -e 3\/21\/202020:00:00 -o SQLskills_March21.blg<\/p>\n<figure id=\"attachment_1111\" aria-describedby=\"caption-attachment-1111\" style=\"width: 1024px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relogerror.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-large wp-image-1111\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relogerror-1024x247.jpg\" alt=\"relog error with no space between date and time\" width=\"1024\" height=\"247\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relogerror-1024x247.jpg 1024w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relogerror-300x72.jpg 300w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relogerror-768x185.jpg 768w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relogerror.jpg 1317w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-1111\" class=\"wp-caption-text\">relog error with no space between date and time<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>But if I add a space between the date and the time:<\/p>\n<p style=\"padding-left: 40px;\">relog SQLskills_DataCollector.blg -b 3\/21\/2020 19:00:00 -e 3\/21\/2020 20:00:00 -o SQLskills_March21.blg<\/p>\n<p>It works:<\/p>\n<figure id=\"attachment_1112\" aria-describedby=\"caption-attachment-1112\" style=\"width: 1024px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relogworks.jpg\"><img decoding=\"async\" class=\"size-large wp-image-1112\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relogworks-1024x423.jpg\" alt=\"correct relog command\" width=\"1024\" height=\"423\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relogworks-1024x423.jpg 1024w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relogworks-300x124.jpg 300w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relogworks-768x317.jpg 768w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relogworks.jpg 1341w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-1112\" class=\"wp-caption-text\">correct relog command<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>And with that, I&#8217;m off to analyze some data!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Today I had to remember the steps for using relog. If you&#8217;ve never heard of relog, stay with me. It&#8217;s a tool for merging PerfMon files, and also for extracting smaller data sets from Perfmon. I still love PerfMon friends, I admit it. It&#8217;s been a staple for understanding performance on a Windows Server [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,15],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using relog: Creating a smaller file - Erin Stellato<\/title>\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\/using-relog-creating-a-smaller-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using relog: Creating a smaller file - Erin Stellato\" \/>\n<meta property=\"og:description\" content=\"&nbsp; Today I had to remember the steps for using relog. If you&#8217;ve never heard of relog, stay with me. It&#8217;s a tool for merging PerfMon files, and also for extracting smaller data sets from Perfmon. I still love PerfMon friends, I admit it. It&#8217;s been a staple for understanding performance on a Windows Server [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/erin\/using-relog-creating-a-smaller-file\/\" \/>\n<meta property=\"og:site_name\" content=\"Erin Stellato\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-25T11:14:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-03-25T11:15:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relog.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\/using-relog-creating-a-smaller-file\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/using-relog-creating-a-smaller-file\/\",\"name\":\"Using relog: Creating a smaller file - Erin Stellato\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#website\"},\"datePublished\":\"2020-03-25T11:14:23+00:00\",\"dateModified\":\"2020-03-25T11:15:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/using-relog-creating-a-smaller-file\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/erin\/using-relog-creating-a-smaller-file\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/using-relog-creating-a-smaller-file\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using relog: Creating a smaller file\"}]},{\"@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":"Using relog: Creating a smaller file - Erin Stellato","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\/using-relog-creating-a-smaller-file\/","og_locale":"en_US","og_type":"article","og_title":"Using relog: Creating a smaller file - Erin Stellato","og_description":"&nbsp; Today I had to remember the steps for using relog. If you&#8217;ve never heard of relog, stay with me. It&#8217;s a tool for merging PerfMon files, and also for extracting smaller data sets from Perfmon. I still love PerfMon friends, I admit it. It&#8217;s been a staple for understanding performance on a Windows Server [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/erin\/using-relog-creating-a-smaller-file\/","og_site_name":"Erin Stellato","article_published_time":"2020-03-25T11:14:23+00:00","article_modified_time":"2020-03-25T11:15:21+00:00","og_image":[{"url":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2020\/03\/relog.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\/using-relog-creating-a-smaller-file\/","url":"https:\/\/www.sqlskills.com\/blogs\/erin\/using-relog-creating-a-smaller-file\/","name":"Using relog: Creating a smaller file - Erin Stellato","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#website"},"datePublished":"2020-03-25T11:14:23+00:00","dateModified":"2020-03-25T11:15:21+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/using-relog-creating-a-smaller-file\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/erin\/using-relog-creating-a-smaller-file\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/using-relog-creating-a-smaller-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/erin\/"},{"@type":"ListItem","position":2,"name":"Using relog: Creating a smaller file"}]},{"@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\/1109"}],"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=1109"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts\/1109\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/media?parent=1109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/categories?post=1109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/tags?post=1109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}