Skip to content

Commit

Permalink
Update use-tcp-endpoint-forward-logs-new-relic.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
ally-sassman committed Jun 14, 2023
1 parent 8c71720 commit 1d4d4e5
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ To forward logs to New Relic with `rsyslog` for Amazon Linux, Redhat, and Centos

To make your `syslog` data consistent with the rest of your telemetry data, you can add custom attributes. There are two ways to do this:

a. **Add custom attributes directly in the template string.** You'll need to escape the double quotes (`"`) for the string values. For example:
* **Add custom attributes directly in the template string.** You'll need to escape the double quotes (`"`) for the string values. For example:

`[<STRUCTURED_DATA_ID> <ATTR_NAME_1>="<ATTR_VALUE_1>" <ATTR_NAME_2>="<ATTR_VALUE_2>" ...]`

Expand All @@ -89,7 +89,7 @@ To forward logs to New Relic with `rsyslog` for Amazon Linux, Redhat, and Centos
)
```

b. **Add custom attributes using a custom property variable in the template string.** This method avoids the need to escape string characters.
* **Add custom attributes using a custom property variable in the template string.** This method avoids the need to escape string characters.

```properties
template(name="newrelic-rfc5424"
Expand All @@ -99,12 +99,15 @@ To forward logs to New Relic with `rsyslog` for Amazon Linux, Redhat, and Centos

set $!custom-structured-data = '[someId1 environment="prod" region="US"][someId2 team="sre" cost-center="123"]';
```

Make sure you replace the `%structured-data%` section in the template string with custom tags/attributes.

7. Restart the `rsyslog` service by running:

```bash
sudo systemctl restart rsyslog
```

8. [Check your New Relic account](/docs/logs/log-management/ui-data/explore-your-data-log-analytics) for logs.

## Configure rsyslog versions 8 and above with compression (Amazon Linux, Redhat, Centos) [#rsyslog-compression]
Expand Down

0 comments on commit 1d4d4e5

Please sign in to comment.