Beispiel #1
0
    def test__parse_date_influxdb_ns(self):
        ts = datetime.datetime(2021, 1, 2, 10, 21, 50, 150)
        influxdb_ts = int(ts.timestamp() * 1e9)

        event = "abc event=hello {}ns".format(influxdb_ts)

        dt = collection._parse_date(collection.LogFormats.InfluxDB, event)
        self.assertEqual(ts, dt)
Beispiel #2
0
    def test__parse_date_LOG(self):
        ts = datetime.datetime(2021, 1, 2, 10, 21, 50, 150)
        event = '{} some-event "other-thing"'.format(ts.isoformat())

        dt = collection._parse_date(collection.LogFormats.LOG, event)
        self.assertEqual(ts, dt)