From cac4923b280737f01270414427935a90043ed18b Mon Sep 17 00:00:00 2001 From: Giovanni Luisotto Date: Wed, 17 Jun 2020 23:11:10 +0200 Subject: [PATCH] Remove trailing backslash management in sqlserver input (#7700) Backslash removal on tags is performed by the influx serializer now. --- plugins/inputs/sqlserver/sqlserver.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/inputs/sqlserver/sqlserver.go b/plugins/inputs/sqlserver/sqlserver.go index e897ba64a2836..720ee75089d1f 100644 --- a/plugins/inputs/sqlserver/sqlserver.go +++ b/plugins/inputs/sqlserver/sqlserver.go @@ -459,8 +459,8 @@ BEGIN DECLARE @Tables as nvarchar(max) = '' IF @MajorMinorVersion >= 1050 BEGIN - /* [volume_mount_point] TRIMS trailing "\" which are not allowed in InfluxDB */ - SET @Columns += N',LEFT(vs.[volume_mount_point], LEN(vs.[volume_mount_point])-(PATINDEX(''%[^\]%'',REVERSE([volume_mount_point]))-1)) AS [volume_mount_point]' + /*in [volume_mount_point] any trailing "\" char will be removed by telegraf */ + SET @Columns += N',[volume_mount_point]' SET @Tables += N'CROSS APPLY sys.dm_os_volume_stats(vfs.[database_id], vfs.[file_id]) AS vs' END @@ -1640,8 +1640,8 @@ IF @EngineEdition IN (2,3,4) AND @MajorMinorVersion >= 1050 'sqlserver_volume_space' AS [measurement] ,SERVERPROPERTY('machinename') AS [server_name] ,REPLACE(@@SERVERNAME,'\',':') AS [sql_instance] - /* [volume_mount_point] TRIMS trailing "\" which are not allowed in InfluxDB */ - ,LEFT(vs.[volume_mount_point], LEN(vs.[volume_mount_point])-(PATINDEX('%[^\]%',REVERSE([volume_mount_point]))-1)) AS [volume_mount_point] + /*in [volume_mount_point] any trailing "\" char will be removed by telegraf */ + ,[volume_mount_point] ,vs.[total_bytes] AS [total_space_bytes] ,vs.[available_bytes] AS [available_space_bytes] ,vs.[total_bytes] - vs.[available_bytes] AS [used_space_bytes]