Ingestion Methods

Via Agent

Note

This will not work without an Ingestion Key. You can grab an Ingestion Key by creating a free account. If you already have an account, your Ingestion Key can be found by logging into the dashboard, under "Add a Source".

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 Platform

kubectl create secret generic logdna-agent-key --from-literal=logdna-agent-key=<YOUR INGESTION KEY HERE> # this is your unique Ingestion Key
kubectl create -f https://raw.githubusercontent.com/logdna/logdna-agent/master/logdna-agent-ds.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 

Also available via Heroku, Fluentd, CloudWatch, Cloud Foundry, Flynn, and Elastic Beanstalk. Log in for more instructions.

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 code libraries on our GitHub repos for instructions on how to get started. We love the open-source community and welcome you to contribute.

Official Code Libraries

Node.js

Python

Unofficial Code Libraries

Go

Community member @ctrlrsf has written an unofficial Go-lang library for ingestion against our REST API. You can check out his repo here for how to get started.

Java

Community members @robshep and @zileo-net have written unofficial Java logback libraries for ingestion via our ingestion API, including metadata support for MDC. You can check out their repos here and here for further details.

PHP

Community member @nvanheuverzwijn has written an unofficial PHP monolog library for ingestion against our ingestion API. You can check out his repo here for how to get started.

iOS

The good folks at @iosphere have written an unofficial iOS framework for ingestion against our ingestion API. You can check out their repo here for how to get started.

Didn't find what you need?

We also support the following log sources:

  • Fluentd
  • Flynn
  • Cloudwatch
  • Elastics Beanstalk
  • Cloud Foundry
  • Syslog-ng
  • Rsyslog
  • Red Hat

If there's one we don't support, please let us know at support@logdna.com.

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.