Skip to content
forked from ctrlrsf/logdna

A library for sending logs to LogDNA via ingest API

Notifications You must be signed in to change notification settings

restocks/logdna

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logdna

A go library for sending logs to LogDNA via their ingest API.

It works but is still under development and subject to change.

Installing

go get github.com/ctrlrsf/logdna/...

Using library

Godoc available at https://godoc.org/github.com/ctrlrsf/logdna

See source code of logdna-stdin command in this repo for an example.

Using logdna-stdin command

logdna-stdin needs to read your LogDNA API key from environment variable LOGDNA_API_KEY so make sure its set:

export LOGDNA_API_KEY=xyz

Usage:

Usage of logdna-stdin:
  -hostname string
        hostname you want logs to appear from in LogDNA viewer
  -log-file-name string
        log file or app name you want logs to appear as in LogDNA viewer

To send logs to LogDNA just pipe anything that writes to stdout to the logdna-stdin command.

$ some_command | logdna-stdin --hostname test.host --log-file-name test.log

From LogDNA viewer you'll now see output from some_command in log file test.log and can filter by host test.host.

About

A library for sending logs to LogDNA via ingest API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 94.6%
  • Makefile 5.4%