diff --git a/CHANGELOG.md b/CHANGELOG.md index e0f2605..9965d38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## 1.2.x +### 1.2.5 +#### Bugfix +* Fixed index name from `fw` to `fw-proxy` ### 1.2.4 #### Bugfix * Fixed ValueError('make_aware expects a naive datetime') in calc_distance function setting the timezone to True in the `Login.timestamp` model field diff --git a/buffalogs/buffalogs/settings/certego.py b/buffalogs/buffalogs/settings/certego.py index f8e1a77..66d2ec0 100644 --- a/buffalogs/buffalogs/settings/certego.py +++ b/buffalogs/buffalogs/settings/certego.py @@ -13,7 +13,7 @@ CERTEGO_BUFFALOGS_POSTGRES_USER = os.environ.get("BUFFALOGS_POSTGRES_USER", "default_user") CERTEGO_BUFFALOGS_POSTGRES_PASSWORD = os.environ.get("BUFFALOGS_POSTGRES_PASSWORD", "password") CERTEGO_BUFFALOGS_POSTGRES_PORT = os.environ.get("BUFFALOGS_POSTGRES_PORT", "5432") -CERTEGO_BUFFALOGS_ELASTIC_INDEX = os.environ.get("BUFFALOGS_ELASTIC_INDEX", "weblog-*,cloud-*,filebeat-*") +CERTEGO_BUFFALOGS_ELASTIC_INDEX = os.environ.get("BUFFALOGS_ELASTIC_INDEX", "weblog-*,cloud-*,fw-proxy-*,filebeat-*") CERTEGO_BUFFALOGS_SECRET_KEY = os.environ.get("BUFFALOGS_SECRET_KEY", "django-insecure-am9z-fi-x*aqxlb-@abkhb@pu!0da%0a77h%-8d(dwzrrktwhu") if CERTEGO_BUFFALOGS_ENVIRONMENT == ENVIRONMENT_DOCKER: diff --git a/buffalogs/impossible_travel/tasks.py b/buffalogs/impossible_travel/tasks.py index 1c8bf28..bda1c8e 100644 --- a/buffalogs/impossible_travel/tasks.py +++ b/buffalogs/impossible_travel/tasks.py @@ -161,7 +161,10 @@ def process_user(db_user, start_date, end_date): if "source" in hit: tmp = {"timestamp": hit["@timestamp"]} tmp["id"] = hit.meta["id"] - tmp["index"] = hit.meta["index"].split("-")[0] + if hit.meta["index"].split("-")[0] == "fw": + tmp["index"] = "fw-proxy" + else: + tmp["index"] = hit.meta["index"].split("-")[0] tmp["ip"] = hit["source"]["ip"] if "geo" in hit.source: if "location" in hit.source.geo and "country_name" in hit.source.geo: diff --git a/config/buffalogs/buffalogs.env b/config/buffalogs/buffalogs.env index a19f490..7035a90 100644 --- a/config/buffalogs/buffalogs.env +++ b/config/buffalogs/buffalogs.env @@ -4,6 +4,6 @@ BUFFALOGS_POSTGRES_PORT=5432 BUFFALOGS_POSTGRES_DB=buffalogs BUFFALOGS_POSTGRES_USER=default_user BUFFALOGS_POSTGRES_PASSWORD=password -BUFFALOGS_ELASTIC_INDEX=weblog-*,cloud-*,fw-proxy-* +BUFFALOGS_ELASTIC_INDEX=weblog-*,cloud-*,fw-proxy-*,filebeat-* BUFFALOGS_SECRET_KEY=django-insecure-am9z-fi-x*aqxlb-@abkhb@pu!0da%0a77h%-8d(dwzrrktwhu