Skip to content

Fix --log-format example to conform to glog format - #18808

Merged
snowp merged 1 commit into
envoyproxy:mainfrom
genkami:fix-glog-format-example
Nov 1, 2021
Merged

snowp merged 1 commit into
envoyproxy:mainfrom
genkami:fix-glog-format-example

Conversation

@genkami

@genkami genkami commented Oct 28, 2021

Copy link
Copy Markdown
Contributor

According to GKE's fluent-bit config, logs should be of the format ^(?<severity>\w)(?<time>\d{4} [^\s]*)\s+(?<pid>\d+)\s+(?<source_file>[^ \]]+)\:(?<source_line>\d+)\]\s(?<message>.*)$. (I found it by running kubectl describe cm fluentbit-gke-config-v1.0.6 -n kube-system on my GKE cluster.)

The example in doc lacks \:(?<source_line>\d+) part, so I added it.

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@repokitteh-read-only

Copy link
Copy Markdown

Hi @genkami, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #18808 was opened by genkami.

see: more, trace.

@snowp

snowp commented Oct 29, 2021

Copy link
Copy Markdown
Contributor

This seems fine to me, have you verified that the output is as expected?

@snowp snowp self-assigned this Oct 29, 2021
@genkami

genkami commented Oct 30, 2021

Copy link
Copy Markdown
Contributor Author

Yes. I deployed my Envoy with this cmd flag and saw that the logs are parsed correctly like this:

{
  "jsonPayload": {
    "message": "[1][main]initializing epoch 0 (base id=0, hot restart version=11.104)",
    "pid": "1"
  },
  "severity": "INFO",
  "sourceLocation": {
    "file": "envoy/source/server/server.cc",
    "line": "330"
  },
  ...
}

@snowp snowp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@snowp
snowp merged commit bbdeace into envoyproxy:main Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants