Closed tom-englert closed 1 year ago
@tom-englert can you elaborate bit more. This part was added "recently" do you mean adding a string as ExtendedTags which contains any special characters including double quotes are causing issues ?
then could we use StripSpecialCharacter like https://github.com/pada57/serilog-sinks-influxdb/blob/main/Serilog.Sinks.InfluxDB/Sinks/InfluxDB/InfluxDBSink.cs#L162
to avoid changing the original content of the tag ?
No, special characters don't seem to be the problem, just the quotes (see the screenshot in the issue description)
The quotes aren't part of the original string, they are added by the property serializer when calling Property.ToString()
https://github.com/pada57/serilog-sinks-influxdb/blob/f2e8ba82ddb0c91f8aab0df77df5d77ac3b9a675/Serilog.Sinks.InfluxDB/Sinks/InfluxDB/PointExtensions.cs#L14
So removing the quotes just restores the original string.
See also the original test. Input is "Stored Value"
, but output was "\"Stored Value\""
https://github.com/pada57/serilog-sinks-influxdb/blob/f2e8ba82ddb0c91f8aab0df77df5d77ac3b9a675/Tests/Serilog.Sinks.InfluxDB.Tests/PointExtensionsTest.cs#L55
https://github.com/pada57/serilog-sinks-influxdb/blob/f2e8ba82ddb0c91f8aab0df77df5d77ac3b9a675/Tests/Serilog.Sinks.InfluxDB.Tests/PointExtensionsTest.cs#L73
Superseded by #22
Fix #18: Using extended tags corrupts database