zendesk / ultragrep

the grep that greps the hardest.
Apache License 2.0
29 stars 4 forks source link

INFRA-434 Multiple key-value search in Json logs #21

Closed aksharachaturvedi closed 10 years ago

aksharachaturvedi commented 10 years ago

@vanchi-zendesk

This PR includes:

  1. Simplified logic for the key-value processing
  2. Handle the search when key is int or bool.
  3. General cleanup, removed the warnings caused by Json.c/.h

I have added the cleanup functions but I think they should be common to all the types. Right now ctx in ug_guts is not getting freed or am I missing something ?

aksharachaturvedi commented 10 years ago

@vanchi-zendesk

Incorporated the changes from the branch 'INFR-393-getopt-implementation' so that file has updated changes for getopt() and json.c

aksharachaturvedi commented 10 years ago

@vanchi-zendesk For Code review (working on indentation)

vanchi-zendesk commented 10 years ago

cc @zenachaturvedi @osheroff I was wondering if we don't bring down -k to ug_guts. What do you think? Maybe let the regexp part of -k be sent down and we filter it out at ruby side? The C code is doing quite a lot now..

vanchi-zendesk commented 10 years ago

@zenachaturvedi Overall, the code looks good. It's high time that we added plenty of tests for this though. We can add the tests at the ruby layer to keep it simple.

vanchi-zendesk commented 10 years ago

I will take a deeper look tomorrow..

aksharachaturvedi commented 10 years ago

cc @vanchi-zendesk and @osheroff. If we leave out -k in ug_guts and just pass regular expression from ruby code then how would we differentiate between 'regular expression for -k vs regular expression that follows in the end' ?

aksharachaturvedi commented 10 years ago

@vanchi-zendesk

Added tests for Json logs.

aksharachaturvedi commented 10 years ago

@vanchi-zendesk
Rebased this branch to get upto date

aksharachaturvedi commented 10 years ago

@vanchi-zendesk

Addressed the code review change.

vanchi-zendesk commented 10 years ago

:+1: