Ingestion Methods

🚧

Go to the app to start adding & ingesting a log source:

Head right to the "Add a Source" page in the LogDNA application and get your account-specific installation instructions and LogDNA Ingestion Key there.

Via Agent on a single machine

To learn more about the LogDNA Agent, visit its docs.

echo "deb https://repo.logdna.com stable main" | sudo tee /etc/apt/sources.list.d/logdna.list
wget -O- https://repo.logdna.com/logdna.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install logdna-agent < "/dev/null" # this line needed for copy/paste
sudo logdna-agent -k <YOUR INGESTION KEY HERE> # this is your unique Ingestion Key
# /var/log is monitored/added by default (recursively), optionally add more dirs with:
# sudo logdna-agent -d /path/to/log/folders
# You can configure the agent to tag your hosts with:
# sudo logdna-agent -t mytag,myothertag
sudo update-rc.d logdna-agent defaults
sudo /etc/init.d/logdna-agent start
sudo rpm --import https://repo.logdna.com/logdna.gpg
echo "[logdna]
name=LogDNA packages
baseurl=https://repo.logdna.com/el6/
enabled=1
gpgcheck=1
gpgkey=https://repo.logdna.com/logdna.gpg" | sudo tee /etc/yum.repos.d/logdna.repo
sudo yum -y install logdna-agent
sudo logdna-agent -k <YOUR INGESTION KEY HERE> # this is your unique Ingestion Key
# /var/log is monitored/added by default (recursively), optionally add more dirs with:
# sudo logdna-agent -d /path/to/log/folders
# You can configure the agent to tag your hosts with:
# sudo logdna-agent -t mytag,myothertag
sudo chkconfig logdna-agent on
sudo service logdna-agent start
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco install logdna-agent -y
logdna-agent -k <YOUR INGESTION KEY HERE> # this is your unique Ingestion Key
:: %ALLUSERSPROFILE%\logs is monitored/added by default (recursively), optionally add more dirs with:
:: logdna-agent -d C:\path\to\log\folders
:: You can configure the agent to tag your hosts with:
:: logdna-agent -t mytag,myothertag
nssm start logdna-agent
brew update
brew cask install logdna-agent
sudo logdna-agent -k <YOUR INGESTION KEY HERE> # this is your unique Ingestion Key
# /var/log is monitored/added by default (recursively), optionally add more dirs with:
# sudo logdna-agent -d /path/to/log/folders
# You can configure the agent to tag your hosts with:
# sudo logdna-agent -t mytag,myothertag
# Optional: Have logdna-agent always run in the background
sudo launchctl load -w /Library/LaunchDaemons/com.logdna.logdna-agent.plist

Via Agent on a platform

kubectl apply -f https://assets.logdna.com/clients/agent-namespace.yaml
kubectl create secret generic logdna-agent-key -n logdna-agent --from-literal=logdna-agent-key=<YOUR LOGDNA INGESTION KEY>
kubectl apply -f https://assets.logdna.com/clients/agent-resources.yaml
sudo docker run --name='logdna' --restart=always \
-d -v=/var/run/docker.sock:/var/run/docker.sock \
-e LOGDNA_KEY="YOUR INGESTION KEY" \
-e TAGS="logdna" \
logdna/logspout:latest

Via Syslog

To setup regular syslog, or to enable syslog access on a non-default port.

syslog-a.logdna.com:<PORT>
*.* @syslog-a.logdna.com:<PORT>

UDP, TCP and TCP+TLS are all supported on the same provisioned port. Consult your local syslog man page for full configuration details.

Also available via rsyslog and syslog-ng, log in to see the rest of the instructions.

Via API

https://logs.logdna.com/logs/ingest?hostname=:hostname&mac=:mac&ip=:ip&now=:now
curl "https://logs.logdna.com/logs/ingest?hostname=EXAMPLE_HOST&mac=C0:FF:EE:C0:FF:EE&ip=10.0.1.101&now=1548804905877" \
-u <YOUR INGESTION KEY HERE>: \
-H "Content-Type: application/json; charset=UTF-8" \
-d \
'{
   "lines":[
      {
         "timestamp":1548804905877,
         "line":"This is an awesome log statement",
         "file":"example.log"
      }
   ]
}'

Libraries

Check out our official code libraries on our GitHub repos for instructions on how to get started. Also take a look at community-built code libraries. We love the open-source community and welcome you to contribute.

Updated 11 days ago

Ingestion Methods


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.