zendesk / ultragrep

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

Adding type for zuora #13

Closed prudhvi closed 8 years ago

prudhvi commented 11 years ago

@osheroff, @grosser

Not sure what format means , I couldn't find it being used directly in code.

Also not sure how often this gets deployed . So wanted to know if this is the best way to add a new type.

grosser commented 11 years ago

format is if it greps for "Started at" or json stuff <-> not sure if those logs are in any supported format.

you can deploy as often as you want -> https://github.com/zendesk/ultragrep_deploy

grosser commented 11 years ago

:+1: if the zuora logs look like rails logs

osheroff commented 11 years ago

@prudhvi, "format" describes how the log files are structured. "app" currently describes logs in which log-sessions are delimited with 2 newlines.

Unfortunately it also describes a regular expression that pulls a timestamp out of the logs, so this PR mostly likely won't work without a bit more abstraction. What do the log formats look like?

prudhvi commented 11 years ago

@grosser , @osheroff Thanks a lot for the input.

We log all messages in zuora.log with following method

https://github.com/zendesk/zendesk/blob/master/lib/zendesk/zuora/logging.rb#L15

where every line looks like

2013-04-04 07:34:55 Zendesk::Zuora::Synchronizer::RemoteSynchronizer timestamp classname

Here are sample lines from the log

2013-04-04 07:34:52 Zendesk::Zuora::Client 0 2c92a0f93b73f63d013b765d8fba165b get_rate_plans! 2c92a0f93b73f63d013b765d9827167f Enterprise (Annually) 4028e48835ef993a0135f08d21972db6 2c92a0f93b73f63d013b765d97571676 2013-04-04 07:34:53 Zendesk::Zuora::Client 0 2c92a0f93b73f63d013b765d8fba165b get_rate_plan_charge! 2c92a0f93b73f63d013b765d98331680 8 2013-04-04 07:34:53 Zendesk::Zuora::Client 0 2c92a0f93b73f63d013b765d8fba165b get_max_agent_count! 2c92a0f93b73f63d013b765d98331680 8 2013-04-04 07:34:53 Zendesk::Zuora::Client 0 2c92a0f93b73f63d013b765d8fba165b get_current_subscription_data! 4 4 4 8 true 2013-04-04 07:34:54 Zendesk::Zuora::Synchronizer::RemoteSynchronizer 0 0 synchronize_subscription! complete 2013-04-04 07:34:54 Zendesk::Zuora::Synchronizer::RemoteSynchronizer 0 0 synchronize_voice! start 2013-04-04 07:34:54 Zendesk::Zuora::Synchronizer::RemoteSynchronizer 0 0 synchronize_voice! complete 2013-04-04 07:34:55 Zendesk::Zuora::Synchronizer 0 2c92a0f93d6c7d34013d93e2bea16e64 zendesk_account 260720 bit9 2013-04-04 07:34:55 Zendesk::Zuora::Synchronizer::RemoteSynchronizer 0 0 synchronize_subscription! start

I will close the PR if this requires me to write a new zuora format parser similar to https://github.com/zendesk/ultragrep/blob/master/ext/ultragrep/rails_req.c

grosser commented 11 years ago

Maybe a 'simple' parser that ignores timestamps etc could be useful, so you can grep any kind of log without adding new formatters (just uses the same date-from-filename timestamp for every line)

On Tue, Jul 30, 2013 at 5:21 PM, Prudhvi Dhulipalla < notifications@github.com> wrote:

@grosser https://github.com/grosser , @osheroffhttps://github.com/osheroffThanks a lot for the input.

We log all messages in zuora.log with following method

https://github.com/zendesk/zendesk/blob/master/lib/zendesk/zuora/logging.rb#L15

where every line looks like

2013-04-04 07:34:55 Zendesk::Zuora::Synchronizer::RemoteSynchronizer timestamp classname

Here are sample lines from the log

2013-04-04 07:34:52 Zendesk::Zuora::Client 0 2c92a0f93b73f63d013b765d8fba165b get_rate_plans! 2c92a0f93b73f63d013b765d9827167f Enterprise (Annually) 4028e48835ef993a0135f08d21972db6 2c92a0f93b73f63d013b765d97571676 2013-04-04 07:34:53 Zendesk::Zuora::Client 0 2c92a0f93b73f63d013b765d8fba165b get_rate_plan_charge! 2c92a0f93b73f63d013b765d98331680 8 2013-04-04 07:34:53 Zendesk::Zuora::Client 0 2c92a0f93b73f63d013b765d8fba165b get_max_agent_count! 2c92a0f93b73f63d013b765d98331680 8 2013-04-04 07:34:53 Zendesk::Zuora::Client 0 2c92a0f93b73f63d013b765d8fba165b get_current_subscription_data! 4 4 4 8 true 2013-04-04 07:34:54 Zendesk::Zuora::Synchronizer::RemoteSynchronizer 0 0 synchronize_subscription! complete 2013-04-04 07:34:54 Zendesk::Zuora::Synchronizer::RemoteSynchronizer 0 0 synchronize_voice! start 2013-04-04 07:34:54 Zendesk::Zuora::Synchronizer::RemoteSynchronizer 0 0 synchronize_voice! complete 2013-04-04 07:34:55 Zendesk::Zuora::Synchronizer 0 2c92a0f93d6c7d34013d93e2bea16e64 zendesk_account 260720 bit9 2013-04-04 07:34:55 Zendesk::Zuora::Synchronizer::RemoteSynchronizer 0 0 synchronize_subscription! start

I will close the PR if this requires me to write a new zuora format parser similar to https://github.com/zendesk/ultragrep/blob/master/ext/ultragrep/rails_req.c

— Reply to this email directly or view it on GitHubhttps://github.com/zendesk/ultragrep/pull/13#issuecomment-21832629 .

osheroff commented 11 years ago

@prudhvi how were you thinking of invoking ultragrep, and what would it return? is there a "session" as such in the zuora synchronizer?

We could certain write an exceedingly simple "output all lines that match" type of request parser (line-by-line), but it'd would do much more than standard grep...

prudhvi commented 11 years ago

Sure if it's simple , I will drop by one of you on Thursday. My most common use case for search is

ultragrep -l zuora -s'start_date' -e'end_date' "string"