Forwarding your Vector logs to New Relic will give you enhanced log management capabilities to collect, process, explore, query, and alert on your log data.
To forward your logs from Vector to New Relic:
- Make sure you have:
- A New Relic license key
- Vector version 0.7.0 or higher
Follow the procedures to configure the Vector logs sink for New Relic.
Add a snippet to your
vector.tomlfile (located in
/etc/vectorby default), replacing YOUR_LICENSE_KEY with your New Relic license key:
# Ingest data by tailing one or more files [sources.mylog] type = "file" include = ["/path/to/file"] # Specify file or files to be tailed ignore_older = 86400 # Ignore events older than 1 day file_key = "file" # Add filename to log events host_key = "host" # Add hostname to log events # Configure sink to forward events to New Relic Logs [sinks.new_relic_logs] # REQUIRED type = "new_relic_logs" # must be: "new_relic_logs" inputs = ["mylog"] # example - value must be one or more source IDs license_key = "YOUR_LICENSE_KEY" region = "us" # Enum, must be one of: "us" "eu" depending on your New Relic Logs account region encoding.codec = "json" # OPTIONAL healthcheck = true # default
Restart the Vector service to ensure your changes are applied.
To test if the New Relic logs sink is forwarding events:
Run the following command to append a test log message to your log file:
echo "test message" >> /PATH/TO/YOUR/LOG/FILE
Search New Relic Logs UI for your test message.
If everything is configured correctly and your data is being collected, you should see data logs in both of these places:
- New Relic Logs UI
- New Relic tools for running NRQL queries. For example, you can execute a query like this:
SELECT * FROM Log
If no data appears after you enable our log management capabilities, follow our standard log troubleshooting procedures.
Explore logging data across your platform with the New Relic One UI.