logdis-filter-timestamp

0.1.0 • Public • Published

logdis-filter-timestamp

This is an officially supported http://logdis.io/ plugin.

A filter to add a timestamp field to the processed object. Can be either an ISO timestamp such as 2016-07-15T11:47:23.301Z or an epoch (in ms) such as 1468583243301.

Synopsis

Require logdis-core and whatever other inputs and outputs you need:

const logdisCore = require('logdis-core')
const filterTimestamp = require('logdis-filter-timestamp')

const logdis = logdisCore()
// inputs ...
logdis.filter(filterTimestamp({
  fieldname : 'ts',
  format    : 'epoch',
}))
// outputs ...

Options

There are two options:

  • fieldname (string, required) - the fieldname to use for the timestamp
  • format (string) - only iso or epoch is allowed (default: iso)

Author

Andrew Chilton:

License

ISC.

(Ends)

Package Sidebar

Install

npm i logdis-filter-timestamp

Homepage

logdis.io/

Weekly Downloads

2

Version

0.1.0

License

ISC

Last publish

Collaborators

  • chilts