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

Add GELF support #532

Merged
merged 2 commits into from
Aug 24, 2024
Merged

Add GELF support #532

merged 2 commits into from
Aug 24, 2024

Conversation

lingfish
Copy link
Contributor

Implement the ability to log to a GELF server/input, via the use of pygelf.

This is my initial stab at it; similar to SyslogClient, I opted to use parsed_aggregate_reports_to_csv_rows.

This is all sent in one field to GELF (parsedmarc), where then it is normal practice to split the sub-fields out within your logging app (eg. Graylog).

This would be an example Graylog pipeline rule:

rule "DMARC GELF"
when
  has_field("parsedmarc")
then
  let json = parse_json(to_string($message.parsedmarc));
  let map = to_map(json);
  set_fields(map, "dmarc_");
end

Copy link

codecov bot commented Jun 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.98%. Comparing base (d6128ea) to head (fdfb92b).
Report is 30 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #532      +/-   ##
==========================================
+ Coverage   59.88%   59.98%   +0.10%     
==========================================
  Files          12       12              
  Lines        1578     1577       -1     
==========================================
+ Hits          945      946       +1     
+ Misses        633      631       -2     

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

@seanthegeek
Copy link
Contributor

Thanks. Can you add documentation updates to this PR?

@lingfish
Copy link
Contributor Author

Thanks. Can you add documentation updates to this PR?

Err, forgive me... I thought I had?

@lingfish
Copy link
Contributor Author

lingfish commented Aug 8, 2024

Hi @seanthegeek just wondering if we're all good here?

@seanthegeek seanthegeek merged commit 11e0461 into domainaware:master Aug 24, 2024
7 checks passed
seanthegeek added a commit that referenced this pull request Aug 25, 2024
- Add Elastic/OpenSearch index prefix option (PR #531 closes #159)
- Add GELF output support (PR #532)
@lingfish lingfish deleted the gelf branch August 25, 2024 05:55
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.

2 participants