Skip to content

Commit 21ea5c9

Browse files
committed
Fix issue when writeing tag value ending in backslash
fixes #225 ref influxdata/influxdb#5231 ref fangli/fluent-plugin-influxdb#93
1 parent d29d7a2 commit 21ea5c9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/influxdb/point_value.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def initialize(data)
1313
def dump
1414
dump = @series.dup
1515
dump << ",#{@tags}" if @tags
16+
dump << " ".freeze if dump[-1] == "\\"
1617
dump << " #{@values}"
1718
dump << " #{@timestamp}" if @timestamp
1819
dump

spec/influxdb/point_value_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
point = {
77
series: '1= ,"\\1',
88
tags: {
9-
'2= ,"\\2' => '3= ,"\\3'
9+
'2= ,"\\2' => '3= ,"\\3',
10+
'4' => "5\\", # issue #225
1011
},
1112
values: {
1213
'4= ,"\\4' => '5= ,"\\5',
@@ -25,6 +26,7 @@
2526
series = [
2627
%(1=\\ \\,"\\1),
2728
%(2\\=\\ \\,"\\2=3\\=\\ \\,"\\3),
29+
%(4=5\\ ),
2830
]
2931
fields = [
3032
%(4\\=\\ \\,\\"\\4="5= ,\\"\\\\5"),

0 commit comments

Comments
 (0)