Server attributes are key-value pairs that are attached to each log line. These are helpful in providing additional context to your log lines, like whether the log came from a staging or production server, or which version of an app is currently running. These server attributes show up as fields for refinement and inspection in the DataSet UI.
Server attributes are configured in the server_attributes section of the agent.json file.
A special server attribute is serverHost. This field is important and is used by the UI to identify servers. By default, this attribute is automatically set to the hostname where the Scalyr Agent is running. If this hostname is something unhelpful like "ip-12-23-34-45", you can map it to a different name by explicitly setting serverHost as follows:
"server_attributes": { serverHost: "app-server-3", tier: "frontend", stage: "production", datacenter: "us-east-1c" },
The agent should begin using this new name within 30 seconds. All subsequent events from this server will be listed under the new name.
Log Start
Data will begin streaming and the UI will begin to display data based upon the fields. Older data will still be listed under the old hostname; the old name will disappear from the Overview page after 24 hours.
Log Search
When you click into a log, you will see the server attributes attached.
Comments
0 comments
Please sign in to leave a comment.