Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Conversation

@loafyloaf
Copy link
Contributor

@bonnyci
Copy link

bonnyci bot commented Apr 26, 2017

Copy link
Contributor

@ConsoleCatzirl ConsoleCatzirl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good start, but we need a little more than this.

bastion.yml Outdated
- input_type: log
document_type: ansible_runner
paths:
- "/var/www/html/cron-logs/$env/*.log"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only track either the current or the latest log, but if we track all logs in the directory then we will get a bunch of duplicate entries after every log rotation. Also there is nothing setting $env, so that should be another * instead.

Also, the document type is used by logstash to know how to parse the logs. Using ansible_runner for the type is correct, but doesn't have a matching logstash filter yet, we will need to add that as well. We will need a change similar to 808c70c to add the new log parsing. And we can probably reuse the exact same multiline configuration from that change since it is based on lines starting with a timestamp. The tricky part is the grok pattern, we can chat about that in irc or slack.

@bonnyci
Copy link

bonnyci bot commented Apr 27, 2017

@bonnyci
Copy link

bonnyci bot commented Apr 27, 2017

filter {
if [type] == "ansible-runner" {
grok {
match => { "message" => "%{SUPERAWESOMEANSIBLELOG}"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a stab at writing our super-awesome ansible-log pattern

ConsoleCatzirl and others added 2 commits May 3, 2017 17:11
Make the filebeat document-type match the logstash filter type.

Remove the date filter since we don't have timestamps to parse,
which means we have to rely on logstash received time for event
timestamps.

Create multiline events split by empty lines in the log file.

Add multiple grok patterns for the various types of output we get
from ansible-playbook.

Signed-off-by: K Jonathan Harker <Jonathan.Harker@ibm.com>
@bonnyci
Copy link

bonnyci bot commented May 4, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Figure out system log publishing

3 participants