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

Add regexes to filter log lines #4

Merged
merged 4 commits into from
Jul 27, 2023

Conversation

MichelHollands
Copy link
Contributor

@MichelHollands MichelHollands commented Jul 7, 2023

Tested by setting the following regexes:

logs:
  piiRegexes:
  - expression: "password (\\\\S+)"
    replace: "****"
  - expression: "GET (\\\\S+)"
    source: ""
    replace: "****"

The log lines collected by Loki looked like this:

level=debug ts=2023-07-25T09:15:37.718485854Z caller=logging.go:101 traceID=6e62e36eb50eb051 msg="GET **** (200) 53.2µs"
192.168.169.182 - - [25/Jul/2023:09:15:30 +0000]  200 "GET **** HTTP/1.1" 2 "-" "kube-probe/1.25+" "-"

@MichelHollands MichelHollands marked this pull request as ready for review July 10, 2023 13:08
@MichelHollands MichelHollands requested review from trevorwhitney and a team July 10, 2023 13:08
@MichelHollands MichelHollands marked this pull request as draft July 24, 2023 12:25
Signed-off-by: Michel Hollands <[email protected]>
Signed-off-by: Michel Hollands <[email protected]>
Signed-off-by: Michel Hollands <[email protected]>
@MichelHollands MichelHollands force-pushed the add_regexes_to_filter_log_lines branch from 60d878a to 04cf591 Compare July 24, 2023 12:41
@MichelHollands MichelHollands marked this pull request as ready for review July 25, 2023 09:20
Copy link
Collaborator

@trevorwhitney trevorwhitney left a comment

Choose a reason for hiding this comment

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

looks great, nice addition!

@MichelHollands MichelHollands merged commit d999ef0 into main Jul 27, 2023
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