Skip to content

Commit 4f66b8f

Browse files
committed
allow passing exchange's routing key to amqp handler
1 parent e11b6ba commit 4f66b8f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

logstash/handler_amqp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class AMQPLogstashHandler(SocketHandler, object):
4343
def __init__(self, host='localhost', port=5672, username='guest',
4444
password='guest', exchange='logstash', exchange_type='fanout',
4545
virtual_host='/', message_type='logstash', tags=None,
46-
durable=False,
47-
version=0, extra_fields=True, fqdn=False, facility=None):
46+
durable=False, version=0, extra_fields=True, fqdn=False,
47+
facility=None, exchange_routing_key=''):
4848

4949

5050
# AMQP parameters
@@ -56,7 +56,7 @@ def __init__(self, host='localhost', port=5672, username='guest',
5656
self.exchange = exchange
5757
self.exchange_is_durable = durable
5858
self.virtual_host = virtual_host
59-
self.routing_key = ''
59+
self.routing_key = exchange_routing_key
6060

6161
SocketHandler.__init__(self, host, port)
6262

0 commit comments

Comments
 (0)