Logstash actual Combat Filter Plugin Grok (collect Apache log)

Source: Internet
Author: User
Tags apache log logstash

Some logs, such as Apache, do not support JSON with Grok plugins like Nginx

Grok using regular expressions for row-matching splits

The predefined locations are defined in the

/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-patterns-core-2.0.5/patterns

Apache in File Grok-patterns

View official documents

Https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html

Vim/etc/logstash/conf.d/grok.conf

input{    Stdin{}}filter {  Grok {    match + = {"Message" = "%{ip:client}%{word:method}%{uripathparam: Request}%{number:bytes}%{number:duration} "}  }}output{   stdout{        codec = Rubydebug   }}

Start

/opt/logstash/bin/logstash-f grok.conf

Output

Ps:grok is very impact performance, inflexible, can use Logstash-redis-python-es

Vim apache_grok.conf

Run output

/opt/logstash/bin/logstash-f apache_grok.conf

Logstash actual Combat Filter Plugin Grok (collect Apache log)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.