-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in_dummy: support new property start_time_sec/nsec #2107
Conversation
Signed-off-by: Takahiro YAMASHITA <[email protected]>
Signed-off-by: Takahiro YAMASHITA <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this feature with my dev server. I can confirm it works.
$ ./bin/fluent-bit -i dummy -p dummy_sec=1 -p dummy_nsec=500000000 -o stdout
...
[0] dummy.0: [1.500000000, {"message"=>"dummy"}]
[1] dummy.0: [2.499944670, {"message"=>"dummy"}]
thanks for the contribution and review. @nokute78 in order to follow the semantics of other plugins, would you please rename the configuration properties ?, e.g: https://github.com/fluent/fluent-bit/blob/master/plugins/in_cpu/cpu.c#L521 |
@fujimotos @edsiper Thank you for reviewing.
This property is for the timestamp of first event, not for the interval of event. Hmm, how about |
@edsiper Any ideas for naming ? Currently, we can generate dummy event like this.
In this case, dummy event is |
ahh got it. start_time_sec and start_time_nsec sounds good to me, but I just realized that the core is not using nanoseconds: https://github.com/fluent/fluent-bit/blob/master/lib/monkey/mk_core/mk_event_epoll.c#L185 |
Signed-off-by: Takahiro YAMASHITA <[email protected]>
@edsiper OK, I renamed the properties.
No problem. |
thanks! |
timestamp issue (especially filter plugin issue like #2015) is hard to reproduce.
(e.g. write dummy logfile and use in_tail to parse it or use in_forward and send dummy message pack event ...)
I added new property
dummy_sec
anddummy_nsec
for debugging.It makes timestamp of event configurable.
If
dummy_sec
anddummy_nsec
are not set, in_dummy works as usual.in_dummy uses current time as timestamp.
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
a.conf:
output is like this.
Timestamp is overwritten.
valgrind :
Documentation
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.