Remove double escape in provider filter strings (#431)
authorJohn Salem <josalem@microsoft.com>
Tue, 20 Aug 2019 16:47:02 +0000 (09:47 -0700)
committerGitHub <noreply@github.com>
Tue, 20 Aug 2019 16:47:02 +0000 (09:47 -0700)
* unescape filter strings since they are coming in double escaped, e.g., \\r\\n instead of \r\n

* add note to documentation about correct usage of filter string

documentation/dotnet-trace-instructions.md
src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/Provider.cs

index 31aef5014fb6773e47821bda3b1702fa3ffc7051..f43beacd5151db26bc7323f2457344a97963a44f 100644 (file)
@@ -173,7 +173,8 @@ Options:
                 4 - Informational
                 5 - Verbose
             KeyValueArgs            - A semicolon separated list of key=value
-        KeyValueArgs format: '[key1=value1][;key2=value2]'
+        KeyValueArgs format: '[key1=value1][;key2=value2]' 
+            note: values that contain ';' or '=' characters should be surrounded by double quotes ("), e.g., 'key="value;with=symbols";key2=value2'
 
   --buffersize <Size>
     Sets the size of the in-memory circular buffer in megabytes. Default 256 MB.
index 04ef7e70f72f28d0187caf208c9f00ec92e17cbf..1f8270d489e9b8615a97c52bf3fa00888277b91f 100644 (file)
@@ -4,6 +4,7 @@
 
 using System;
 using System.Diagnostics.Tracing;
+using System.Text.RegularExpressions;
 
 namespace Microsoft.Diagnostics.Tools.RuntimeClient
 {
@@ -20,7 +21,7 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient
             Name = name;
             Keywords = keywords;
             EventLevel = eventLevel;
-            FilterData = string.IsNullOrWhiteSpace(filterData) ? null : filterData;
+            FilterData = string.IsNullOrWhiteSpace(filterData) ? null : Regex.Unescape(filterData);
         }
 
         public ulong Keywords { get; }