3 Parses /opt/splunk/etc/*, /opt/splunkforwarder/etc/system/local/*.conf and /opt/splunkforwarder/etc/apps/*/(default|local)/*.conf
5 Author: Tim Brigham, Jason Antman
8 https://docs.splunk.com/Documentation/Splunk/6.5.0/Admin/AboutConfigurationFiles
11 This file is licenced under the LGPL v2+
14 Works like IniFile lens, with anonymous section for entries without enclosing section and allowing underscore-prefixed keys.
16 About: Configuration files
17 This lens applies to conf files under /opt/splunk/etc and /opt/splunkforwarder/etc See <filter>.
20 The <Test_Splunk> file contains various examples and tests.
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
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
36 let record = IniFile.record title entry
37 let anon = [ label ".anon" . (entry|empty)+ ]
38 let lns = anon . (record)* | (record)*
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