The LogDNA agent is a program that reads log files from the computer it is installed on and uploads the log data to your LogDNA account. The LogDNA agent is required to view your file-based logs in the LogDNA web app and runs quietly in the background.
There are two different agents; read on to learn about them both.
- LogDNA Agent v1 (Support for Linux, Windows, MacOS; version 2.1.0 drops support of Kubernetes)
- LogDNA Agent v2 (4/30/2020, supports Kubernetes 1.8+)
Earlier versions of the LogDNA Agents
Note that this document addresses the most recent versions of our two LogDNA agents (one Node.js -based and the other Rust-based).
Log in to the LogDNA app and follow the instructions in the product UI for add log sources instructions.
By default, the LogDNA agent automatically logs all .log and extensionless files located under /var/log/, but if you want to log other directories or files, you can use the commands:
#For directories: sudo logdna-agent -d "/path/to/my/logs" #For files: sudo logdna-agent -f "/path/to/my/logfile"
If you need more complex logic, you can also view and set specific logging paths (as well as use glob patterns by editing /etc/logdna.conf. For example:
logdir = /var/log,/myapp/logs/+(name1|name2).log,/etc/myapp/**/*.log
Absolutely! But if you ever want to double check, you can view the source code on GitHub for both Agentv1 and Agent v2 and even build the agent yourself. If you have any questions or feedback, email us at [email protected]
We also love the open source community, so please feel welcome to submit PRs or report any issues you find. Check out our contributing guide for more info.
Host tags allow you to group hosts automatically into dynamic host groups without having to explicitly assign a host to a group within the LogDNA web app. To use tags, ensure the agent is installed on your host and use the following command to add a tag or tags:
sudo logdna-agent -t mytag,myothertag,anothertag
You can also edit the LogDNA configuration file under /etc/logdna.conf and specify the tags there.
tags = mytag,myothertag,anothertag
Keep in mind, even if your hostname or host machine changes, as long as the agent is running with the same tags configured, that host will automatically be added to the dynamic group located under the hosts filter.
The LogDNA agent automatically uses the machine's default OS hostname. If you wish to use a different hostname, you can edit the LogDNA configuration file under /etc/logdna.conf and specify the hostname there.
hostname = mynewhostname
- LogDNA Agent does not work with Kubernetes 1.16.0 - YAML file needs to be updated
Updated 2 months ago