Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Escape multiline.pattern #162

Open
indreek opened this issue Oct 19, 2021 · 1 comment
Open

Escape multiline.pattern #162

indreek opened this issue Oct 19, 2021 · 1 comment

Comments

@indreek
Copy link

indreek commented Oct 19, 2021

How is it possible to properly escape multiline.pattern? I did not find a way how pass single quotes to filebeat config.

multiline:
  pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}'

becomes

multiline:
  pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}'

And

multiline:
  pattern: "'^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}'"

becomes

multiline:
  pattern: '''^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}'''

According to https://www.elastic.co/guide/en/beats/filebeat/current//regexp-support.html it should remain "We recommend that you wrap regular expressions in single quotation marks to work around YAML’s string escaping rules. "

@botelastic
Copy link

botelastic bot commented Jan 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

1 participant