Giter VIP home page Giter VIP logo

Comments (2)

jordansissel avatar jordansissel commented on August 20, 2024

The short answer is that regular expressions and capturing (grok) is not cheap. It's possible that the slowdown is expected, but maybe not.

I see a lot of DATA uses in the parent ticket, and these can cause bad performance if used repeatedly throughout the pattern. The best way to achieve fast execution with grok is to as specific as possible with your patterns. DATA means .* which matches "anything or nothing" and is the least specific possible. Recommend approaching your pattern with tighter specifics to see what can be done.

Since this is old/idle. I'm going to close it. Any future concerns I am happy to help address in a future ticket :)

from logstash-filter-grok.

rakesh91 avatar rakesh91 commented on August 20, 2024

As extended to this issue, I need some help to parse similar logs in best efficient way:
I am using 1.4.2 logstash
Log1:

  • "-" 2ebb4b4d.51e4940e11a3d [27/Aug/2015:16:57:33 +0530] "POST /request/url HTTP/1.1" 200 399 "-" "Zend_Http_Client" "-; ssl=-" 1 1307568 "9.9.9.9" "differentdata"

Log2:

  • "-" 2ebb4b4d.51e4940e11a3d [27/Aug/2015:16:57:33 +0530] "POST /request/url HTTP/1.1" 200 399 "-" "Zend_Http_Client" "-; ssl=-" 1 1307568 "9.9.9.9"

My parse grok filter is

    grok {

            break_on_match => false
            patterns_dir => [ "/usr/local/infra/logstash/patterns" ]
            match => [


                   "message" , "%{APACHE_ACCESS_LOG} %{QUOTEDSTRING:apache-cookie} %{NUMBER:seconds_delete} %{NUMBER:response-time-in-microsec}  \"(?:%{IPORHOST:client-ip}|-)\"",

                   "message" , "%{APACHE_ACCESS_LOG} %{QUOTEDSTRING:apache-cookie} %{NUMBER:seconds_delete} %{NUMBER:response-time-in-microsec}  \"(?:%{IPORHOST:client-ip}|-)\" %{QS:differentdata}"


            ]
            remove_field => ["message","host","seconds_delete"]

}

I am sending output to elasticsearch and i am not seeing the "differentdata" field in elasticsearch. So there is no effect of the second pattern in grok. If I interchange the position of grok filter, Log1 output is not shown in elasticsearch.
So please help me with this.

from logstash-filter-grok.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.