Token-based input is a single TCP connection where each log line contains a token which uniquely identifies the destination log. The token can be used anywhere in the event separated by a white space from the entry content. The token will not appear in any of your log entries because is removed by the Logentries API server from the stream upon processing.
This is suitable for platform providers with centralized logging, since it allows to associate user logs with a Logentries destination log when you have multiple users per server instance.
It is also suitable for logging sources which change public IP address (and thus Plain TCP/UDP cannot be used) or you have to log from multiple sources with the same public IP address.
Token-based logging is also ideal, If you want to log from a programmable application in a language like Ruby, Java, Python, .Net etc to your Logentries account.
You can (and are encouraged to) use multiple tokens in one TCP stream.
Token has the form of randomly generated UUID, for example
It is generated using a cryptographically strong pseudo random number generator.
Open a TCP connection to data.logentries.com, port number
Token based inputs are enabled for UDP as well.
For untrusted networks you can open an TLS/SSL encrypted connection to
data.logentries.com, port number
You can use
telnet to easily test this input method. The following example will log two messages:
Logentries will automatically remove the Token from your messages.
telnet data.logentries.com 80 Trying 126.96.36.199... Connected to data.logentries.com. Escape character is '^]'. 100002bfbea1e-10c3-4419-bdad-7e6435882e1f My first log entry My second 2bfbea1e-10c3-4419-bdad-7e6435882e1f log entry with token inside
telnet-ssl -z ssl data.logentries.com 443 100002bfbea1e-10c3-4419-bdad-7e6435882e1f My SSL secured log message