flowbber.plugins.sources.timestamp

Timestamp

This source allows to collect timestamps in several formats.

It is recommended to include at least one timestamp source on every pipeline in order to have a unique and consistent timestamp for the whole pipeline to use.

Data collected:

{
    "timezone": null,
    "epoch": 1502852229,
    "epochf": 1502852229.427491,
    "iso8601": "2017-08-15T20:57:09",
    "strftime": "2017-08-15 20:57:09"
}
{
    "timezone": 0,
    "epoch": 1507841667,
    "epochf": 1507841667.9304831028,
    "iso8601": "2017-10-12T20:54:27+00:00",
    "strftime": "2017-10-12 20:54:27"
}

Dependencies:

pip3 install flowbber[timestamp]

Usage:

[[sources]]
type = "timestamp"
id = "..."

    [sources.config]
    epoch = true
    epochf = true
    iso8601 = true
    strftime = "%Y-%m-%d %H:%M:%S"
{
    "sources": [
        {
            "type": "timestamp",
            "id": "...",
            "config": {
                "timezone": null,
                "epoch": true,
                "epochf": true,
                "iso8601": true,
                "strftime": "%Y-%m-%d %H:%M:%S"
            }
        }
    ]
}

timezone

Specify the timezone for which the timestamp should be calculated. If None is provided (the default), the timestamp will be calculated using the local timezone (current time). Use 0 for a UTC timestamp, and a +/-12 integer for any other timezone.

Note that this doesn’t affect the epoch or epochf timestamps, as those values are always in POSIX time which is the number of seconds since the Epoch (1970-01-01 UTC) not counting leap seconds.

  • Default: None

  • Optional: True

  • Schema:

    {
       'type': 'integer',
       'nullable': True,
       'max': 12,
       'min': -12,
    }
    
  • Secret: False

epoch

Include seconds since the EPOCH, as integer.

  • Default: True

  • Optional: True

  • Schema:

    {
        'type': 'boolean',
    }
    
  • Secret: False

epochf

Include seconds since the EPOCH, as float.

  • Default: False

  • Optional: True

  • Schema:

    {
        'type': 'boolean',
    }
    
  • Secret: False

iso8601

Include current time as a ISO 8601 string using the seconds time specification.

  • Default: False

  • Optional: True

  • Schema:

    {
        'type': 'boolean',
    }
    
  • Secret: False

strftime

Include a string timestamp using a custom format supported by Python’s strftime function.

For example: "%Y-%m-%d %H:%M:%S"

  • Default: None

  • Optional: True

  • Schema:

    {
        'type': 'string',
        'empty': False,
    }
    
  • Secret: False

Classes

class flowbber.plugins.sources.timestamp.TimestampSource(index, type_, id_, optional=False, timeout=None, config=None)

Inheritance

Inheritance diagram of TimestampSource