Logentries API
Unofficial HTTP API Wrapper
Can be used as a Node.js module and as a command line utility to
- register hosts
- create logs
- fetch infos abouts hosts and logs from logentries.com
This module can not be used to write logs to logentries.com. If you look for a node module to write logs, I recommend node-logentries
.
Disclaimer
This module is in no way related to logentries.com Inc. and is not supported by them.
Command line usage
All command line actions return a JSON formatted string. I highly recommend the great jsontool
npm module for processing (filter, format,...) these results.
Get all registered hosts
$ le-api hosts
Returns a JSON string representing an array of all registered hosts:
Get host key by host name
$ le-api host <hostname>
Return value:
Register host
$ le-api register <hostname>
Returns the name and key of the newly registered host:
Create log
$ le-api createlog <logname> <logtype> <host key>
The logtype
parameter takes the following values:
- token ... token based log
- udp ... plain UDP log (for syslog forwarding)
Return the name, key and port (if the created log is of type 'udp'):
Library usage
Example
var leApi = accessKey: 'my_access_key' ; leApi; leApi; leApi; leApi;