Skip to content

Commit

Permalink
Remove trailing backslash management in sqlserver input (influxdata#7700
Browse files Browse the repository at this point in the history
)

Backslash removal on tags is performed by the influx serializer now.
  • Loading branch information
Trovalo authored Jun 17, 2020
1 parent 33a1dcf commit 27a16c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/inputs/sqlserver/sqlserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 27a16c8

Please sign in to comment.