- type: log
  paths:
  - /var/log/mesos/*.log
  fields:
    "@type": "mesosagent"
    mesos_slave_id: {{slaveId}}
{{#taskDetails}}
- type: log
  paths:
  {{#absolutePaths}}
  - "{{.}}"
  {{/absolutePaths}}
  fields:
    "@type": {{type}}
    mesos_slave_id: {{slaveId}}
    mesos_framework_id: {{frameworkId}}
    mesos_framework_name: {{frameworkName}}
    mesos_task_id: {{taskId}}
    {{#serviceId}}mesos_service_id: {{serviceId}}{{/serviceId}}
    {{#additionalFields}}
    "{{key}}": "{{value}}"
    {{/additionalFields}}
    {{#globalFields}}
    "{{name}}": "{{value}}"
    {{/globalFields}}
{{#multilineEnabled}}
  multiline:
    pattern: '{{multilinePattern}}'
    negate: {{multilineNegate}}
    match: {{multilineMatch}}
{{/multilineEnabled}}
{{/taskDetails}}

- type: log
  paths:
  - /var/log/mesos/*.log
  fields:
    "@type": "mesosagent"
    mesos_slave_id: {{slaveId}}
    {{#globalFields}}
    "{{name}}": "{{value}}"
    {{/globalFields}}
{{#taskDetails}}
- type: log
  paths:
  {{#absolutePaths}}
  - "{{.}}"
  {{/absolutePaths}}
  fields:
    "@type": {{type}}
    mesos_slave_id: {{slaveId}}
    mesos_framework_id: {{frameworkId}}
    mesos_framework_name: {{frameworkName}}
    mesos_task_id: {{taskId}}
    {{#serviceId}}mesos_service_id: {{serviceId}}{{/serviceId}}
    {{#additionalFields}}
    "{{key}}": "{{value}}"
    {{/additionalFields}}
    {{#globalFields}}
    "{{name}}": "{{value}}"
    {{/globalFields}}
{{#multilineEnabled}}
  multiline:
    pattern: '{{multilinePattern}}'
    negate: {{multilineNegate}}
    match: {{multilineMatch}}
{{/multilineEnabled}}
{{/taskDetails}}

Add global fields to metricbeat events
Add global fields to metricbeat events
