-
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
Add IIS Filebeat module #6127
Add IIS Filebeat module #6127
Conversation
Two additional grok patterns are added to the IIS Filebeat "access" file set in order to support configurations with more verbose logging enabled. The additional patterns match log files with all IIS log fields enabled and log files generated by IIS running in Microsoft Azure.
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
Hi @karmi. Apologies for that. I've added this email address to my GitHub profile now. Let me know if there is still an issue. |
Hi @ruflin. There is some overlap between the two pull requests. I had started on my own implementation when I saw that #5685 added a basic IIS access logs fileset. My comments/review on that pull request suggested some improvements that could be made (as summarised here) that were based on my own experience working on this feature. In the absence of any response or progress on these suggestions I've carried working on and testing my own fork, which now address all of the feedback noted in #5685 (comment) and addresses a couple of bugs I found in in the changes proposed in #5685. Given that I think I've got a complete implementation of an IIS Filebeat module, I thought I'd submit this as a new pull request. I'm more than happy to handle this different though: just let me know how you'd like me to approach this. |
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.
@cgwrench Thanks for carrying this over, I've made a few small comments on the PR.
One issue that I observed is that the IIS fields don't appear to be in the index template populated when Filebeat starts up. Have I missed something in the setup/build of this new module? For configuring the Kibana dashboards I manually edited the index template.
If you run make update
at the root of the project it will take care of the templates and the docs, your will have to add the modified file on this PR. The missing files are making this PR fails CI.
Concerning moving forward, I think @ruflin and myself agree that we can take this PR and give part of attribution in #5685
We have some responsability to take, we have been a bit too slow to review it.
filebeat/docs/modules/iis.asciidoc
Outdated
|
||
The IIS module was tested with logs from version 10. | ||
|
||
Note: Running IIS on anything other than Windows is not supported. |
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.
Do we really need that mention? We could always still parse IIS formatted log on a Linux machine.
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.
Agreed. I've removed this comment.
type: long | ||
description: > | ||
The HTTP response code. | ||
- name: sub_status |
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 am looking at the https://msdn.microsoft.com/en-us/library/windows/desktop/aa814385(v=vs.85).aspx, I understand all the snake case reference now. :)
type: long | ||
description: > | ||
The Windows status code. | ||
- name: time_taken_ms |
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.
resquest_time_ms
maybe?
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.
Agreed, I've changed this to request_time_ms
.
#Version: 1.0 | ||
#Date: 2018-01-01 10:11:12 | ||
#Fields: date time s-sitename s-computername s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-version cs(User-Agent) cs(Cookie) cs(Referer) cs-host sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken | ||
2018-01-01 10:11:12 W3SVC1 MACHINE-NAME 127.0.0.1 GET / - 80 - 85.181.35.98 HTTP/1.1 Mozilla/5.0+(Windows+NT+6.1;+Win64;+x64;+rv:57.0)+Gecko/20100101+Firefox/57.0 - - example.com 200 0 0 123 456 789 |
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.
Maybe one record could have a query string?
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.
Agreed, I've added a query string example to the first log entry in this file. The query string is quite simple (I've just lifted this from the Nginx module test file). Let me know if you want a fancier query string here.
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.
Thanks for your feedback @ph. All review items should be addressed now. Let me know if there is anything else you'd like me to pick up.
CHANGELOG.asciidoc
Outdated
@@ -32,6 +32,8 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di | |||
*Filebeat* | |||
- Switch to docker prospector in sample manifests for Kubernetes deployment {pull}5963[5963] | |||
|
|||
- Add IIS module. {pull}6127[6127] |
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.
- Add IIS module to parse access log and error log.
@cgwrench Thanks for taking this on. I'm willing to help however I can to get this moved into the beats product as soon as possible. |
jenkins test this please |
@BongoEADGC6 I think what we can do is, get this one merged and rebase changes on a new PR? cc @ruflin |
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.
LGTM but WFSG
Waiting on CI to run everything, I've also restarted the travis filebeat job, It appears to fails because of some network error and weirdness of old pip version.
I think there are some fixes needed in the tests: https://beats-ci.elastic.co/job/elastic+beats+pull-request+multijob-linux/3041/beat=filebeat,label=ubuntu/testReport/junit/test_modules/Test/test_modules/ @ph I added you also as reviewer on to move this forward: #5685 |
@cgwrench I've restarted the test, there seems to be some network/artifact issues unrelated to your changes, I am keeping an eye open. |
jenkins test this please |
@cgwrench We have one error with the test, I believe its because we now send
|
@ph Thanks for pointing this out. I couldn't see |
jenkins test this please |
@cgwrench 👍 🤗 ❤️ Thanks for the all works :) |
@ph No problem, thanks for all your input! |
This pull request adds an IIS Filebeat module to parse access and error logs from the IIS web server. This contribution includes:
For the IIS module access fileset, three grok patterns have been implemented for the ingest pipeline definition:
I think this represents a complete first implementation of an IIS module. Please let me know if there is anything that I've missed or that should be changed.
There are a couple of areas that I'd love feedback on:
Since IIS only runs on Windows, what is the correct way to specify that a Filebeat module should only run on Windows? For now I've only specified paths for Windows in the module
manifest.yml
.One issue that I observed is that the IIS fields don't appear to be in the index template populated when Filebeat starts up. Have I missed something in the setup/build of this new module? For configuring the Kibana dashboards I manually edited the index template.