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

logging: Implement rename filter, changes field key names #4745

Merged
merged 1 commit into from Apr 28, 2022

Conversation

francislavoie
Copy link
Member

Fixes #4744

Quick little feature; lets you rename the key of a field:

	log {
		format filter {
			wrap console
			fields {
				request>remote_ip rename client_ip
			}
		}
	}

Little implementation note. If you try to rename the same field twice, you must use the original name again; they can't be chained. E.g. this will not work, and the result will be client_ip:

request>remote_ip rename client_ip
request>client_ip rename something_else

But this will result in something_else:

request>remote_ip rename client_ip
request>remote_ip rename something_else

@francislavoie francislavoie added the feature ⚙️ New feature or request label Apr 28, 2022
@francislavoie francislavoie added this to the v2.5.1 milestone Apr 28, 2022
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

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

:shipit:

🚢 it

Neat contribution! Thank you.

@francislavoie francislavoie merged commit 0be3d99 into master Apr 28, 2022
@francislavoie francislavoie deleted the log-rename-filter branch April 28, 2022 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ⚙️ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customise the field names for logs.
2 participants