Code Monkey home page Code Monkey logo

ntail's People

Contributors

pvdb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ntail's Issues

Improve built-in support for formatted output

By using the new "complex formatting" feature in Ruby 1.9, we can significantly improve the built-in support for formatted output.

By implementing the to_hash method on each log line, we could replace something like this:

puts [remote_addr, http_user_agent].join('  =>  ')

... with something like this:

puts "%{remote_addr} => %{http_user_agent}" % self.to_hash

... or even override the puts method on log line instances, and make the hash implicit in the DSL:

puts "%{remote_addr} => %{http_user_agent}"

/cc @jspc

Better built-in support for URI query parsing

Production use of ntail often requires filtering on URI query params, which at the moment isn't very well supported out of the box.

Given a log line with the following uri part of the request component:

/index?qux=blegga&foo=bar

Using the DSL, building a filter on any of the URI query params cannot be more sophisticated then:

-f "uri =~ /blegga/"

Unless you resort to something like:

-f "CGI::parse(URI::parse(uri).query)['qux'] == 'blegga'"

It would be much easier/nicer if ntail implemented this out-of-the-box, something along the lines of:

-f "uri_query_params['qux'] == 'blegga'"

The following StackOverflow post contains a number of viable alternatives for implementing this ntail feature:

http://stackoverflow.com/questions/2500462/how-to-extract-url-parameters-from-a-url-with-ruby-or-rails

/cc @jspc

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.