mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-05-20 02:45:24 +00:00
4.0.2 - Use report timestamps for Splunk timestamps
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
4.0.2
|
||||
-----
|
||||
|
||||
- Use report timestamps for Splunk timestamps
|
||||
|
||||
4.0.1
|
||||
-----
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ import imapclient.exceptions
|
||||
import dateparser
|
||||
import mailparser
|
||||
|
||||
__version__ = "4.0.0"
|
||||
__version__ = "4.0.2"
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.setLevel(logging.INFO)
|
||||
|
||||
@@ -4,7 +4,7 @@ import json
|
||||
|
||||
import requests
|
||||
|
||||
from parsedmarc import __version__
|
||||
from parsedmarc import __version__, human_timestamp_to_timestamp
|
||||
|
||||
|
||||
class SplunkError(RuntimeError):
|
||||
@@ -94,6 +94,8 @@ class HECClient(object):
|
||||
"spf"]
|
||||
|
||||
data["sourcetype"] = "dmarc:aggregate"
|
||||
timestamp = human_timestamp_to_timestamp(new_report["begin_date"])
|
||||
data["time"] = timestamp
|
||||
data["event"] = new_report.copy()
|
||||
json_str += "{0}\n".format(json.dumps(data))
|
||||
try:
|
||||
@@ -122,6 +124,9 @@ class HECClient(object):
|
||||
for report in forensic_reports:
|
||||
data = self._common_data.copy()
|
||||
data["sourcetype"] = "dmarc:forensic"
|
||||
timestamp = human_timestamp_to_timestamp(
|
||||
report["arrival_date_utc"])
|
||||
data["time"] = timestamp
|
||||
data["event"] = report.copy()
|
||||
json_str += "{0}\n".format(json.dumps(data))
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user