Git Product home page Git Product logo

Comments (10)

ecwws avatar ecwws commented on August 13, 2024 2

For practical purposes, the difference between event time and the time obtained using Time.now are probably negligible. However, the point you brought up, using time field of the object that was supplied to the plugin does have a certain valid use case: parser plugins that has a setting of time_key will cause the time field to be set using the field from the source data.

Let me test a couple things out, then I'll have it fixed up.

from fluent-plugin-elasticsearch-timestamp-check.

ecwws avatar ecwws commented on August 13, 2024 2

@dannyk81 sorry it took long, 0.2.8 should be using the event time instead of Time.now for added timestamp

from fluent-plugin-elasticsearch-timestamp-check.

ecwws avatar ecwws commented on August 13, 2024 1

@dannyk81 sorry, work suddenly got really really busy, I'm going to try to figure this out tonight

from fluent-plugin-elasticsearch-timestamp-check.

cosmo0920 avatar cosmo0920 commented on August 13, 2024

Because msgpack cannot handle Time object.
In record, users have to insert timestamp as String object or something which contains Time information.
For using elasticsearch, milliseconds time resolution(.%L) is enough.

from fluent-plugin-elasticsearch-timestamp-check.

dannyk81 avatar dannyk81 commented on August 13, 2024

Thanks @cosmo0920, I'm probably missing something, but can't we use this:

Time.at(time).strftime('%Y-%m-%dT%H:%M:%S.%L%z')

Here's the full snippet (lines 48 - 52):

      unless record['fluent_converted_timestamp']
        record['@timestamp'] = record['fluent_added_timestamp'] =
          Time.at(time).strftime('%Y-%m-%dT%H:%M:%S.%L%z')
        $log.debug("Timestamp added: #{record['@timestamp']}")
      end

The filter should have access to tag, time and record ?

from fluent-plugin-elasticsearch-timestamp-check.

cosmo0920 avatar cosmo0920 commented on August 13, 2024

The filter should have access to tag, time and record ?

Within #filter, we should access tag, time, and record but we can only modify record.

from fluent-plugin-elasticsearch-timestamp-check.

dannyk81 avatar dannyk81 commented on August 13, 2024

Yes I uderstand, but I'm not proposing to modify the time object, just to derive the values for keys @timestamp & fluent_added_timestamp in the record from time

record['@timestamp'] = record['fluent_added_timestamp'] = Time.at(time).strftime('%Y-%m-%dT%H:%M:%S.%L%z')

This should work isn't it?

from fluent-plugin-elasticsearch-timestamp-check.

dannyk81 avatar dannyk81 commented on August 13, 2024

Thanks @ecwws 😄

In our deployment, we are using this plugin on the aggregation fluentd nodes, before sending the events to Elasticsearch. We try to keep our fluentd forwarders configuration as basic/simple as possible.

In this kind of setup, since the forwarders have a flush interval of 5 seconds, using Time.now on the aggregation nodes will always introduce a delay in the value of @timestamp compared to the actual ingestion time of the even.

from fluent-plugin-elasticsearch-timestamp-check.

dannyk81 avatar dannyk81 commented on August 13, 2024

@ecwws any luck with this?

from fluent-plugin-elasticsearch-timestamp-check.

dannyk81 avatar dannyk81 commented on August 13, 2024

@ecwws ping 😄

from fluent-plugin-elasticsearch-timestamp-check.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.