-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
filebeat wildcard for directories #2084
Comments
This is related to https://github.com/elastic/filebeat/issues/68 Wildcards for directories should already be supported. What is the behaviour you were expecting? Are you looking for |
My folders look like this
This config does not seem to work:
Do I need to change the config to this?
|
I would expect it to work, but TBH so far I only tested |
yes |
Ok, so it seems to work with one directory but not 2 nested directories. We use directly |
do you know a pattern which would work here? |
@ruflin I'm thinking we should list the patterns supported (https://golang.org/pkg/path/filepath/#Match) in our documentation or link to it. Also we should put some info in there to clarify that only one wildcard is supported (assuming I understand correctly)? If you agree I can open a new issue to add this to the docs. |
@andrewkroh Agree. TBH so far it wasn't clear to me that multiple |
The lack of multiple wildcards means it's not possible to have a setup as described in Log Management with ELK for Mesos, where paths have the format From golang/go#11862 it seems Golang will not support this any time soon, and the discussion ends with a reference to go-zglob. Would it be possible to use that for the glob patterns in filebeat? According to this commit it looks like a simple change. |
It's definitively worth a discussion. But it seems to me we are discussing two things here:
I'm not so much worried about the implementation work itself, more the potential side affects we are not aware of yet of which parts are also in the golang issue. It especially see the need to support multiple Are there alternatives to zglob? Could this be done in a few lines in filebeat itself to not have an additional dependency and be able to fix bugs directly? |
** is not need for my use case, this would be enough
|
Potential workaround: Currently, unknown depth of subdirectories is not supported. However, if the depth is known, like it is exactly 4, you could use wildcards to do something like: If limit can be 2, 3 or 4 use You can also create a shared variable to point to the root path, so your config might look like: |
Multiple @runningman84 perhaps something else was wrong in your test, can you re-try it, please? |
Yes it does work for me now. |
This is not working for me as well. Single * works, but a matching of the format: |
Any update on support of * * in filebeat.
|
Sorry some how it's stripping * from directory application_* and container_* |
@raiusa I updated your post to have it posted as code. There is no update yet on this. |
I have the log files under the path like /data//_data//////, for filebeat, is it possible to get the real value for these wildcard * in the path, because the * in this path represents some important information, for instance the log file /data/containers/_data/container_1/serverid_123///*/serverid_123.log, can filebeat get the value like serverid_123? Thanks a lot.
|
@zkf9971 As far as I understand you want to add the path names as fields to the event? If yes, this would be a different feature request then this one here. |
Expand double wildcards into standard glob patterns, up to a maximum depth of 8 levels after the wildcard. Resolves #2084
@nostrebor @zkf9971 @raiusa @runningman84 #3980 ws just merged into master. It would be great if you could check if that works with your use case. The snapshot builds can be found here: https://beats-nightlies.s3.amazonaws.com/index.html?prefix=filebeat/ |
Am I understanding correctly, that this is intended not to work (Filebeat 5.1.1-1.x86_64)? |
@Subtalime This change is only in the 6.x releases. For further questions please use discuss. |
Hi @ruflin
https://github.com/elastic/filebeat/issues/68 is 404 now. What is the latest link? |
That repo no longer exists, but you can read about glob support in the Filebeat documentation. https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-log.html#input-paths |
It looks like filebeat does not support wildcards in directories like this:
The text was updated successfully, but these errors were encountered: