ConfigLMM 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/CNAME +1 -0
  4. data/Examples/.lmm.state.yaml +159 -0
  5. data/Examples/ConfigLMM.mm.yaml +32 -0
  6. data/Examples/Implemented.mm.yaml +252 -4
  7. data/Examples/SmallBusiness.mm.yaml +492 -0
  8. data/Plugins/Apps/Answer/answer.lmm.rb +165 -0
  9. data/Plugins/Apps/Answer/answer@.service +40 -0
  10. data/Plugins/Apps/ArchiSteamFarm/ArchiSteamFarm.conf.erb +0 -3
  11. data/Plugins/Apps/ArchiSteamFarm/ArchiSteamFarm.lmm.rb +0 -1
  12. data/Plugins/Apps/Authentik/Authentik-ProxyOutpost.container +7 -1
  13. data/Plugins/Apps/Authentik/Authentik-Server.container +6 -1
  14. data/Plugins/Apps/Authentik/Authentik-Worker.container +6 -1
  15. data/Plugins/Apps/Authentik/Authentik.conf.erb +12 -7
  16. data/Plugins/Apps/Authentik/Authentik.lmm.rb +226 -61
  17. data/Plugins/Apps/BookStack/BookStack.conf.erb +0 -3
  18. data/Plugins/Apps/BookStack/BookStack.container +5 -0
  19. data/Plugins/Apps/BookStack/BookStack.lmm.rb +14 -3
  20. data/Plugins/Apps/Cassandra/Cassandra.lmm.rb +9 -19
  21. data/Plugins/Apps/ClickHouse/ClickHouse.container +28 -0
  22. data/Plugins/Apps/ClickHouse/ClickHouse.lmm.rb +113 -0
  23. data/Plugins/Apps/ClickHouse/Config/listen.yaml +2 -0
  24. data/Plugins/Apps/ClickHouse/Config/logger.yaml +8 -0
  25. data/Plugins/Apps/ClickHouse/Config/zookeepers.yaml +5 -0
  26. data/Plugins/Apps/ClickHouse/Connection.rb +96 -0
  27. data/Plugins/Apps/Discourse/Discourse-Sidekiq.container +5 -0
  28. data/Plugins/Apps/Discourse/Discourse.conf.erb +1 -4
  29. data/Plugins/Apps/Discourse/Discourse.container +4 -0
  30. data/Plugins/Apps/Discourse/Discourse.lmm.rb +116 -55
  31. data/Plugins/Apps/Dovecot/Dovecot.lmm.rb +74 -62
  32. data/Plugins/Apps/ERPNext/ERPNext-Frontend.container +6 -1
  33. data/Plugins/Apps/ERPNext/ERPNext-Queue.container +5 -0
  34. data/Plugins/Apps/ERPNext/ERPNext-Scheduler.container +5 -0
  35. data/Plugins/Apps/ERPNext/ERPNext-Websocket.container +6 -1
  36. data/Plugins/Apps/ERPNext/ERPNext.container +6 -1
  37. data/Plugins/Apps/ERPNext/ERPNext.lmm.rb +138 -127
  38. data/Plugins/Apps/GitLab/GitLab.container +6 -0
  39. data/Plugins/Apps/GitLab/GitLab.lmm.rb +43 -49
  40. data/Plugins/Apps/Homepage/Homepage.conf.erb +86 -0
  41. data/Plugins/Apps/Homepage/Homepage.container +19 -0
  42. data/Plugins/Apps/Homepage/Homepage.lmm.rb +54 -0
  43. data/Plugins/Apps/IPFS/IPFS.conf.erb +0 -3
  44. data/Plugins/Apps/IPFS/IPFS.lmm.rb +0 -1
  45. data/Plugins/Apps/InfluxDB/InfluxDB.conf.erb +0 -3
  46. data/Plugins/Apps/InfluxDB/InfluxDB.lmm.rb +0 -1
  47. data/Plugins/Apps/Jackett/Jackett.conf.erb +0 -3
  48. data/Plugins/Apps/Jackett/Jackett.lmm.rb +0 -1
  49. data/Plugins/Apps/Jellyfin/Jellyfin.conf.erb +0 -3
  50. data/Plugins/Apps/Jellyfin/Jellyfin.lmm.rb +0 -1
  51. data/Plugins/Apps/LetsEncrypt/LetsEncrypt.lmm.rb +49 -28
  52. data/Plugins/Apps/LibreTranslate/LibreTranslate.container +21 -0
  53. data/Plugins/Apps/LibreTranslate/LibreTranslate.lmm.rb +34 -0
  54. data/Plugins/Apps/Lobsters/Containerfile +81 -0
  55. data/Plugins/Apps/Lobsters/Lobsters-Tasks.container +26 -0
  56. data/Plugins/Apps/Lobsters/Lobsters.conf.erb +99 -0
  57. data/Plugins/Apps/Lobsters/Lobsters.container +27 -0
  58. data/Plugins/Apps/Lobsters/Lobsters.lmm.rb +196 -0
  59. data/Plugins/Apps/Lobsters/crontab +3 -0
  60. data/Plugins/Apps/Lobsters/database.yml +26 -0
  61. data/Plugins/Apps/Lobsters/entrypoint.sh +30 -0
  62. data/Plugins/Apps/Lobsters/generateCredentials.rb +19 -0
  63. data/Plugins/Apps/Lobsters/lobsters-cron.sh +25 -0
  64. data/Plugins/Apps/Lobsters/lobsters-daily.sh +23 -0
  65. data/Plugins/Apps/Lobsters/puma.rb +49 -0
  66. data/Plugins/Apps/MariaDB/Connection.rb +55 -0
  67. data/Plugins/Apps/MariaDB/MariaDB.lmm.rb +60 -53
  68. data/Plugins/Apps/Mastodon/Mastodon-Sidekiq.container +22 -0
  69. data/Plugins/Apps/Mastodon/Mastodon-Streaming.container +20 -0
  70. data/Plugins/Apps/Mastodon/Mastodon.conf.erb +34 -45
  71. data/Plugins/Apps/Mastodon/Mastodon.container +28 -0
  72. data/Plugins/Apps/Mastodon/Mastodon.lmm.rb +240 -5
  73. data/Plugins/Apps/Mastodon/configlmm.rake +30 -0
  74. data/Plugins/Apps/Mastodon/entrypoint.sh +16 -0
  75. data/Plugins/Apps/Matrix/Element.container +5 -0
  76. data/Plugins/Apps/Matrix/Matrix.conf.erb +2 -8
  77. data/Plugins/Apps/Matrix/Matrix.lmm.rb +100 -71
  78. data/Plugins/Apps/Matrix/Synapse.container +5 -0
  79. data/Plugins/Apps/Netdata/Netdata.conf.erb +0 -3
  80. data/Plugins/Apps/Netdata/Netdata.lmm.rb +0 -1
  81. data/Plugins/Apps/Nextcloud/Nextcloud.conf.erb +3 -4
  82. data/Plugins/Apps/Nextcloud/Nextcloud.lmm.rb +150 -68
  83. data/Plugins/Apps/Nextcloud/autoconfig.php +13 -0
  84. data/Plugins/Apps/Nextcloud/config.php +10 -1
  85. data/Plugins/Apps/Nextcloud/nextcloudcron.service +8 -0
  86. data/Plugins/Apps/Nextcloud/nextcloudcron.timer +10 -0
  87. data/Plugins/Apps/Nginx/Connection.rb +93 -0
  88. data/Plugins/Apps/Nginx/conf.d/configlmm.conf +50 -9
  89. data/Plugins/Apps/Nginx/conf.d/languages.conf +21 -0
  90. data/Plugins/Apps/Nginx/config-lmm/errors.conf +25 -20
  91. data/Plugins/Apps/Nginx/config-lmm/gateway-errors.conf +20 -0
  92. data/Plugins/Apps/Nginx/config-lmm/proxy.conf +1 -1
  93. data/Plugins/Apps/Nginx/main.conf.erb +7 -3
  94. data/Plugins/Apps/Nginx/nginx.conf +2 -2
  95. data/Plugins/Apps/Nginx/nginx.lmm.rb +99 -81
  96. data/Plugins/Apps/Nginx/proxy.conf.erb +11 -3
  97. data/Plugins/Apps/Odoo/Odoo.conf.erb +0 -3
  98. data/Plugins/Apps/Odoo/Odoo.container +5 -0
  99. data/Plugins/Apps/Odoo/Odoo.lmm.rb +4 -5
  100. data/Plugins/Apps/Ollama/Ollama.container +26 -0
  101. data/Plugins/Apps/Ollama/Ollama.lmm.rb +73 -0
  102. data/Plugins/Apps/OpenTelemetry/Config/config.yaml +704 -0
  103. data/Plugins/Apps/OpenTelemetry/OpenTelemetry.lmm.rb +154 -0
  104. data/Plugins/Apps/OpenVidu/Ingress.container +5 -0
  105. data/Plugins/Apps/OpenVidu/OpenVidu.conf.erb +0 -3
  106. data/Plugins/Apps/OpenVidu/OpenVidu.container +5 -0
  107. data/Plugins/Apps/OpenVidu/OpenVidu.lmm.rb +7 -3
  108. data/Plugins/Apps/OpenVidu/OpenViduCall.conf.erb +0 -3
  109. data/Plugins/Apps/OpenVidu/OpenViduCall.container +5 -0
  110. data/Plugins/Apps/PHP-FPM/Connection.rb +91 -0
  111. data/Plugins/Apps/PHP-FPM/PHP-FPM.lmm.rb +31 -4
  112. data/Plugins/Apps/Peppermint/Peppermint.conf.erb +2 -5
  113. data/Plugins/Apps/Peppermint/Peppermint.container +5 -0
  114. data/Plugins/Apps/Peppermint/Peppermint.lmm.rb +29 -33
  115. data/Plugins/Apps/Perplexica/Perplexica.container +25 -0
  116. data/Plugins/Apps/Perplexica/Perplexica.lmm.rb +92 -0
  117. data/Plugins/Apps/Perplexica/config.toml +26 -0
  118. data/Plugins/Apps/Podman/Connection.rb +24 -0
  119. data/Plugins/Apps/Podman/Podman.lmm.rb +80 -0
  120. data/Plugins/Apps/Podman/storage.conf +6 -0
  121. data/Plugins/Apps/Postfix/Postfix.lmm.rb +242 -164
  122. data/Plugins/Apps/PostgreSQL/Connection.rb +97 -0
  123. data/Plugins/Apps/PostgreSQL/PostgreSQL.lmm.rb +184 -148
  124. data/Plugins/Apps/Pterodactyl/Pterodactyl.conf.erb +0 -3
  125. data/Plugins/Apps/Pterodactyl/Pterodactyl.lmm.rb +0 -2
  126. data/Plugins/Apps/Pterodactyl/Wings.conf.erb +0 -3
  127. data/Plugins/Apps/RVM/RVM.lmm.rb +57 -0
  128. data/Plugins/Apps/Roundcube/Roundcube.conf.erb +0 -3
  129. data/Plugins/Apps/Roundcube/Roundcube.lmm.rb +15 -19
  130. data/Plugins/Apps/SSH/SSH.lmm.rb +9 -15
  131. data/Plugins/Apps/SearXNG/SearXNG.container +22 -0
  132. data/Plugins/Apps/SearXNG/SearXNG.lmm.rb +79 -0
  133. data/Plugins/Apps/SearXNG/limiter.toml +40 -0
  134. data/Plugins/Apps/SearXNG/settings.yml +2 -0
  135. data/Plugins/Apps/SigNoz/Config/alerts.yml +11 -0
  136. data/Plugins/Apps/SigNoz/Config/otel-collector-config.yaml +110 -0
  137. data/Plugins/Apps/SigNoz/Config/otel-collector-opamp-config.yaml +1 -0
  138. data/Plugins/Apps/SigNoz/Config/prometheus.yml +18 -0
  139. data/Plugins/Apps/SigNoz/SigNoz-Collector.container +23 -0
  140. data/Plugins/Apps/SigNoz/SigNoz-Migrator.container +17 -0
  141. data/Plugins/Apps/SigNoz/SigNoz.conf.erb +61 -0
  142. data/Plugins/Apps/SigNoz/SigNoz.container +26 -0
  143. data/Plugins/Apps/SigNoz/SigNoz.lmm.rb +319 -0
  144. data/Plugins/Apps/Solr/log4j2.xml +89 -0
  145. data/Plugins/Apps/Solr/solr.lmm.rb +82 -0
  146. data/Plugins/Apps/Sunshine/Sunshine.conf.erb +0 -3
  147. data/Plugins/Apps/Sunshine/Sunshine.lmm.rb +0 -1
  148. data/Plugins/Apps/Tunnel/tunnel.lmm.rb +33 -37
  149. data/Plugins/Apps/UVdesk/UVdesk.conf.erb +0 -3
  150. data/Plugins/Apps/Umami/Umami.container +19 -0
  151. data/Plugins/Apps/Umami/Umami.lmm.rb +108 -0
  152. data/Plugins/Apps/Valkey/Valkey.lmm.rb +54 -42
  153. data/Plugins/Apps/Vaultwarden/Vaultwarden.conf.erb +9 -6
  154. data/Plugins/Apps/Vaultwarden/Vaultwarden.container +7 -1
  155. data/Plugins/Apps/Vaultwarden/Vaultwarden.lmm.rb +64 -29
  156. data/Plugins/Apps/Wiki.js/Wiki.js.conf.erb +1 -4
  157. data/Plugins/Apps/Wiki.js/Wiki.js.container +5 -0
  158. data/Plugins/Apps/Wiki.js/Wiki.js.lmm.rb +31 -37
  159. data/Plugins/Apps/YaCy/YaCy.conf.erb +93 -0
  160. data/Plugins/Apps/YaCy/YaCy.container +21 -0
  161. data/Plugins/Apps/YaCy/YaCy.lmm.rb +160 -0
  162. data/Plugins/Apps/ZooKeeper/ZooKeeper.container +24 -0
  163. data/Plugins/Apps/ZooKeeper/ZooKeeper.lmm.rb +68 -0
  164. data/Plugins/Apps/bitmagnet/bitmagnet.conf.erb +0 -3
  165. data/Plugins/Apps/bitmagnet/bitmagnet.lmm.rb +0 -1
  166. data/Plugins/Apps/gollum/gollum.conf.erb +2 -4
  167. data/Plugins/Apps/gollum/gollum.container +6 -0
  168. data/Plugins/Apps/gollum/gollum.lmm.rb +51 -50
  169. data/Plugins/Apps/llama.cpp/llama.cpp.container +28 -0
  170. data/Plugins/Apps/llama.cpp/llama.cpp.lmm.rb +90 -0
  171. data/Plugins/Apps/vLLM/vLLM.container +32 -0
  172. data/Plugins/Apps/vLLM/vLLM.lmm.rb +89 -0
  173. data/Plugins/OS/General/Utils.lmm.rb +26 -0
  174. data/Plugins/OS/Linux/Connection.rb +472 -0
  175. data/Plugins/OS/Linux/Debian/preseed.cfg.erb +25 -6
  176. data/Plugins/OS/Linux/Flavours.yaml +13 -0
  177. data/Plugins/OS/Linux/Grub/grub.cfg +10 -0
  178. data/Plugins/OS/Linux/HTTP.rb +32 -0
  179. data/Plugins/OS/Linux/Linux.lmm.rb +533 -187
  180. data/Plugins/OS/Linux/Packages.yaml +20 -1
  181. data/Plugins/OS/Linux/Services.yaml +8 -0
  182. data/Plugins/OS/Linux/Shell.rb +70 -0
  183. data/Plugins/OS/Linux/Syslinux/default +8 -0
  184. data/Plugins/OS/Linux/WireGuard/WireGuard.lmm.rb +83 -59
  185. data/Plugins/OS/Linux/WireGuard/wg0.conf.erb +3 -0
  186. data/Plugins/OS/Linux/openSUSE/autoinst.xml.erb +29 -3
  187. data/Plugins/OS/Linux/systemd/systemd.lmm.rb +13 -11
  188. data/Plugins/OS/Routers/Aruba/ArubaInstant.lmm.rb +6 -5
  189. data/Plugins/Platforms/GitHub.lmm.rb +73 -28
  190. data/Plugins/Platforms/GoDaddy/GoDaddy.lmm.rb +9 -6
  191. data/Plugins/Platforms/Proxmox/Proxmox.lmm.rb +402 -0
  192. data/Plugins/Platforms/Proxmox/XTerm.rb +321 -0
  193. data/Plugins/Platforms/libvirt/libvirt.lmm.rb +38 -13
  194. data/Plugins/Platforms/porkbun.lmm.rb +12 -2
  195. data/Plugins/Platforms/porkbun_spec.rb +2 -2
  196. data/Plugins/Services/DNS/AmberBit.lmm.rb +1 -1
  197. data/Plugins/Services/DNS/ArubaItDNS.lmm.rb +1 -1
  198. data/Plugins/Services/DNS/NICLV.lmm.rb +1 -1
  199. data/Plugins/Services/DNS/PowerDNS.lmm.rb +70 -68
  200. data/Plugins/Services/DNS/tonic.lmm.rb +22 -12
  201. data/lib/ConfigLMM/Framework/plugins/dns.rb +4 -3
  202. data/lib/ConfigLMM/Framework/plugins/linuxApp.rb +145 -184
  203. data/lib/ConfigLMM/Framework/plugins/nginxApp.rb +34 -17
  204. data/lib/ConfigLMM/Framework/plugins/plugin.rb +53 -181
  205. data/lib/ConfigLMM/Framework/plugins/store.rb +4 -4
  206. data/lib/ConfigLMM/Framework/variables.rb +75 -0
  207. data/lib/ConfigLMM/Framework.rb +1 -0
  208. data/lib/ConfigLMM/cli.rb +12 -6
  209. data/lib/ConfigLMM/commands/configsCommand.rb +37 -6
  210. data/lib/ConfigLMM/commands/diff.rb +33 -9
  211. data/lib/ConfigLMM/context.rb +22 -3
  212. data/lib/ConfigLMM/io/configList.rb +82 -6
  213. data/lib/ConfigLMM/io/connection.rb +143 -0
  214. data/lib/ConfigLMM/io/dhcp.rb +330 -0
  215. data/lib/ConfigLMM/io/http.rb +78 -0
  216. data/lib/ConfigLMM/io/local.rb +207 -0
  217. data/lib/ConfigLMM/io/pxe.rb +92 -0
  218. data/lib/ConfigLMM/io/ssh.rb +156 -0
  219. data/lib/ConfigLMM/io/tftp.rb +105 -0
  220. data/lib/ConfigLMM/io.rb +2 -0
  221. data/lib/ConfigLMM/secrets/envStore.rb +39 -0
  222. data/lib/ConfigLMM/secrets/fileStore.rb +43 -0
  223. data/lib/ConfigLMM/state.rb +2 -1
  224. data/lib/ConfigLMM/version.rb +2 -1
  225. data/lib/ConfigLMM.rb +1 -0
  226. data/{Examples → scripts}/configlmmAuth.sh +7 -5
  227. metadata +205 -8
@@ -0,0 +1,704 @@
1
+
2
+ receiverTemplate:
3
+ filelog/nginx:
4
+ include: /var/log/nginx/access.json
5
+ storage: file_storage
6
+ attributes:
7
+ level: INFO2
8
+ resource:
9
+ service.name: nginx
10
+ operators:
11
+ - type: json_parser
12
+ timestamp:
13
+ parse_from: attributes.time
14
+ layout_type: epoch
15
+ layout: s.ms
16
+ - type: copy
17
+ from: attributes.scheme
18
+ to: resource['url.scheme']
19
+ - type: copy
20
+ from: attributes.host
21
+ to: resource['http.request.header.host']
22
+ - type: add
23
+ field: resource['url.domain']
24
+ value: EXPR(split(resource['http.request.header.host'], ':')[0])
25
+ - type: add
26
+ field: resource['url.port']
27
+ value: EXPR(get(split(resource['http.request.header.host'], ':'), 1))
28
+ - if: resource['url.port'] == nil and resource['url.scheme'] == 'http'
29
+ type: add
30
+ field: resource['url.port']
31
+ value: 80
32
+ - if: resource['url.port'] == nil and resource['url.scheme'] == 'https'
33
+ type: add
34
+ field: resource['url.port']
35
+ value: 443
36
+ - type: copy
37
+ from: attributes.uri
38
+ to: resource['url.path']
39
+ - type: add
40
+ field: resource['url.full']
41
+ value: EXPR(resource['url.scheme'] + '://' + resource['http.request.header.host'] + attributes.request_uri)
42
+ - type: copy
43
+ from: attributes.query_string
44
+ to: resource['url.query']
45
+ - type: copy
46
+ from: attributes.method
47
+ to: resource['http.request.method']
48
+ - type: copy
49
+ from: attributes.status
50
+ to: resource['http.response.status_code']
51
+ - type: copy
52
+ from: attributes.request_length
53
+ to: resource['http.request.size']
54
+ - type: copy
55
+ from: attributes.body_bytes_sent
56
+ to: resource['http.response.body.size']
57
+ - type: copy
58
+ from: attributes.bytes_sent
59
+ to: resource['http.response.size']
60
+ - type: copy
61
+ from: attributes.remote_addr
62
+ to: resource['client.address']
63
+ - type: copy
64
+ from: attributes.remote_addr
65
+ to: resource['network.peer.address']
66
+ - type: copy
67
+ from: attributes.remote_port
68
+ to: resource['client.port']
69
+ - type: copy
70
+ from: attributes.server_name
71
+ to: resource['server.address']
72
+ - type: copy
73
+ from: attributes.server_port
74
+ to: resource['server.port']
75
+ - type: add
76
+ field: resource['network.protocol.name']
77
+ value: EXPR(lower(split(attributes.server_protocol, '/')[0]))
78
+ - type: add
79
+ field: resource['network.protocol.version']
80
+ value: EXPR(split(attributes.server_protocol, '/')[1])
81
+ - type: copy
82
+ from: attributes.http_user_agent
83
+ to: resource['http.request.header.user-agent']
84
+ - type: copy
85
+ from: attributes.http_user_agent
86
+ to: resource['user_agent.original']
87
+ - type: copy
88
+ from: attributes.http_referer
89
+ to: resource['http.request.header.referer']
90
+ - type: copy
91
+ from: attributes.http_x_forwarded_for
92
+ to: resource['http.request.header.x-forwarded-for']
93
+ - type: copy
94
+ from: attributes.http_x_real_ip
95
+ to: resource['http.request.header.x-real-ip']
96
+ - type: copy
97
+ from: attributes.http_accept_language
98
+ to: resource['http.request.header.accept-language']
99
+ - type: copy
100
+ from: attributes.content_type
101
+ to: resource['http.response.header.content-type']
102
+ - type: copy
103
+ from: attributes.upstream_http_etag
104
+ to: resource['http.response.header.etag']
105
+ - type: copy
106
+ from: attributes.upstream_http_last_modified
107
+ to: resource['http.response.header.last-modified']
108
+ - type: copy
109
+ from: attributes.request
110
+ to: resource['log.message']
111
+ - type: severity_parser
112
+ parse_from: attributes.level
113
+ overwrite_text: true
114
+
115
+ filelog/php:
116
+ include: /var/log/php/*.log
117
+ storage: file_storage
118
+ resource:
119
+ service.name: php-fpm
120
+ operators:
121
+ - type: recombine
122
+ source_identifier: attributes['log.file.name']
123
+ combine_field: body
124
+ is_first_entry: body matches "^\\[\\d+\\-"
125
+ - type: regex_parser
126
+ regex: '^\[(?P<time>[\d\- :\w]+)\] PHP (?P<level>\w+)( error)?: (?P<message>(.+\n?)+)'
127
+ timestamp:
128
+ parse_from: attributes.time
129
+ layout_type: strptime
130
+ layout: "%d-%b-%Y %T %Z"
131
+ severity:
132
+ parse_from: attributes.level
133
+ - type: copy
134
+ from: attributes.message
135
+ to: resource['log.message']
136
+ - type: severity_parser
137
+ parse_from: attributes.level
138
+ overwrite_text: true
139
+
140
+ filelog/php_json:
141
+ include: /var/log/php/*.json
142
+ storage: file_storage
143
+ attributes:
144
+ level: INFO2
145
+ resource:
146
+ service.name: php-fpm
147
+ operators:
148
+ - type: json_parser
149
+ timestamp:
150
+ parse_from: attributes.time_iso8601
151
+ layout_type: strptime
152
+ layout: "%FT%T%z"
153
+ - type: copy
154
+ from: attributes.host
155
+ to: resource['http.request.header.host']
156
+ - type: add
157
+ field: resource['url.domain']
158
+ value: EXPR(split(resource['http.request.header.host'], ':')[0])
159
+ - type: add
160
+ field: resource['url.port']
161
+ value: EXPR(get(split(resource['http.request.header.host'], ':'), 1))
162
+ - type: copy
163
+ from: attributes.uri
164
+ to: resource['url.path']
165
+ - type: add
166
+ field: resource['url.full']
167
+ value: EXPR('//' + resource['http.request.header.host'] + attributes.request_uri)
168
+ - type: copy
169
+ from: attributes.query_string
170
+ to: resource['url.query']
171
+ - type: copy
172
+ from: attributes.method
173
+ to: resource['http.request.method']
174
+ - type: copy
175
+ from: attributes.status
176
+ to: resource['http.response.status_code']
177
+ - type: copy
178
+ from: attributes.body_bytes_sent
179
+ to: resource['http.response.body.size']
180
+ - if: attributes.remote_addr != '-'
181
+ type: copy
182
+ from: attributes.remote_addr
183
+ to: resource['client.address']
184
+ - if: attributes.remote_addr != '-'
185
+ type: copy
186
+ from: attributes.remote_addr
187
+ to: resource['network.peer.address']
188
+ - type: add
189
+ field: resource['network.protocol.name']
190
+ value: EXPR(lower(split(attributes.server_protocol, '/')[0]))
191
+ - type: add
192
+ field: resource['network.protocol.version']
193
+ value: EXPR(split(attributes.server_protocol, '/')[1])
194
+ - type: copy
195
+ from: attributes.http_user_agent
196
+ to: resource['http.request.header.user-agent']
197
+ - type: copy
198
+ from: attributes.http_user_agent
199
+ to: resource['user_agent.original']
200
+ - if: attributes.http_referer != '-'
201
+ type: copy
202
+ from: attributes.http_referer
203
+ to: resource['http.request.header.referer']
204
+ - if: attributes.http_x_forwarded_for != '-'
205
+ type: copy
206
+ from: attributes.http_x_forwarded_for
207
+ to: resource['http.request.header.x-forwarded-for']
208
+ - if: attributes.http_x_real_ip != '-'
209
+ type: copy
210
+ from: attributes.http_x_real_ip
211
+ to: resource['http.request.header.x-real-ip']
212
+ - if: attributes.http_accept_language != '-'
213
+ type: copy
214
+ from: attributes.http_accept_language
215
+ to: resource['http.request.header.accept-language']
216
+ - if: attributes.content_type != '-'
217
+ type: copy
218
+ from: attributes.content_type
219
+ to: resource['http.response.header.content-type']
220
+ - if: attributes.upstream_http_etag != '-'
221
+ type: copy
222
+ from: attributes.upstream_http_etag
223
+ to: resource['http.response.header.etag']
224
+ - if: attributes.upstream_http_last_modified != '-'
225
+ type: copy
226
+ from: attributes.upstream_http_last_modified
227
+ to: resource['http.response.header.last-modified']
228
+ - type: copy
229
+ from: attributes.request
230
+ to: resource['log.message']
231
+ - type: severity_parser
232
+ parse_from: attributes.level
233
+ overwrite_text: true
234
+
235
+ filelog/postgresql_json:
236
+ include: /var/log/postgresql/*.json
237
+ storage: file_storage
238
+ resource:
239
+ service.name: postgresql
240
+ operators:
241
+ - type: json_parser
242
+ timestamp:
243
+ parse_from: attributes.timestamp
244
+ layout_type: strptime
245
+ layout: "%F %T.%L %Z"
246
+ - type: copy
247
+ from: attributes.message
248
+ to: resource['log.message']
249
+ - if: attributes.pid != nil
250
+ type: copy
251
+ from: attributes.pid
252
+ to: resource['process.pid']
253
+ - type: severity_parser
254
+ parse_from: attributes.error_severity
255
+ overwrite_text: true
256
+ mapping:
257
+ debug: DEBUG
258
+ info: INFO
259
+ info2: LOG
260
+ info3: NOTICE
261
+ warn: WARNING
262
+ error: ERROR
263
+ fatal: FATAL
264
+ fatal2: PANIC
265
+
266
+ extensions:
267
+ health_check:
268
+ pprof:
269
+ endpoint: 127.0.0.1:1777
270
+ zpages:
271
+ endpoint: 127.0.0.1:55679
272
+ file_storage:
273
+ # directory: /var/lib/otelcol/file_storage
274
+
275
+ receivers:
276
+ journald:
277
+ storage: file_storage
278
+ all: true
279
+ operators:
280
+ # Redact secrets
281
+ - if: type(body.MESSAGE) == "string"
282
+ type: regex_replace
283
+ regex: "password=[^\\s&?\"{}]+"
284
+ replace_with: "password=<REDACTED>"
285
+ field: body.MESSAGE
286
+ - if: body._CMDLINE != nil
287
+ type: regex_replace
288
+ regex: "password=[^\\s&?\"{}]+"
289
+ replace_with: "password=<REDACTED>"
290
+ field: body._CMDLINE
291
+
292
+ # Systemd/Journald
293
+ - type: copy
294
+ from: body.SYSLOG_IDENTIFIER
295
+ to: resource['service.name']
296
+ - if: body.SYSLOG_PID != nil
297
+ type: copy
298
+ from: body.SYSLOG_PID
299
+ to: resource['service.instance.id']
300
+ - type: copy
301
+ from: body._MACHINE_ID
302
+ to: resource['host.id']
303
+ - type: copy
304
+ from: body.MESSAGE
305
+ to: resource['log.record.original']
306
+ - type: copy
307
+ from: body.MESSAGE
308
+ to: resource['log.message']
309
+ - if: body._COMM != nil
310
+ type: copy
311
+ from: body._COMM
312
+ to: resource['process.command']
313
+ - if: body._EXE != nil
314
+ type: copy
315
+ from: body._EXE
316
+ to: resource['process.executable.path']
317
+ - if: body._CMDLINE != nil
318
+ type: copy
319
+ from: body._CMDLINE
320
+ to: resource['process.command_line']
321
+ - if: body._PID != nil
322
+ type: copy
323
+ from: body._PID
324
+ to: resource['process.pid']
325
+ - if: body._UID != nil
326
+ type: copy
327
+ from: body._UID
328
+ to: resource['process.user.id']
329
+ - if: body._GID != nil
330
+ type: copy
331
+ from: body._GID
332
+ to: resource['process.group.id']
333
+ - if: body.CONTAINER_ID_FULL != nil
334
+ type: copy
335
+ from: body.CONTAINER_ID_FULL
336
+ to: resource['container.id']
337
+ - if: body.CONTAINER_NAME != nil
338
+ type: copy
339
+ from: body.CONTAINER_NAME
340
+ to: resource['container.name']
341
+ - if: body.CODE_FILE != nil
342
+ type: copy
343
+ from: body.CODE_FILE
344
+ to: resource['code.filepath']
345
+ - if: body.CODE_FUNC != nil
346
+ type: copy
347
+ from: body.CODE_FUNC
348
+ to: resource['code.function']
349
+ - if: body.CODE_LINE != nil
350
+ type: copy
351
+ from: body.CODE_LINE
352
+ to: resource['code.lineno']
353
+ - if: type(body.MESSAGE) == "string" && body.MESSAGE[0:1] == '{'
354
+ type: json_parser
355
+ parse_from: body.MESSAGE
356
+ parse_to: body.info
357
+ - type: severity_parser
358
+ parse_from: body.PRIORITY
359
+ overwrite_text: true
360
+ mapping:
361
+ fatal3: 0
362
+ fatal2: 1
363
+ fatal: 2
364
+ error: 3
365
+ warn: 4
366
+ info3: 5
367
+ info: 6
368
+ debug: 7
369
+
370
+ # Nginx error log
371
+ - if: 'type(body.MESSAGE) == "string" && body.MESSAGE matches "^[\\d+/ :]+ \\[\\w+\\] \\d+#\\d+: "'
372
+ type: regex_parser
373
+ parse_from: body.MESSAGE
374
+ parse_to: body.info
375
+ regex: '^(?P<local_time>[\d+/ :]+) \[(?P<level>\w+)\] (?P<PID>\d+)#(?P<TID>\d+): (\*(?P<CID>\d+) )?(?P<message>.+?)(, client: (?P<remote_addr>.+), server: (?P<server_name>.+), request: "(?P<request>[^"]+)"(, upstream: "(?P<upstream>[^"]+)")?, host: "(?P<host>[^"]+)"(, referrer: "(?P<referrer>[^"]+)"?)?)?$'
376
+ - if: body.info != nil and body.info.remote_addr != nil and len(body.info.remote_addr) == 0
377
+ type: remove
378
+ field: body.info.remote_addr
379
+ - if: body.info != nil and body.info.server_name != nil and len(body.info.server_name) == 0
380
+ type: remove
381
+ field: body.info.server_name
382
+ - if: body.info != nil and body.info.request != nil and len(body.info.request) == 0
383
+ type: remove
384
+ field: body.info.request
385
+ - if: body.info != nil and body.info.upstream != nil and len(body.info.upstream) == 0
386
+ type: remove
387
+ field: body.info.upstream
388
+ - if: body.info != nil and body.info.host != nil and len(body.info.host) == 0
389
+ type: remove
390
+ field: body.info.host
391
+ - if: body.info != nil and body.info.referrer != nil and len(body.info.referrer) == 0
392
+ type: remove
393
+ field: body.info.referrer
394
+ - if: body.info != nil and body.info.request != nil
395
+ type: regex_parser
396
+ parse_from: body.info.request
397
+ parse_to: body.info
398
+ regex: ^(?<method>\w+) (?<uri>.+) (?<server_protocol>[\w/\.]+)$
399
+
400
+ # Nginx access log
401
+ - if: body.info != nil and body.info.scheme != nil
402
+ type: copy
403
+ from: body.info.scheme
404
+ to: resource['url.scheme']
405
+ - if: body.info != nil and body.info.host != nil
406
+ type: copy
407
+ from: body.info.host
408
+ to: resource['http.request.header.host']
409
+ - if: resource['http.request.header.host'] != nil
410
+ type: add
411
+ field: resource['url.domain']
412
+ value: EXPR(split(resource['http.request.header.host'], ':')[0])
413
+ - if: resource['http.request.header.host'] != nil
414
+ type: add
415
+ field: resource['url.port']
416
+ value: EXPR(get(split(resource['http.request.header.host'], ':'), 1))
417
+ - if: resource['url.port'] == nil and resource['url.scheme'] == 'http'
418
+ type: add
419
+ field: resource['url.port']
420
+ value: 80
421
+ - if: resource['url.port'] == nil and resource['url.scheme'] == 'https'
422
+ type: add
423
+ field: resource['url.port']
424
+ value: 443
425
+ - if: body.info != nil and body.info.uri != nil
426
+ type: copy
427
+ from: body.info.uri
428
+ to: resource['url.path']
429
+ - if: body.info != nil and body.info.request_uri != nil
430
+ type: add
431
+ field: resource['url.full']
432
+ value: EXPR(resource['url.scheme'] + '://' + resource['http.request.header.host'] + body.info.request_uri)
433
+ - if: body.info != nil and body.info.query_string != nil
434
+ type: copy
435
+ from: body.info.query_string
436
+ to: resource['url.query']
437
+ - if: body.info != nil and body.info.method != nil
438
+ type: copy
439
+ from: body.info.method
440
+ to: resource['http.request.method']
441
+ - if: body.info != nil and body.info.status != nil
442
+ type: copy
443
+ from: body.info.status
444
+ to: resource['http.response.status_code']
445
+ - if: body.info != nil and body.info.request_length != nil
446
+ type: copy
447
+ from: body.info.request_length
448
+ to: resource['http.request.size']
449
+ - if: body.info != nil and body.info.body_bytes_sent != nil
450
+ type: copy
451
+ from: body.info.body_bytes_sent
452
+ to: resource['http.response.body.size']
453
+ - if: body.info != nil and body.info.bytes_sent != nil
454
+ type: copy
455
+ from: body.info.bytes_sent
456
+ to: resource['http.response.size']
457
+ - if: body.info != nil and body.info.remote_addr != nil
458
+ type: copy
459
+ from: body.info.remote_addr
460
+ to: resource['client.address']
461
+ - if: body.info != nil and body.info.remote_addr != nil
462
+ type: copy
463
+ from: body.info.remote_addr
464
+ to: resource['network.peer.address']
465
+ - if: body.info != nil and body.info.remote_port != nil
466
+ type: copy
467
+ from: body.info.remote_port
468
+ to: resource['client.port']
469
+ - if: body.info != nil and body.info.server_name != nil
470
+ type: copy
471
+ from: body.info.server_name
472
+ to: resource['server.address']
473
+ - if: body.info != nil and body.info.server_port != nil
474
+ type: copy
475
+ from: body.info.server_port
476
+ to: resource['server.port']
477
+ - if: body.info != nil and body.info.server_protocol != nil
478
+ type: add
479
+ field: resource['network.protocol.name']
480
+ value: EXPR(lower(split(body.info.server_protocol, '/')[0]))
481
+ - if: body.info != nil and body.info.server_protocol != nil
482
+ type: add
483
+ field: resource['network.protocol.version']
484
+ value: EXPR(split(body.info.server_protocol, '/')[1])
485
+ - if: body.info != nil and body.info.http_user_agent != nil
486
+ type: copy
487
+ from: body.info.http_user_agent
488
+ to: resource['http.request.header.user-agent']
489
+ - if: body.info != nil and body.info.http_user_agent != nil
490
+ type: copy
491
+ from: body.info.http_user_agent
492
+ to: resource['user_agent.original']
493
+ - if: body.info != nil and body.info.http_referer != nil
494
+ type: copy
495
+ from: body.info.http_referer
496
+ to: resource['http.request.header.referer']
497
+ - if: body.info != nil and body.info.http_x_forwarded_for != nil
498
+ type: copy
499
+ from: body.info.http_x_forwarded_for
500
+ to: resource['http.request.header.x-forwarded-for']
501
+ - if: body.info != nil and body.info.http_x_real_ip != nil
502
+ type: copy
503
+ from: body.info.http_x_real_ip
504
+ to: resource['http.request.header.x-real-ip']
505
+ - if: body.info != nil and body.info.http_accept_language != nil
506
+ type: copy
507
+ from: body.info.http_accept_language
508
+ to: resource['http.request.header.accept-language']
509
+ - if: body.info != nil and body.info.content_type != nil
510
+ type: copy
511
+ from: body.info.content_type
512
+ to: resource['http.response.header.content-type']
513
+ - if: body.info != nil and body.info.upstream_http_etag != nil
514
+ type: copy
515
+ from: body.info.upstream_http_etag
516
+ to: resource['http.response.header.etag']
517
+ - if: body.info != nil and body.info.upstream_http_last_modified != nil
518
+ type: copy
519
+ from: body.info.upstream_http_last_modified
520
+ to: resource['http.response.header.last-modified']
521
+ - if: body.info != nil and body.info.request != nil
522
+ type: copy
523
+ from: body.info.request
524
+ to: resource['log.message']
525
+ - if: body.info != nil and body.info.level == nil
526
+ type: add
527
+ field: body.info.level
528
+ value: info2
529
+
530
+ # SigNoz
531
+ - if: 'type(body.MESSAGE) == "string" && body.MESSAGE matches "^ts=[\\dT:\\.Z\\-]+ caller="'
532
+ type: regex_parser
533
+ parse_from: body.MESSAGE
534
+ parse_to: body.info
535
+ regex: '^ts=(?P<local_time>[\dT:\.Z\-]+) caller=(?P<caller>[\w\.:]+) level=(?P<level>\w+)( component=(?P<component>\w+))?( msg="(?P<msg>.+)")?'
536
+ - if: body.info != nil and body.info.func_name != nil
537
+ type: copy
538
+ from: body.info.func_name
539
+ to: resource['code.function']
540
+ - if: body.info != nil and body.info.stacktrace != nil
541
+ type: copy
542
+ from: body.info.stacktrace
543
+ to: resource['exception.stacktrace']
544
+
545
+ # Otel
546
+ - if: body.info != nil and body.info.msg != nil
547
+ type: add
548
+ field: resource['log.message']
549
+ value: EXPR(body.info.msg)
550
+ - if: body.info != nil and body.info.msg != nil and body.info.error != nil
551
+ type: add
552
+ field: resource['log.message']
553
+ value: EXPR(body.info.msg + ' - ' + body.info.error)
554
+ - if: body.info != nil and body.info.component != nil
555
+ type: copy
556
+ from: body.info.component
557
+ to: resource['code.function']
558
+ - if: body.info != nil and body.info.caller != nil
559
+ type: add
560
+ field: resource['code.filepath']
561
+ value: EXPR(split(body.info.caller, ':')[0])
562
+ - if: body.info != nil and body.info.caller != nil
563
+ type: add
564
+ field: resource['code.lineno']
565
+ value: EXPR(split(body.info.caller, ':')[1])
566
+
567
+ # ClickHouse
568
+ - if: body.info != nil and body.info.message != nil
569
+ type: add
570
+ field: resource['log.message']
571
+ value: EXPR(body.info.message)
572
+ - if: body.info != nil and body.info.source_file != nil
573
+ type: add
574
+ field: resource['code.filepath']
575
+ value: EXPR(split(body.info.source_file, ';')[0])
576
+ - if: body.info != nil and body.info.source_line != nil
577
+ type: add
578
+ field: resource['code.lineno']
579
+ value: EXPR(body.info.source_line)
580
+ - if: body.info != nil and body.info.thread_name != nil
581
+ type: copy
582
+ from: body.info.thread_name
583
+ to: resource['thread.name']
584
+ - if: body.info != nil and body.info.thread_id != nil
585
+ type: copy
586
+ from: body.info.thread_id
587
+ to: resource['thread.id']
588
+
589
+ - if: body.info != nil and body.info.level != nil
590
+ type: regex_replace
591
+ regex_name: ansi_control_sequences
592
+ field: body.info.level
593
+ - if: body.info != nil and body.info.level != nil
594
+ type: severity_parser
595
+ parse_from: body.info.level
596
+ overwrite_text: true
597
+ mapping:
598
+ info:
599
+ - Information
600
+ - INFO
601
+ warn: WARN
602
+ error: ERROR
603
+ fatal: FATAL
604
+
605
+ hostmetrics:
606
+ collection_interval: 30s
607
+ scrapers:
608
+ cpu: {}
609
+ load: {}
610
+ memory: {}
611
+ disk: {}
612
+ filesystem: {}
613
+ network: {}
614
+ paging: {}
615
+ processes: {}
616
+
617
+ # Collect own metrics
618
+ prometheus:
619
+ config:
620
+ scrape_configs:
621
+ - job_name: 'otel-collector'
622
+ scrape_interval: 10s
623
+ static_configs:
624
+ - targets: ['127.0.0.1:8888']
625
+
626
+ jaeger:
627
+ protocols:
628
+ grpc:
629
+ endpoint: 127.0.0.1:14250
630
+ thrift_binary:
631
+ endpoint: 127.0.0.1:6832
632
+ thrift_compact:
633
+ endpoint: 127.0.0.1:6831
634
+ thrift_http:
635
+ endpoint: 127.0.0.1:14268
636
+
637
+ zipkin:
638
+ endpoint: 127.0.0.1:9411
639
+
640
+ processors:
641
+ batch:
642
+ timeout: 10s
643
+ resource:
644
+ attributes:
645
+ - key: deployment.environment.name
646
+ value: production
647
+ action: upsert
648
+ - key: deployment.environment
649
+ value: production
650
+ action: upsert
651
+ resourcedetection:
652
+ # Using OTEL_RESOURCE_ATTRIBUTES envvar, env detector adds custom labels.
653
+ detectors: [env, system] # include ec2 for AWS, gcp for GCP and azure for Azure.
654
+ timeout: 2s
655
+ # transform:
656
+ # error_mode: ignore
657
+ # log_statements:
658
+ # - context: log
659
+ # statements:
660
+
661
+ exporters:
662
+ otlp:
663
+ endpoint: $OTLP_RECEIVER:4317
664
+ retry_on_failure:
665
+ max_interval: 10m
666
+ max_elapsed_time: 3h
667
+ sending_queue:
668
+ storage: file_storage
669
+ queue_size: 10000
670
+
671
+ service:
672
+ telemetry:
673
+ logs:
674
+ encoding: json
675
+ metrics:
676
+ readers:
677
+ - pull:
678
+ exporter:
679
+ prometheus:
680
+ host: 127.0.0.1
681
+ port: 8888
682
+
683
+ pipelines:
684
+
685
+ traces:
686
+ receivers: [jaeger, zipkin]
687
+ processors: [resource, resourcedetection, batch]
688
+ exporters: [otlp]
689
+
690
+ metrics:
691
+ receivers: [prometheus, hostmetrics]
692
+ processors: [resource, resourcedetection, batch]
693
+ exporters: [otlp]
694
+
695
+ logs:
696
+ receivers: [journald]
697
+ processors: [resource, resourcedetection, batch]
698
+ exporters: [otlp]
699
+
700
+ extensions:
701
+ - health_check
702
+ - pprof
703
+ - zpages
704
+ - file_storage