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

Move comments into the docstring #8

Open
mostafa opened this issue Nov 17, 2022 · 0 comments
Open

Move comments into the docstring #8

mostafa opened this issue Nov 17, 2022 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@mostafa
Copy link
Member

mostafa commented Nov 17, 2022

I think these comments belong to the docstring. You can have a Notes: title in the docstring and add these comments there. Currently there are two (or possibly more) conventions:

  1. PEP 257
  2. Google style docstrings

I personally prefer the Google style, because it is more readable.

# TODO: this currently supports two commonly used formats -
# more advanced parser formats would be required/more efficient for other sources
if logsource.product in ("windows", "azure", "zeek"):
# Most Windows log data comes from EventLog, and both Promtail and FluentD
# exporters produce JSON output for Loki.
# Azure log data also arrives in Loki in JSON format, via the Logstash exporter
# - Note: if you are using the Azure data source in Grafana, the query language
# is Kusto QL
# Zeek's default log file format (TSV) is not clearly supported by promtail/loki - but
# fortunately Zeek also offers a JSON format alternative.
# See:
# - https://grafana.com/docs/loki/latest/clients/promtail/scraping/#windows-event-log # noqa: E501
# - https://blog.e-mundo.de/post/painless-and-secure-windows-event-log-delivery-with-fluent-bit-loki-and-grafana/ # noqa: E501
# - https://www.elastic.co/guide/en/logstash/current/plugins-inputs-azure_event_hubs.html # noqa: E501
# - https://docs.zeek.org/en/master/log-formats.html#zeek-json-format-logs

@mostafa mostafa added the documentation Improvements or additions to documentation label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant