Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logstashsupport #128

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

alexcos78
Copy link

Description

Fix to send record to logstash. It solves issue #127

Fixes #127

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue

How Has This Been Tested?

Running caso-extract sending record to logstash

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

Copy link

sonarcloud bot commented Sep 27, 2024

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 7.14286% with 13 lines in your changes missing coverage. Please review.

Please upload report for BASE (master@9be0fe3). Learn more about missing BASE report.

Files with missing lines Patch % Lines
caso/messenger/logstash.py 0.00% 10 Missing ⚠️
caso/record.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master     #128   +/-   ##
=========================================
  Coverage          ?   50.93%           
=========================================
  Files             ?       23           
  Lines             ?     1127           
  Branches          ?      160           
=========================================
  Hits              ?      574           
  Misses            ?      541           
  Partials          ?       12           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alvarolopez
Copy link
Member

@alexcos78 I think that we need some unit tests for caso/messenger/logstash.py

Copy link
Member

@alvarolopez alvarolopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexcos78 we need to fix the tests before merging, can you please have a look?

@@ -49,11 +50,24 @@ def __init__(self, host=CONF.logstash.host, port=CONF.logstash.port):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

def push(self, records):
"""Push records to logstash using tcp."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This docstring needs to be added again, as flake8 will complain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logstash messenger ends with AttributeError: 'list' object has no attribute 'items'
2 participants