Pegando dados de carimbo de data / hora de registros

Postado: @haiqus

Histórico: Muitos softwares envolvem a execução de vários processos. Freqüentemente, isso significa uma sessão de usuário em programação web; em Ifbyphone , isso significa uma chamada telefônica específica.

Tarefa: Dado um arquivo de log, meça as diferenças de tempo (deltas) entre cada evento para uma chamada telefônica específica.

Caso de uso: você sabe que uma chamada desse tipo tem um fluxo específico. Esta chamada telefônica específica apresentou um fluxo anormal e você precisa ver onde ele se desviou do normal.

Ferramentas: Ambiente de servidor Unix básico.

Arquivo de log de amostra:

DEBUG agi 2013-10-04 03:05:00.261 [unique-id] . . .
INFO http
2013-10-04 03:05:00.274 [unique-id] . . .
INFO http
2013-10-04 03:05:00.287 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:00.303 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:03.193 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:03.200 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:03.210 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:03.219 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:07.667 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:07.905 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:08.007 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:08.022 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:08.657 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:08.657 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:08.658 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:08.658 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:08.659 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:08.659 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:08.992 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:08.992 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:08.993 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:08.993 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:20.612 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:20.613 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:20.613 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:20.615 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:21.328 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:21.329 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:21.329 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:21.330 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:33.292 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:33.292 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:33.292 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:33.294 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:36.979 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:36.980 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:36.980 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:36.980 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:37.613 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:37.614 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:37.614 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:37.615 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:42.172 [unique-id] . . .
DEBUG input
2013-10-04 03:05:42.173 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:42.173 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:42.425 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:42.425 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:42.425 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:42.425 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:42.677 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:42.677 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:42.677 [unique-id] . . .
DEBUG agi
2013-10-04 03:05:42.679 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:28.707 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:28.708 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:28.708 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:28.709 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:29.343 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:29.343 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:29.344 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:29.344 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:32.932 [unique-id] . . .
DEBUG input
2013-10-04 03:06:32.932 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:32.933 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:33.184 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:33.184 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:33.184 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:33.185 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:33.436 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:33.436 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:33.437 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:33.438 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:50.932 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:50.933 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:50.933 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:50.934 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:51.567 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:51.567 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:51.567 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:51.568 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:55.452 [unique-id] . . .
DEBUG input
2013-10-04 03:06:55.452 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:55.452 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:55.704 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:55.704 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:55.705 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:55.705 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:55.956 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:55.957 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:55.957 [unique-id] . . .
DEBUG agi
2013-10-04 03:06:55.958 [unique-id] . . .
DEBUG agi
2013-10-04 03:07:10.268 [unique-id] . . .
DEBUG agi
2013-10-04 03:07:10.268 [unique-id] . . .
DEBUG agi
2013-10-04 03:07:10.269 [unique-id] . . .
DEBUG agi
2013-10-04 03:07:10.270 [unique-id] . . .