File tree Expand file tree Collapse file tree 5 files changed +91
-0
lines changed
Expand file tree Collapse file tree 5 files changed +91
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ name : Logstash Syntax
3+ on :
4+ push :
5+ tags :
6+ - v*
7+ branches :
8+ - main
9+ pull_request :
10+
11+ jobs :
12+ build :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Check out code
17+ uses : actions/checkout@v2
18+
19+ - name : Install dependencies
20+ run : |
21+ sudo apt-get update
22+ sudo apt-get install gpg
23+ wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
24+ echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
25+ sudo apt-get update
26+ sudo apt-get install logstash
27+ mkdir -p /tmp/logstash/data /tmp/logstash/logs
28+
29+ - name : Test with Logstash
30+ run : |
31+ /usr/share/logstash/bin/logstash --path.settings /etc/logstash/ --path.config '*conf' --path.data /tmp/logstash/data --path.logs /tmp/logstash/logs --config.test_and_exit
Original file line number Diff line number Diff line change 1+ input.conf
2+ output.conf
Original file line number Diff line number Diff line change 11# ansible-logstash-pipeline
22Logstash pipeline for processing Ansible logs
3+
4+ [ ![ CI] ( https://github.com/netways/ansible-logstash-pipeline/workflows/Logstash%20Syntax/badge.svg?event=push )] ( https://github.com/netways/ansible-logstash-pipeline/actions?query=workflow%3A%22Logstash+Syntax%22 )
5+
6+ Minimalist pipeline to parse Ansible logs on managed hosts
7+
8+ ## Inputs and Outputs ##
9+
10+ If you use files called ` input.conf ` and ` output.conf ` they will not collide with this rules, even when you want to pull new versions.
11+
12+ ### Examples ###
13+
14+ Here's an example for an ` input.conf `
15+
16+ ```
17+ input {
18+ redis {
19+ host => "localhost"
20+ data_type => "list"
21+ key => "netways-ansible-input"
22+ }
23+ }
24+ ```
25+
26+ and one for ` output.conf ` .
27+
28+ ```
29+ output {
30+ redis {
31+ host => "localhost"
32+ data_type => "list"
33+ key => "netways-ansible-output"
34+ }
35+ }
36+ ```
Original file line number Diff line number Diff line change 1+ filter {
2+ grok {
3+ match => ["[process][name]","ansible-%{GREEDYDATA:[ansible][module]:string}"]
4+ id => ansible_module
5+ tag_on_failure => ["_grokparsefailure","ansible_module_failed"]
6+ }
7+ }
Original file line number Diff line number Diff line change 1+ filter {
2+ # remove if if really *every* message starts like this
3+ if [message] =~ /Invoked with/ {
4+
5+ grok {
6+ match => ["message", "Invoked with %{GREEDYDATA:[@metadata][ansiblekv]}"]
7+ id => "ansible_invoked"
8+ tag_on_failure => ["_grokparsefailure","ansible_invoked_failed"]
9+ }
10+
11+ kv {
12+ target => "ansible"
13+ id => "ansible_kv"
14+ # doesn't take array as tag_on_failure
15+ }
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments