Add grenade logs to logstash.

Add grenade new/ and old/ logs to logstash. To do this without tripling
HTTP GETs for every finished job add a job filter to the log gearman
client that when present only attempts to grab files if the job name
matches the job filter.

Change-Id: Ia33722bf71d482f2fd6b655b28090a10bf46af54
This commit is contained in:
Clark Boylan 2014-01-29 14:01:58 -08:00
parent 1b285dbab8
commit 8a2ca3c689
1 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import gear
import json
import logging
import os
import re
import signal
import threading
import yaml
@ -66,6 +67,10 @@ class EventProcessor(threading.Thread):
for fileopts in self.files:
output = {}
source_url, out_event = self._parse_event(event, fileopts)
job_filter = fileopts.get('job-filter')
if (job_filter and
not re.match(job_filter, out_event['fields']['build_name'])):
continue
output['source_url'] = source_url
output['retry'] = fileopts.get('retry-get', False)
output['event'] = out_event