-
Notifications
You must be signed in to change notification settings - Fork 70
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
Documentation for modify_fields
#553
base: master
Are you sure you want to change the base?
Conversation
docs/modify_fields.md
Outdated
type: integer | ||
httpRequest.requestUrl: | ||
move_from: jsonPayload.path | ||
httpRequest.referer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
httpRequest.referer: | |
# Set the value of "httpRequest.referer" based on the | |
# "referer" field's value in the log entry. | |
# Do not set "httpRequest.referer" if the "referer" field's | |
# value is simply a place holder "-". | |
httpRequest.referer: |
docs/modify_fields.md
Outdated
httpRequest.status: | ||
move_from: jsonPayload.http_status | ||
type: integer | ||
httpRequest.requestUrl: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
httpRequest.requestUrl: | |
# Set the value of "httpRequest.requestUrl" based on the | |
# "path" field's value in the log entry. | |
# Also delete the original "path" field from the log entry. | |
httpRequest.requestUrl: |
docs/modify_fields.md
Outdated
set_http_request: | ||
type: modify_fields | ||
fields: | ||
httpRequest.status: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
httpRequest.status: | |
# Set the value of "httpRequest.status" based on the | |
# "http_status" field's value in the log entry. | |
# Convert the value into an integer if needed. | |
# Also delete the original "http_status" field from the log entry. | |
httpRequest.status: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these comments add anything to this config, especially with the sample input and output. The comment literally just repeats the YAML itself without providing any additional information.
|
||
If the source field did not exist, the output value will be set to | ||
`<string>`. If the source field already exists (even if it contains an empty | ||
string), the original value is unmodified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string), the original value is unmodified. | |
string), the original value is unmodified. This config option is not allowed if the source option is `static_value`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a net negative for readability; it should be obvious that default_value
is meaningless if the config already specifies a static_value
from the documentation that's already here. (Since a static value always exists.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is obvious to me, but I have been involved since the beginning of the design discussion, so I could be biased. We can defer it till Mary reads it, and hopefully it's a fresh view
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quentinmit @qingling128 This is confusing. I'm just trying to create a new field with a static value without success. Is that possible with any of this 2 options, and which one? Thank you very much https://stackoverflow.com/questions/73295880/gcp-ops-agent-add-static-field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @llermaly , the official documentation of this has been published at https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/configuration#logging-processor-modify-fields
In case of a bug, please report it at https://cloud.google.com/support-hub with the following details:
- agent version
- full agent log
- full agent config
- project and VM id
- reproduction steps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@llermaly env
isn't a valid field in a LogEntry
; you should be able to use jsonPayload.env
as a field with either static_value
or default_value
(the difference is if the input record has env
set already, static_value
will overwrite it but default_value
will not).
|
||
If the source field did not exist, the output value will be set to | ||
`<string>`. If the source field already exists (even if it contains an empty | ||
string), the original value is unmodified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is obvious to me, but I have been involved since the beginning of the design discussion, so I could be biased. We can defer it till Mary reads it, and hopefully it's a fresh view
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content looks ok to me. Skipping LGTM because we don't plan to submit to this repo.
9370b09
to
10ed1ba
Compare
The official documentation of this has been published at https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/configuration#logging-processor-modify-fields |
Lets revive this PR and try to get it merged soon |
No description provided.