diff --git a/Dockerfiles/dashboards-helper.Dockerfile b/Dockerfiles/dashboards-helper.Dockerfile index 9426311f1..39086b372 100644 --- a/Dockerfiles/dashboards-helper.Dockerfile +++ b/Dockerfiles/dashboards-helper.Dockerfile @@ -95,7 +95,7 @@ RUN apk update --no-cache && \ /opt/templates && \ chmod 755 /data/*.sh /data/*.py /data/init && \ chmod 400 /opt/maps/* && \ - (echo -e "*/2 * * * * /data/create-arkime-sessions-index.sh\n0 10 * * * /data/index-refresh.py --template malcolm_template --unassigned\n30 */2 * * * /data/index-refresh.py --index 'malcolm_beats_*' --template malcolm_beats_template --unassigned\n*/20 * * * * /data/opensearch_index_size_prune.py" > ${SUPERCRONIC_CRONTAB}) + (echo -e "*/2 * * * * /data/create-arkime-sessions-index.sh\n0 10 * * * /data/index-refresh.py --index MALCOLM_NETWORK_INDEX_PATTERN --template malcolm_template --unassigned\n30 */2 * * * /data/index-refresh.py --index MALCOLM_OTHER_INDEX_PATTERN --template malcolm_beats_template --unassigned\n*/20 * * * * /data/opensearch_index_size_prune.py" > ${SUPERCRONIC_CRONTAB}) EXPOSE $OFFLINE_REGION_MAPS_PORT diff --git a/dashboards/scripts/index-refresh.py b/dashboards/scripts/index-refresh.py index 82fc27b5a..4e2ea7458 100755 --- a/dashboards/scripts/index-refresh.py +++ b/dashboards/scripts/index-refresh.py @@ -191,6 +191,10 @@ def main(): if debug: eprint('OpenSearch version is {}'.format(opensearchVersion)) + # if they actually just specified the name of the environment variable, resolve that for the index name + if args.index.startswith('MALCOLM_'): + args.index = os.getenv(args.index, '') + # find the ID of the index name (probably will be the same as the name) getIndexInfoResponse = requests.get( '{}/{}'.format(args.dashboardsUrl, GET_INDEX_PATTERN_INFO_URI),