53 lines
1.8 KiB
Django/Jinja
53 lines
1.8 KiB
Django/Jinja
#!/bin/bash
|
|
|
|
/usr/bin/podman run \
|
|
--network host \
|
|
--rm \
|
|
--user 1000:1000 \
|
|
--uidmap 0:{{ logscraper_uid + 1 }}:999 \
|
|
--uidmap 1000:{{ logscraper_uid }}:1 \
|
|
--name logsender-{{ item.tenant }} \
|
|
--volume {{ item.download_dir }}:{{ item.download_dir }}:z \
|
|
{{ container_images['logsender'] }} \
|
|
/usr/local/bin/logsender \
|
|
{% if 'es_host' in item and item['es_host'] %}
|
|
--host "{{ item['es_host'] }}" \
|
|
{% endif %}
|
|
{% if 'es_port' in item and item['es_port'] %}
|
|
--port "{{ item['es_port'] }}" \
|
|
{% endif %}
|
|
{% if 'es_username' in item and item['es_username'] %}
|
|
--username "{{ item.es_username }}" \
|
|
{% endif %}
|
|
{% if 'es_password' in item and item['es_password'] %}
|
|
--password "{{ item.es_password }}" \
|
|
{% endif %}
|
|
{% if 'es_index_prefix' in item and item['es_index_prefix'] %}
|
|
--index-prefix "{{ item['es_index_prefix'] }}" \
|
|
{% endif %}
|
|
{% if 'es_index' in item and item['es_index'] %}
|
|
--index "{{ item['es_index'] }}" \
|
|
{% endif %}
|
|
{% if 'download_dir' in item and item['download_dir'] %}
|
|
--directory "{{ item['download_dir'] }}" \
|
|
{% endif %}
|
|
{% if 'doc_type' in item and item['doc_type'] %}
|
|
--doc-type "{{ item['doc_type'] }}" \
|
|
{% endif %}
|
|
{% if 'es_insecure' in item and item['es_insecure'] %}
|
|
--insecure \
|
|
{% endif %}
|
|
{% if 'logsender_workers' in item and item['logsender_workers'] %}
|
|
--workers "{{ item['logsender_workers'] }}" \
|
|
{% endif %}
|
|
{% if 'chunk_size' in item and item['chunk_size'] %}
|
|
--chunk-size "{{ item['chunk_size'] }}" \
|
|
{% endif %}
|
|
{% if 'keep' in item and item['keep'] %}
|
|
--keep \
|
|
{% endif %}
|
|
{% if 'ignore_es_status' in item and item['ignore_es_status'] %}
|
|
--ignore-es-status \
|
|
{% endif %}
|
|
--follow
|