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

[Filebeat] Postgres Module fails if db name contains underscore #7195

Closed
gingerwizard opened this issue May 29, 2018 · 0 comments
Closed

[Filebeat] Postgres Module fails if db name contains underscore #7195

gingerwizard opened this issue May 29, 2018 · 0 comments
Labels

Comments

@gingerwizard
Copy link

  • Version: 6.2.4
  • Operating System: linux, GCP k8
  • Steps to Reproduce:

Postgresql supports underscores in the dbname.

The db name is logged and parsed by an ingest pipeline e.g.

2018-05-29 12:01:03.172 UTC [9851] elastic@elastic_db LOG: duration: 0.092 ms statement: UPDATE pgbench_branches SET bbalance = bbalance + 1155 WHERE bid = 1;

This causes the pipeline to fail which currently doesn't allow for underscores i.e.

https://github.com/elastic/beats/blob/master/filebeat/module/postgresql/log/ingest/pipeline.json#L9-L13

which uses HOSTNAME for the dbname which doesn't support _ chars. https://github.com/elastic/elasticsearch/blob/master/libs/grok/src/main/resources/patterns/grok-patterns#L30

@ph ph added Filebeat Filebeat bug labels May 29, 2018
kvch added a commit to kvch/beats that referenced this issue May 30, 2018
ruflin pushed a commit that referenced this issue May 30, 2018
Support `_` and `$` in PostgreSQL database names as all of those are valid characters in a name.

Reference:
> SQL identifiers and key words must begin with a letter (a-z, but also letters with diacritical marks and non-Latin letters) or an underscore (_). Subsequent characters in an identifier or key word can be letters, underscores, digits (0-9), or dollar signs ($). Note that dollar signs are not allowed in identifiers according to the letter of the SQL standard, so their use might render applications less portable. 

(Source: https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS)

Closes #7195
ruflin pushed a commit that referenced this issue Jun 15, 2018
Support `_` and `$` in PostgreSQL database names as all of those are valid characters in a name.

Reference:
> SQL identifiers and key words must begin with a letter (a-z, but also letters with diacritical marks and non-Latin letters) or an underscore (_). Subsequent characters in an identifier or key word can be letters, underscores, digits (0-9), or dollar signs ($). Note that dollar signs are not allowed in identifiers according to the letter of the SQL standard, so their use might render applications less portable.

(Source: https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS)

Closes #7195

(cherry picked from commit d21b351)
leweafan pushed a commit to leweafan/beats that referenced this issue Apr 28, 2023
)

Support `_` and `$` in PostgreSQL database names as all of those are valid characters in a name.

Reference:
> SQL identifiers and key words must begin with a letter (a-z, but also letters with diacritical marks and non-Latin letters) or an underscore (_). Subsequent characters in an identifier or key word can be letters, underscores, digits (0-9), or dollar signs ($). Note that dollar signs are not allowed in identifiers according to the letter of the SQL standard, so their use might render applications less portable.

(Source: https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS)

Closes elastic#7195

(cherry picked from commit a74f810)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants