Skip to content

Add support for AWS postgresql standard log format #3660

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

Merged
merged 6 commits into from
Jul 19, 2022
Merged

Add support for AWS postgresql standard log format #3660

merged 6 commits into from
Jul 19, 2022

Conversation

kaiyan-sheng
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng commented Jul 6, 2022

What does this PR do?

AWS PostgreSQL logs are separated with : instead of the supported , and <space> in https://github.com/elastic/integrations/blob/main/packages/postgresql/data_stream/log/elasticsearch/ingest_pipeline/default.yml#L24-L29. This PR is to create a new pipeline called pipeline-aws-log.yml and use : as separator instead.

AWS PostgreSQL log format

%t:%r:%u@%d:[%p]:t

%t – Time of log entry.
%r – Remote host address.
%u@%d – User name @ database name.
[%p] – Process ID if available.
t - actual log message

Sample log:

2019-03-10 03:54:59 UTC:10.0.0.123(52834):postgres@tstdb:[20175]:ERROR: column "wrong" does not exist at character 8

From the log format you can see, AWS PostgreSQL logs are separated with : between different fields.

Source: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.Concepts.PostgreSQL.html

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Related issues

@kaiyan-sheng kaiyan-sheng marked this pull request as ready for review July 6, 2022 22:00
@kaiyan-sheng kaiyan-sheng requested a review from a team as a code owner July 6, 2022 22:00
@kaiyan-sheng kaiyan-sheng self-assigned this Jul 6, 2022
@kaiyan-sheng kaiyan-sheng added the Team:Cloud-Monitoring Label for the Cloud Monitoring team label Jul 6, 2022
@elasticmachine
Copy link

elasticmachine commented Jul 6, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-07-18T21:25:03.741+0000

  • Duration: 19 min 50 sec

Test stats 🧪

Test Results
Failed 0
Passed 59
Skipped 0
Total 59

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Jul 6, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (1/1) 💚
Files 100.0% (4/4) 💚 2.92
Classes 100.0% (4/4) 💚 2.92
Methods 93.333% (28/30) 👍 3.788
Lines 97.041% (164/169) 👍 7.176
Conditionals 100.0% (0/0) 💚

@ravikesarwani
Copy link

Thanks Kaiyan for driving the fix to this issue.
@rameshelastic/services team let us know if there are any questions. Appreciate your help in getting it reviewed so that we can get this delivered and in the hands of cloud observability team.

@ishleenk17
Copy link
Member

Thanks Kaiyan for driving the fix to this issue. @rameshelastic/services team let us know if there are any questions. Appreciate your help in getting it reviewed so that we can get this delivered and in the hands of cloud observability team.

@ravikesarwani : I'll take a look at it

Copy link
Contributor

@tommyers-elastic tommyers-elastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good - couple of questions though

Copy link
Contributor

@girodav girodav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@kaiyan-sheng kaiyan-sheng requested a review from ishleenk17 July 18, 2022 21:35
Copy link
Member

@ishleenk17 ishleenk17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@kaiyan-sheng kaiyan-sheng merged commit 6c4e788 into elastic:main Jul 19, 2022
@kaiyan-sheng kaiyan-sheng deleted the postgresql_aws branch July 19, 2022 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Cloud-Monitoring Label for the Cloud Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants