In some cases Stackdriver seems to return error responses for batched
inserts.
This change will log the error response body and status from
Stackdriver for all insertion errors.
Instead of relying on Stackdriver's ingestion timestamps, parse
timestamps out of journal entries and provide those to Stackdriver.
If a timestamp could not be parsed out of a log entry, the ingestion
time is used as the fallback.
In some cases sending 1000 entries seemingly results in a vague "Bad
request" error.
This reduces the chunk size to something that should be more
manageable.
Adds support for persisting the cursor position in a file (by default
`/var/journaldriver/cursor.pos`, overridable via the environment
variable `CURSOR_POSITION_FILE`).
This lets journaldriver resume from a known journal position after
service restarts.
This closes#3
Stackdriver supports structured JSON payloads in addition to simple
plain-text payloads.
This commit introduces a new feature in which journaldriver will
attempt to parse incoming log messages into JSON vaues and forward
them as structured payloads if they are JSON objects.
Messages that can not be parsed into JSON objects will continue to be
forwarded as plain text messages.
This implements the "meat" of the initial version of journaldriver.
Records from journald are converted into the representation required
by Stackdriver and forwarded to the API.
In this initial version journaldriver is only supported on instances
running on GCP.