Skip to content

Escaping issue with tag values #718

Description

@oliverrahner

This issue occurs in our case because a user has entered specific meta data fields as just \.
According to the Influx docs, \ does not need to be escaped, but may be.
In our case, however, the backslash is followed with a comma, because it is at the end of the tag value, followed by another tag value, leading to messed up interpretation of the whole record.

In my opinion, the safest way to handle this is to always escape backslashes.

Steps to reproduce:
List the minimal actions needed to reproduce the behavior.

  1. Create as List<> with at least one tag containing just a backslash \
  2. Write this list to InfluxDB using
    client.getWriteApiBlocking().writeMeasurements(WriteParameters.DEFAULT_WRITE_PRECISION, myList);

Expected behavior:
Data would be inserted correctly.

Actual behavior:
Influx returns:
HTTP status code: 400; Message: unable to parse 'metrics,account.companyName=\,account.contactCity=\ [...]

Specifications:

  • Client Version: 6.7.0
  • InfluxDB Version: 3.7
  • JDK Version: 17
  • Platform: Linux/Docker/openjdk:17-alpine

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions