[docs]def save_smtp_tls_report_to_elasticsearch(report,
index_suffix=None,
+
index_prefix=None,
monthly_indexes=False,
number_of_shards=1,
number_of_replicas=0):
@@ -727,6 +743,7 @@
Args:
report (OrderedDict): A parsed SMTP TLS report
index_suffix (str): The suffix of the name of the index to save to
+
index_prefix (str): The prefix of the name of the index to save to
monthly_indexes (bool): Use monthly indexes instead of daily indexes
number_of_shards (int): The number of shards to use in the index
number_of_replicas (int): The number of replicas to use in the index
@@ -756,9 +773,12 @@
end_date_query = Q(dict(match=dict(date_end=end_date)))
if index_suffix is not None:
-
search = Search(index="smtp_tls_{0}*".format(index_suffix))
+
search_index = "smtp_tls_{0}*".format(index_suffix)
else:
-
search = Search(index="smtp_tls*")
+
search_index = "smtp_tls*"
+
if index_prefix is not None:
+
search_index = "{0}{1}".format(index_prefix, search_index)
+
search = Search(index=search_index)
query = org_name_query & report_id_query
query = query & begin_date_query & end_date_query
search.query = query
@@ -779,6 +799,8 @@
index = "smtp_tls"
if index_suffix:
index = "{0}_{1}".format(index, index_suffix)
+
if index_prefix:
+
index = "{0}{1}".format(index_prefix, index)
index = "{0}-{1}".format(index, index_date)
index_settings = dict(number_of_shards=number_of_shards,
number_of_replicas=number_of_replicas)
diff --git a/_modules/parsedmarc/opensearch.html b/_modules/parsedmarc/opensearch.html
index 0d069ff..6fb1bf0 100644
--- a/_modules/parsedmarc/opensearch.html
+++ b/_modules/parsedmarc/opensearch.html
@@ -3,7 +3,7 @@
-
parsedmarc.opensearch — parsedmarc 8.12.0 documentation
+
parsedmarc.opensearch — parsedmarc 8.13.0 documentation
@@ -35,7 +35,7 @@
parsedmarc
- 8.12.0
+ 8.13.0