Skip to content

How to add a new field which starts with hash symbol (#) in remap transform? #14191

Discussion options

You must be logged in to vote

👋

The docs note that characters that are not "alpha-numeric characters and _" should be quoted.

$ ."#foo" = "bar"
"bar"

$ .
{ "#foo": "bar" }

So your example should be rewritten as:

  docker_generic_logs_transform:
    type: remap
    inputs:
      - docker_db_logs_label
    source: |-
      ""
      log("start")
      ."#type" = "docker_generic"
      ."#environment" = "staging"
      log("end")
      ""

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@podshivalovdv
Comment options

Answer selected by jszwedko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants