Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write csv: line protocol malformed if there is a column named result #19453

Closed
russorat opened this issue Aug 26, 2020 · 1 comment · Fixed by #19467
Closed

write csv: line protocol malformed if there is a column named result #19453

russorat opened this issue Aug 26, 2020 · 1 comment · Fixed by #19467
Assignees
Labels

Comments

@russorat
Copy link
Contributor

#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string,string,string,string,string
#group,true,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true
#default,_result,,,,,,,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,env,host,hostname,nodename,org,result,role,url
,,0,2020-08-26T23:10:54.023607624Z,2020-08-26T23:15:54.023607624Z,2020-08-26T23:11:00Z,0,0.001,something,host,pod,node,host,,success,role,http://127.0.0.1:8099/metrics

when run with the following command:

influx write dryrun -c default -b apps --format csv -f sample.csv
something,env=host,host=pod,hostname=node,nodename=host,result=_result,result=success,role=role,url=http://127.0.0.1:8099/metrics 0.001=0 1598483460000000000

The line protocol is not valid, because the result column is in there twice. removing the result column (tag) from the data solves the issue.

@sranka
Copy link
Contributor

sranka commented Aug 31, 2020

The flux query result is wrongly encoded, the first result column is not part of the group key and should have false in the #group annotation row. The same duplication would happen with a "table" tag. This is now reported in influxdata/flux#3161, a fix is proposed in influxdata/flux#3162.

As an enhancement, the csv2lp conversion should detect duplicate tag names, warn about them and use the last one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants