Skip to content

Commit

Permalink
better recipient handling in csv destination
Browse files Browse the repository at this point in the history
  • Loading branch information
kouk committed Oct 27, 2016
1 parent 5ddbfbd commit afe1aaa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mgship/destination/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from contextlib import contextmanager

from mgship.log import logger
from mgship.data.event import get_recipient

__all__ = ['Destination']

Expand All @@ -17,9 +18,10 @@ def print_events():
event = yield eid
envelope = event.get('envelope', {})
writer.writerow([
event.get('id', ''),
','.join(event.get('tags', [])),
envelope.get('sender', ''),
envelope.get('targets', ''),
get_recipient(event) or '',
event.get('event', ''),
event.get('timestamp', '')])

Expand Down

0 comments on commit afe1aaa

Please sign in to comment.