Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / splunk.aug
1 (*
2 Module: Splunk
3   Parses /opt/splunk/etc/*, /opt/splunkforwarder/etc/system/local/*.conf and /opt/splunkforwarder/etc/apps/*/(default|local)/*.conf
4
5 Author: Tim Brigham, Jason Antman
6
7 About: Reference
8   https://docs.splunk.com/Documentation/Splunk/6.5.0/Admin/AboutConfigurationFiles
9
10 About: License
11    This file is licenced under the LGPL v2+
12
13 About: Lens Usage
14    Works like IniFile lens, with anonymous section for entries without enclosing section and allowing underscore-prefixed keys.
15
16 About: Configuration files
17    This lens applies to conf files under /opt/splunk/etc and /opt/splunkforwarder/etc See <filter>.
18
19 About: Examples
20    The <Test_Splunk> file contains various examples and tests.
21 *)
22
23 module Splunk =
24   autoload xfm
25
26   let comment   = IniFile.comment IniFile.comment_re IniFile.comment_default
27   let sep       = IniFile.sep IniFile.sep_re IniFile.sep_default
28   let empty     = IniFile.empty
29
30   let entry_re  = ( /[A-Za-z_][A-Za-z0-9._-]*/ )
31   let setting   = entry_re
32   let title     =  IniFile.indented_title_label "target" IniFile.record_label_re
33   let entry     = [ key entry_re . sep . IniFile.sto_to_eol? . IniFile.eol ] | comment
34
35
36   let record    = IniFile.record title entry
37   let anon      = [ label ".anon" . (entry|empty)+ ]
38   let lns       = anon . (record)* | (record)*
39
40   let filter    = incl "/opt/splunk/etc/system/local/*.conf"
41                 . incl "/opt/splunk/etc/apps/*/local/*.conf"
42                 . incl "/opt/splunkforwarder/etc/system/local/*.conf"
43                 . incl "/opt/splunkforwarder/etc/apps/*/default/*.conf"
44                 . incl "/opt/splunkforwarder/etc/apps/*/local/*.conf"
45   let xfm       = transform lns filter