-
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
Feature Request: Allow regular expressions in prospector paths and extract to metadata #7024
Comments
Hello, we are not planning to add regular expression as a processor, but we plan to have dissect which will allow to tokenize this string. We have a PR at #6925 |
@DanielYWoo The Dissect processor will allow you to target any fields, so in your case you will target the token: "/opt/logs/%{env}/%{application_name}/%{log_type}.log"
example string: "/opt/logs/production/myapp/web.log" This will generate the following fields: env: "production"
application_name: "myapp"
log_type: "web" |
@DanielYWoo I have added a complete example to my previous comment. |
I will close this for now, @DanielYWoo feel free to reopen it if you think dissect cannot solve your use case. |
Thanks, got it |
We have 800+ applications and trying to migrate to beat. The problem is that our log files are in a standard pattern, e,g.
We have so many applications that we don't want to specify a prospector for each of those applications, we want to set up a single prospector, with a regular expression pattern instead of glob-pattern, to extract , and into metadata as fields like @metadata.env, @metadata.application_name and @metadata.log_type.
Another option is to write our own processor to handle this but that's not a general solution, if we change our file pattern we have to compile the processor and deploy again. So it's best to support regular expression in prospector paths.
The text was updated successfully, but these errors were encountered: