From 0e07f0828baf8a1c435aca6713a7131d1382a9ef Mon Sep 17 00:00:00 2001 From: Pixel Frame Date: Wed, 26 Mar 2025 16:32:23 +0800 Subject: [PATCH] Upgrade SDK version & enable column variant --- src/DnsAnalyticSource.cs | 2 +- src/DnsAnalyticTable.cs | 56 ++++++++++++++++++------------ src/DnsAnalyticView.csproj | 4 +-- src/Properties/launchSettings.json | 6 ++++ src/pluginManifest.json | 2 +- 5 files changed, 43 insertions(+), 27 deletions(-) diff --git a/src/DnsAnalyticSource.cs b/src/DnsAnalyticSource.cs index 802d1ef..13a8e46 100644 --- a/src/DnsAnalyticSource.cs +++ b/src/DnsAnalyticSource.cs @@ -20,7 +20,7 @@ public override ProcessingSourceInfo GetAboutInfo() { return new ProcessingSourceInfo { - CopyrightNotice = "Copyright 2024 KzA. All Rights Reserved.", + CopyrightNotice = "Copyright 2024-2025 KzA. All Rights Reserved.", LicenseInfo = new LicenseInfo { Name = "MIT", diff --git a/src/DnsAnalyticTable.cs b/src/DnsAnalyticTable.cs index 874e4dc..bf53f36 100644 --- a/src/DnsAnalyticTable.cs +++ b/src/DnsAnalyticTable.cs @@ -17,12 +17,13 @@ public sealed class DnsAnalyticTable requiredDataCookers: new List { DnsAnalyticEventCooker.CookerPath }); #region Columns + /* private static readonly ColumnConfiguration QNAMERColumn = new ColumnConfiguration( new ColumnMetadata(new Guid("{727FABA0-39F1-4A27-9BB6-D7622FA08267}"), "QNAME (RAW)", "Raw Query Name"), new UIHints { Width = 120, IsVisible = false }); - - private static readonly ColumnConfiguration QNAMENColumn = new ColumnConfiguration( - new ColumnMetadata(new Guid("{727FACA0-39F1-4A27-9BB6-D7622FA08267}"), "QNAME (Normalized)", "Normalized Query Name"), + */ + private static readonly ColumnConfiguration QNAMEColumn = new ColumnConfiguration( + new ColumnMetadata(new Guid("{727FABA0-39F1-4A27-9BB6-D7622FA08267}"), "QNAME", "Query Name"), new UIHints { Width = 120 }); private static readonly ColumnConfiguration QTYPEColumn = new ColumnConfiguration( @@ -56,11 +57,11 @@ public sealed class DnsAnalyticTable private static readonly ColumnConfiguration FlagsColumn = new ColumnConfiguration( new ColumnMetadata(new Guid("{727FABA8-39F1-4A27-9BB6-D7622FA08267}"), "Flags", "DNS Flags"), new UIHints { Width = 40 }); - + /* private static readonly ColumnConfiguration FlagsAltColumn = new ColumnConfiguration( new ColumnMetadata(new Guid("{727FACA8-39F1-4A27-9BB6-D7622FA08267}"), "Flags (Interpreted)", "Interpreted DNS Flags"), new UIHints { Width = 100, IsVisible = false }); - + */ private static readonly ColumnConfiguration DNSSECColumn = new ColumnConfiguration( new ColumnMetadata(new Guid("{727FABA9-39F1-4A27-9BB6-D7622FA08267}"), "DNSSEC", "Is DNSSEC"), new UIHints { Width = 40 }); @@ -233,8 +234,8 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva CorrelationIDColumn, TableConfiguration.PivotColumn, OperationColumn, - QNAMERColumn, - QNAMENColumn, + //QNAMERColumn, + QNAMEColumn, QTYPEColumn, XIDColumn, QXIDColumn, @@ -247,7 +248,7 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva TCPColumn, RCODEColumn, FlagsColumn, - FlagsAltColumn, + //FlagsAltColumn, DNSSECColumn, SecureColumn, ZoneColumn, @@ -266,9 +267,9 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva { Columns = new[] { - QNAMENColumn, + QNAMEColumn, TableConfiguration.PivotColumn, - QNAMERColumn, + //QNAMERColumn, CorrelationIDColumn, OperationColumn, QTYPEColumn, @@ -283,7 +284,7 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva TCPColumn, RCODEColumn, FlagsColumn, - FlagsAltColumn, + //FlagsAltColumn, DNSSECColumn, SecureColumn, ZoneColumn, @@ -304,8 +305,8 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva { RemoteAddrColumn, TableConfiguration.PivotColumn, - QNAMERColumn, - QNAMENColumn, + //QNAMERColumn, + QNAMEColumn, CorrelationIDColumn, OperationColumn, QTYPEColumn, @@ -320,7 +321,7 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva TCPColumn, RCODEColumn, FlagsColumn, - FlagsAltColumn, + //FlagsAltColumn, DNSSECColumn, SecureColumn, ZoneColumn, @@ -354,8 +355,15 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva }) .AddColumn(CorrelationIDColumn, correlationIdProjection) .AddColumn(OperationColumn, operationProjection) - .AddColumn(QNAMERColumn, qnamerProjection) - .AddColumn(QNAMENColumn, qnamenProjection) + .AddColumnWithVariants(QNAMEColumn, qnamenProjection, builder => + { + return builder.WithModes(new() { Label = "Normalized" }) + .WithMode( + new(Guid.NewGuid(), new() { Label = "Raw" }), + qnamerProjection); + }) + //.AddColumn(QNAMERColumn, qnamerProjection) + //.AddColumn(QNAMEColumn, qnamenProjection) .AddColumn(QTYPEColumn, qtypeProjection) .AddColumn(XIDColumn, xidProjection) .AddColumn(QXIDColumn, qxidProjection) @@ -370,14 +378,16 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva .AddColumn(RCODEColumn, rcodeProjection) .AddColumn(ReasonColumn, reasonProjection) .AddColumn(EDNSUdpPayloadSizeColumn, ednsUdpPayloadSizeProjection) - .AddColumn(FlagsColumn, flagsProjection) - .AddColumn(FlagsAltColumn, flagsAltProjection) + //.AddColumn(FlagsColumn, flagsProjection) + //.AddColumn(FlagsAltColumn, flagsAltProjection) // Column variants not available yet - //.AddColumnWithVariants(FlagsColumn, flagsProjection, builder => - //{ - // return builder.WithModes("HEX") - // .WithMode(FlagsAltColumn, "Interpreted", flagsAltProjection); - //}) + .AddColumnWithVariants(FlagsColumn, flagsProjection, builder => + { + return builder.WithModes(new() { Label = "HEX" }) + .WithMode( + new(Guid.NewGuid(), new() { Label = "Interpreted" }), + flagsAltProjection); + }) .AddColumn(RDColumn, rdProjection) .AddColumn(AAColumn, aaProjection) .AddColumn(ADColumn, adProjection) diff --git a/src/DnsAnalyticView.csproj b/src/DnsAnalyticView.csproj index 5d059cc..d42dee3 100644 --- a/src/DnsAnalyticView.csproj +++ b/src/DnsAnalyticView.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/src/Properties/launchSettings.json b/src/Properties/launchSettings.json index ad4f54f..5daa00f 100644 --- a/src/Properties/launchSettings.json +++ b/src/Properties/launchSettings.json @@ -8,6 +8,12 @@ "executablePath": "C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\wpa.exe", "commandLineArgs": "-nodefault -addsearchdir $(ProjectDir)bin\\$(Platform)\\$(Configuration)", "nativeDebugging": false + }, + "WPA (Store)": { + "commandName": "Executable", + "executablePath": "C:\\Program Files\\WindowsApps\\Microsoft.WindowsPerformanceAnalyzerPreview_11.8.278.0_x64__8wekyb3d8bbwe\\wpa.exe", + "commandLineArgs": "-nodefault -addsearchdir $(ProjectDir)bin\\$(Platform)\\$(Configuration)", + "nativeDebugging": false } } } \ No newline at end of file diff --git a/src/pluginManifest.json b/src/pluginManifest.json index e617bcd..bae5df1 100644 --- a/src/pluginManifest.json +++ b/src/pluginManifest.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/microsoft/microsoft-performance-toolkit-sdk/main/src/PluginsSystem/Tools/Microsoft.Performance.Toolkit.Plugins.Cli/Manifest/PluginManifestSchema.json", "identity": { "id": "DnsAnalyticalView", - "version": "1.2.2" + "version": "1.2.3" }, "displayName": "DNS Analytical Log View", "description": "Provide a better view for Microsoft-Windows-DNSServer/Analytical events",