influxdata / influxdata/influxdb-java
Newlines in tag values are not escaped
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 469
- PR merge metrics
- No merged PRs in 30d
Description
Summary
Newlines in tag values are not escaped.
I'm not exactly sure if they can be escaped (?), but currently bad values are being inserted instead.
Steps to reproduce
Try to insert a point where a tag value contains a newline, e.g:
Point.measurement("measurement")
.tag("name", "foo\nbar") // Newline here
.addField("count", 1)
.time(0, SECONDS);
Actual behaviour
A new measurement bar is created due to the following being sent
measurement,name=foo
bar count=1 0
Expected behaviour
I guess the line protocol sent should look something like this?
measurement,name=foo\
bar count=1 0
If it's not possible to escape newlines, there should be an error instead.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Java client’s line-protocol serialization for tag values and reproduce the provided measurement with a newline in the tag. Confirm whether the protocol supports escaping; done means the value is escaped without creating a second measurement, or the client rejects it with an error, with a regression test covering the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100