-
Notifications
You must be signed in to change notification settings - Fork 151
Adding feature to support dynamic prefix #70
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
Conversation
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'. |
any chance this can get merged ?? |
The problem with that pull request is this change isn't thread safe. The use case you are looking to have is to dynamically chose where the events are send? I suggest you configure multiple outputs in your configuration and use the conditionals to route the events to the right output. |
…en flushing in a thread safe way
You are absolutely right and if it was thread safe for us it was because we used conditionals to route to different prefixes. Anyway, having dynamic temporal partitions by date could be an interesting feature, so I have provided a new fix where the prefix is rendered when uploading data to S3 based on the current date and not based on events. Maybe this is a valid solution that allow us to have temporal partitions with a thread safe implementation. @ph what is your opinion about this approach? Thanks in advance. |
This make more sense to me, to use the current time as the diviser of the file. |
@sdiazb Can we make that option configurable and make it off by default? |
Hi @ph! I am not sure that I have understood the last comment. I think that, with the current implementation, the option is configurable and it is off by default. In the conf file, it is not mandatory to explicit the prefix, so you can have a conf like this:
Also it is possible to specify a static prefix like this:
And with this feature it would be possible to specify a dynamic prefix, so the date is rendered in the prefix as follows:
I am afraid that I missed something from your last comment. Could you clarify it a little bit so we can improve the PR? Thanks in advance! |
There are already a number of workarounds for dynamically adding time/date prefixes in the s3 bucket. Is this dynamic prefixing only going to deal with temporal data? What about actual dynamic folder names based on (for instance) root-level attributes passed in from filebeat? Or the hostname of the originating log data (like @lmello suggested)? This can be dealt with using conditional statements but as the infrastructure gets more complicated this can be difficult to maintain.... |
@lremurphy everything that string support will be supported in the prefix, so it could be any fields or date. |
Fixed in 4.0, by #102 |
No description provided.