docs: def callback(self, ch, method, properties, body):
          """
          callback triggered on rabiitmq message received and sends it to
          an elasticsearch index
          """
          index = method.routing_key.split('.')[1]
          index = index.replace('/', '-')
          failed = False
          body = str(body)
          try:
              doc = json.loads(body)
          except Exception as e:  # pragma: no cover
              try:
                  body = body.strip().replace('"', '\"')
                  body = '{"log":"' + body + '"}'
                  doc = json.loads(body)
              except Exception as e:  # pragma: no cover
                  failed = True
  
          if not failed:
              try:
                  self.es_conn.index(index=index,
                                     doc_type=method.routing_key.split('.')[1],
                                     id=method.routing_key + '.' +
                                     str(uuid.uuid4()),
                                     body=doc)
              except Exception as e:  # pragma: no cover
                  print('Failed to send document to elasticsearch because: ' + str(e))