Skip to content

Commit

Permalink
Improve awslogs Ansible template
Browse files Browse the repository at this point in the history
  • Loading branch information
suizman committed Feb 19, 2019
1 parent 99ebb80 commit 66840dc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions deploy/aws/provision/templates/awslogs.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,18 @@ state_file = /var/lib/awslogs/agent-state
datetime_format = %b %d %H:%M:%S
file = /var/log/messages
buffer_duration = 5000
log_stream_name = {{ ansible_hostname }}
{% if 'type_aws_instance' in group_names %}
log_stream_name = {{ hostvars[inventory_hostname]['tags.Name'] }}
{% endif %}
initial_position = start_of_file
log_group_name = /var/log/messages

[/var/tmp/qed]
datetime_format = %b %d %H:%M:%S
file = /var/qed/qed.log
buffer_duration = 5000
log_stream_name = {{ ansible_hostname }}
{% if 'type_aws_instance' in group_names %}
log_stream_name = {{ hostvars[inventory_hostname]['tags.Name'] }}
{% endif %}
initial_position = start_of_file
log_group_name = qed

0 comments on commit 66840dc

Please sign in to comment.