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:
- PEP 257
- 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 |