############################# Mockbeat ######################################
mockbeat:
############################# General ############################################

# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
# If this options is not defined, the hostname is used.
name:

# The tags of the shipper are included in their own field with each
# transaction published. Tags make it easy to group servers by different
# logical properties.
tags: [
{%- if agent_tags -%}
	{%- for tag in agent_tags -%}
		"{{ tag }}"
		{%- if not loop.last %}, {% endif -%}
	{%- endfor -%}
{%- endif -%}]

#================================ Queue =====================================

queue.mem:
  events: 4096
  flush.min_events: 8
  flush.timeout: 0.1s

############################# Output ############################################

# Configure what outputs to use when sending the data collected by mockbeat.
# Multiple outputs may NOT be enabled.
output:
  {% if console -%}
  console:
    {% for k, v in console.items() -%}
    {{ k }}: {{ v }}
    {% endfor -%}
  {%- endif %}

  {% if elasticsearch -%}
  elasticsearch:
    {% for k, v in elasticsearch.items() -%}
    {{ k }}: {{ v }}
    {% endfor -%}
  {%- endif %}

  # Redis as output
  # Options:
  # host, port: where Redis is listening on
  #redis:
  #  host: localhost
  #  port: 6379

  # File as output
  # Options
  # path: where to save the files
  # filename: name of the files
  # rotate_every_kb: maximum size of the files in path
  # number of files: maximum number of files in path
  {% if not (console or elasticsearch) -%}
  file:
    path: {{ output_file_path|default(beat.working_dir + "/output") }}
    filename: "{{ output_file_filename|default("mockbeat") }}"
    rotate_every_kb: 1000
    {% if output_file_permissions %}
    permissions: {{ output_file_permissions }}
    {% endif %}
    #number_of_files: 7
  {%- endif %}

#==================== Elasticsearch template setting ==========================
setup.template:
  fields: {{ fields|default("fields.yml") }}
  settings:
    index.number_of_shards: 1
    index.codec: best_compression
  name: {{ es_template_name }}
  pattern: {{ es_template_pattern }}
  overwrite: {{ template_overwrite|default("false") }}
  json:
    enabled: {{ template_json_enabled|default("false") }}
    path: {{ template_json_path }}
    name: {{ template_json_name }}

{% if ilm %}
setup.ilm:
  enabled: {{ ilm.enabled | default("auto") }}
  {% if ilm.policy_name %}
  policy_name: {{ ilm.policy_name }}
  {% endif %}
  {% if ilm.pattern %}
  pattern: {{ ilm.pattern }}
  {% endif %}
  {% if ilm.rollover_alias %}
  rollover_alias: {{ ilm.rollover_alias }}
  {% endif %}
{% endif %}

#================================ Logging =====================================

{% if metrics_period -%}
logging.metrics.period: {{ metrics_period }}
{%- endif %}

{% if keystore_path %}
#================================ keystore =====================================
keystore.path: {{keystore_path}}
{% endif %}

{% if xpack and xpack.monitoring -%}
#================================ X-Pack Monitoring =====================================
xpack.monitoring.elasticsearch.hosts: {{xpack.monitoring.elasticsearch.hosts}}
xpack.monitoring.elasticsearch.metrics.period: 2s    # to speed up tests
xpack.monitoring.elasticsearch.state.period: 3s      # to speed up tests
{% endif -%}

{% if monitoring -%}
#================================ X-Pack Monitoring (direct) =====================================
monitoring:
    {% if monitoring.elasticsearch -%}
    elasticsearch.hosts: {{monitoring.elasticsearch.hosts}}
    elasticsearch.metrics.period: 2s    # to speed up tests
    elasticsearch.state.period: 3s      # to speed up tests
    {% endif -%}

    {% if monitoring.cluster_uuid -%}
    cluster_uuid: {{monitoring.cluster_uuid}}
    {% endif -%}
{% endif -%}

# vim: set ft=jinja:

{% if http_enabled -%}
http.enabled: {{http_enabled}}
{% endif -%}
