Created
September 19, 2013 17:46
-
-
Save Spredzy/6627114 to your computer and use it in GitHub Desktop.
[Fixed] Logstash augeas lense
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Logstash = | |
autoload xfm | |
let eol = Util.eol | |
let indent = Util.indent | |
let string_t = /('|")[^ \t\n]*('|")/ | |
let sep_obr = del /[ \t]*\{([ \t]*\n)*/ " {\n" | |
let sep_cbr = del /[ \t]*\}([ \t]*\n)*/ "}\n" | |
let sep_arrow = del /[ \t]*=>[ \t]*/ "=>" | |
let param = Build.key_value_line /[a-zA-Z0-9_]*/ sep_arrow (store string_t) | |
let plugin = | |
[indent . key /[a-zA-Z0-9_]+/ . sep_obr . param* . sep_cbr] | |
let section (name:string) = | |
[indent . key /[a-zA-Z0-9_]+/ . sep_obr . plugin* . sep_cbr] | |
let l_input = section "input" | |
let lns = l_input | |
let filter = incl "/etc/logstash/logstash.conf" | |
let xfm = transform lns filter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment