LogstashUI 0.5.5.dev0__py3-none-any.whl

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 (762) hide show
  1. AI/__init__.py +0 -0
  2. AI/integration_factory.py +1392 -0
  3. AI/migrations/0001_initial.py +58 -0
  4. AI/migrations/0002_draftdefinition_normalizers.py +23 -0
  5. AI/migrations/0003_delete_aisettings_delete_draftdefinition.py +19 -0
  6. AI/migrations/__init__.py +0 -0
  7. AI/models.py +5 -0
  8. AI/static/js/integration_factory.js +1102 -0
  9. AI/system_prompts/dashboard_generator.md +367 -0
  10. AI/system_prompts/grok_patterns.txt +95 -0
  11. AI/system_prompts/ingest_pipeline_generator.md +331 -0
  12. AI/system_prompts/ingest_pipeline_processors.json +2851 -0
  13. AI/system_prompts/ingest_verifier.md +84 -0
  14. AI/system_prompts/integrations_list.json +2690 -0
  15. AI/system_prompts/log_classifier.md +134 -0
  16. AI/system_prompts/template_creator.md +123 -0
  17. AI/templates/integration_factory.html +200 -0
  18. AI/urls.py +16 -0
  19. AI/views.py +20 -0
  20. API/__init__.py +0 -0
  21. API/admin.py +7 -0
  22. API/api.http +784 -0
  23. API/apps.py +9 -0
  24. API/auth.py +101 -0
  25. API/connections_views.py +312 -0
  26. API/guides.py +88 -0
  27. API/mcp/__init__.py +5 -0
  28. API/mcp/dispatch.py +179 -0
  29. API/mcp/tools.py +890 -0
  30. API/mcp/views.py +215 -0
  31. API/migrations/__init__.py +0 -0
  32. API/models.py +7 -0
  33. API/pipelines_views.py +1224 -0
  34. API/policies_views.py +1015 -0
  35. API/security_views.py +488 -0
  36. API/simulation_detail.py +219 -0
  37. API/snmp_views.py +1539 -0
  38. API/urls.py +81 -0
  39. Common/__init__.py +0 -0
  40. Common/ai/agent_builder.py +690 -0
  41. Common/context_processors.py +49 -0
  42. Common/decorators.py +68 -0
  43. Common/elastic_utils.py +1154 -0
  44. Common/encryption.py +271 -0
  45. Common/error_handlers.py +65 -0
  46. Common/formatters.py +106 -0
  47. Common/logstash_config_parse.py +1469 -0
  48. Common/logstash_utils.py +34 -0
  49. Common/middleware.py +216 -0
  50. Common/product_ca.py +1124 -0
  51. Common/validators.py +66 -0
  52. Documentation/__init__.py +0 -0
  53. Documentation/admin.py +7 -0
  54. Documentation/apps.py +9 -0
  55. Documentation/content/CHANGELOG.md +890 -0
  56. Documentation/content/docs/getting_started.md +92 -0
  57. Documentation/content/docs/index.md +124 -0
  58. Documentation/content/docs/logstashagent/configuration/index.md +60 -0
  59. Documentation/content/docs/logstashagent/configuration/logstashagent.yml.md +141 -0
  60. Documentation/content/docs/logstashagent/general/build.md +217 -0
  61. Documentation/content/docs/logstashagent/general/index.md +38 -0
  62. Documentation/content/docs/logstashagent/general/roles.md +267 -0
  63. Documentation/content/docs/logstashagent/index.md +264 -0
  64. Documentation/content/docs/logstashui/SNMP/Quickstart.md +94 -0
  65. Documentation/content/docs/logstashui/SNMP/architecture.md +64 -0
  66. Documentation/content/docs/logstashui/SNMP/configuration.md +147 -0
  67. Documentation/content/docs/logstashui/SNMP/data_overview.md +59 -0
  68. Documentation/content/docs/logstashui/SNMP/deploying_changes.md +71 -0
  69. Documentation/content/docs/logstashui/SNMP/device_support.md +39 -0
  70. Documentation/content/docs/logstashui/SNMP/discovery.md +48 -0
  71. Documentation/content/docs/logstashui/SNMP/index.md +58 -0
  72. Documentation/content/docs/logstashui/SNMP/pipeline_generation.md +63 -0
  73. Documentation/content/docs/logstashui/SNMP/schema.md +595 -0
  74. Documentation/content/docs/logstashui/SNMP/testing.md +47 -0
  75. Documentation/content/docs/logstashui/SNMP/traps.md +45 -0
  76. Documentation/content/docs/logstashui/SNMP/tsds_implementation.md +82 -0
  77. Documentation/content/docs/logstashui/agent_guides/concepts.md +25 -0
  78. Documentation/content/docs/logstashui/agent_guides/deploy.md +30 -0
  79. Documentation/content/docs/logstashui/agent_guides/pipeline-review.md +24 -0
  80. Documentation/content/docs/logstashui/agent_guides/simulation.md +55 -0
  81. Documentation/content/docs/logstashui/agent_guides/snmp.md +57 -0
  82. Documentation/content/docs/logstashui/agent_guides/troubleshooting.md +21 -0
  83. Documentation/content/docs/logstashui/architecture.md +11 -0
  84. Documentation/content/docs/logstashui/compatibility.md +58 -0
  85. Documentation/content/docs/logstashui/configuration/environment.md +193 -0
  86. Documentation/content/docs/logstashui/configuration/host_mode.md +94 -0
  87. Documentation/content/docs/logstashui/configuration/index.md +72 -0
  88. Documentation/content/docs/logstashui/configuration/logstash_proxy.md +138 -0
  89. Documentation/content/docs/logstashui/configuration/logstashui.yml.md +16 -0
  90. Documentation/content/docs/logstashui/configuration/simulation.md +84 -0
  91. Documentation/content/docs/logstashui/database/examples/README.md +15 -0
  92. Documentation/content/docs/logstashui/database/examples/create-mariadb.sql +13 -0
  93. Documentation/content/docs/logstashui/database/examples/create-mysql.sql +12 -0
  94. Documentation/content/docs/logstashui/database/examples/create-postgresql.sql +13 -0
  95. Documentation/content/docs/logstashui/database/examples/schema-mysql.sql +502 -0
  96. Documentation/content/docs/logstashui/database/examples/schema-postgresql.sql +1709 -0
  97. Documentation/content/docs/logstashui/database/index.md +79 -0
  98. Documentation/content/docs/logstashui/database/migration.md +75 -0
  99. Documentation/content/docs/logstashui/general/build.md +154 -0
  100. Documentation/content/docs/logstashui/general/deploy.md +122 -0
  101. Documentation/content/docs/logstashui/general/deployment-recs.md +32 -0
  102. Documentation/content/docs/logstashui/general/index.md +62 -0
  103. Documentation/content/docs/logstashui/general/offline.md +68 -0
  104. Documentation/content/docs/logstashui/general/updating.md +50 -0
  105. Documentation/content/docs/logstashui/index.md +90 -0
  106. Documentation/content/docs/logstashui/kubernetes/cnpg.md +98 -0
  107. Documentation/content/docs/logstashui/kubernetes/envoy-gateway.md +112 -0
  108. Documentation/content/docs/logstashui/kubernetes/examples/README.md +46 -0
  109. Documentation/content/docs/logstashui/kubernetes/examples/embedded-agent.yaml +122 -0
  110. Documentation/content/docs/logstashui/kubernetes/examples/mysql/configmap.yaml +41 -0
  111. Documentation/content/docs/logstashui/kubernetes/examples/mysql/ingress.yaml +31 -0
  112. Documentation/content/docs/logstashui/kubernetes/examples/mysql/namespace.yaml +8 -0
  113. Documentation/content/docs/logstashui/kubernetes/examples/mysql/secret.yaml +19 -0
  114. Documentation/content/docs/logstashui/kubernetes/examples/mysql/statefulset.yaml +106 -0
  115. Documentation/content/docs/logstashui/kubernetes/examples/postgresql/cnpg.yaml +25 -0
  116. Documentation/content/docs/logstashui/kubernetes/examples/postgresql/configmap.yaml +42 -0
  117. Documentation/content/docs/logstashui/kubernetes/examples/postgresql/ingress.yaml +31 -0
  118. Documentation/content/docs/logstashui/kubernetes/examples/postgresql/namespace.yaml +8 -0
  119. Documentation/content/docs/logstashui/kubernetes/examples/postgresql/secret.yaml +19 -0
  120. Documentation/content/docs/logstashui/kubernetes/examples/postgresql/statefulset.yaml +106 -0
  121. Documentation/content/docs/logstashui/kubernetes/examples/sqlite/configmap.yaml +35 -0
  122. Documentation/content/docs/logstashui/kubernetes/examples/sqlite/ingress.yaml +31 -0
  123. Documentation/content/docs/logstashui/kubernetes/examples/sqlite/namespace.yaml +8 -0
  124. Documentation/content/docs/logstashui/kubernetes/examples/sqlite/secret.yaml +18 -0
  125. Documentation/content/docs/logstashui/kubernetes/examples/sqlite/statefulset.yaml +106 -0
  126. Documentation/content/docs/logstashui/kubernetes/index.md +121 -0
  127. Documentation/content/docs/logstashui/mcp.md +224 -0
  128. Documentation/content/docs/logstashui/mcp_scenarios.md +234 -0
  129. Documentation/content/docs/logstashui/rest_api.md +2783 -0
  130. Documentation/content/docs/logstashui/utilities/dissect_debugger.md +89 -0
  131. Documentation/content/docs/logstashui/utilities/grok_debugger.md +114 -0
  132. Documentation/content/docs/logstashui/utilities/index.md +40 -0
  133. Documentation/content/images/LogstashIcon.png +0 -0
  134. Documentation/content/images/architecture.png +0 -0
  135. Documentation/content/images/connection_manager.png +0 -0
  136. Documentation/content/images/control_plane.png +0 -0
  137. Documentation/content/images/graph.gif +0 -0
  138. Documentation/content/images/login.png +0 -0
  139. Documentation/content/images/monitoring.png +0 -0
  140. Documentation/content/images/new_connection.gif +0 -0
  141. Documentation/content/images/simulate.gif +0 -0
  142. Documentation/content/images/simulate.png +0 -0
  143. Documentation/content/images/snmp.gif +0 -0
  144. Documentation/content/images/snmp.png +0 -0
  145. Documentation/content/images/snmp_architecture.png +0 -0
  146. Documentation/migrations/__init__.py +0 -0
  147. Documentation/models.py +9 -0
  148. Documentation/static/css/markdown.css +250 -0
  149. Documentation/templates/documentation.html +225 -0
  150. Documentation/templates/nav_item.html +41 -0
  151. Documentation/urls.py +11 -0
  152. Documentation/views.py +442 -0
  153. LogstashUI/__init__.py +0 -0
  154. LogstashUI/__main__.py +10 -0
  155. LogstashUI/asgi.py +16 -0
  156. LogstashUI/cli.py +626 -0
  157. LogstashUI/config.py +116 -0
  158. LogstashUI/database.py +263 -0
  159. LogstashUI/insecure_http.py +117 -0
  160. LogstashUI/logging_config.py +99 -0
  161. LogstashUI/migrate_engine.py +282 -0
  162. LogstashUI/packaging/__init__.py +3 -0
  163. LogstashUI/packaging/logstashui.default +68 -0
  164. LogstashUI/packaging/logstashui.service.in +22 -0
  165. LogstashUI/paths.py +181 -0
  166. LogstashUI/settings.py +437 -0
  167. LogstashUI/telemetry.py +159 -0
  168. LogstashUI/urls.py +56 -0
  169. LogstashUI/wsgi.py +77 -0
  170. Management/__init__.py +0 -0
  171. Management/apps.py +10 -0
  172. Management/migrations/0001_initial.py +29 -0
  173. Management/migrations/0002_settings.py +25 -0
  174. Management/migrations/0003_settings_agent_ui_url.py +29 -0
  175. Management/migrations/0004_settings_logstash_artifact_base_url.py +29 -0
  176. Management/migrations/__init__.py +0 -0
  177. Management/models.py +92 -0
  178. Management/templates/api_tokens.html +214 -0
  179. Management/templates/components/api_token_created.html +38 -0
  180. Management/templates/components/api_token_row.html +84 -0
  181. Management/templates/components/logstash_artifact_row.html +100 -0
  182. Management/templates/components/logstash_artifact_tbody.html +26 -0
  183. Management/templates/components/user_row.html +67 -0
  184. Management/templates/logs.html +98 -0
  185. Management/templates/logstash_artifacts.html +172 -0
  186. Management/templates/management.html +80 -0
  187. Management/templates/management_settings.html +320 -0
  188. Management/templates/registration/login.html +404 -0
  189. Management/templates/users.html +304 -0
  190. Management/urls.py +23 -0
  191. Management/views.py +804 -0
  192. Monitoring/__init__.py +0 -0
  193. Monitoring/apps.py +9 -0
  194. Monitoring/migrations/__init__.py +0 -0
  195. Monitoring/static/js/monitoring.js +463 -0
  196. Monitoring/templates/components/node_metrics.html +161 -0
  197. Monitoring/templates/components/pipeline_metrics.html +189 -0
  198. Monitoring/templates/monitoring.html +271 -0
  199. Monitoring/urls.py +16 -0
  200. Monitoring/views.py +724 -0
  201. PipelineManager/__init__.py +0 -0
  202. PipelineManager/agent_api.py +1173 -0
  203. PipelineManager/agent_client.py +59 -0
  204. PipelineManager/agent_modes.py +880 -0
  205. PipelineManager/agent_policies.py +689 -0
  206. PipelineManager/agent_versions.py +151 -0
  207. PipelineManager/apps.py +10 -0
  208. PipelineManager/artifact_metrics.py +171 -0
  209. PipelineManager/artifacts.py +820 -0
  210. PipelineManager/connections_crud.py +722 -0
  211. PipelineManager/data/default_jvm.options +76 -0
  212. PipelineManager/data/default_log4j2.properties +165 -0
  213. PipelineManager/data/default_logstash.yml +405 -0
  214. PipelineManager/data/plugins.json +29109 -0
  215. PipelineManager/editor_views.py +608 -0
  216. PipelineManager/forms.py +284 -0
  217. PipelineManager/manager_views.py +490 -0
  218. PipelineManager/migrations/0001_initial.py +38 -0
  219. PipelineManager/migrations/0002_alter_connection_connection_type_and_more.py +38 -0
  220. PipelineManager/migrations/0003_policy_connection_policy.py +38 -0
  221. PipelineManager/migrations/0004_policy_current_revision_number_and_more.py +75 -0
  222. PipelineManager/migrations/0005_apikey_enrollmenttoken.py +38 -0
  223. PipelineManager/migrations/0006_enrollmenttoken_name.py +18 -0
  224. PipelineManager/migrations/0007_alter_enrollmenttoken_options_and_more.py +21 -0
  225. PipelineManager/migrations/0008_connection_agent_id.py +18 -0
  226. PipelineManager/migrations/0009_connection_last_check_in_policy_jvm_options_hash_and_more.py +33 -0
  227. PipelineManager/migrations/0010_keystore_revision_number_pipeline_revision_number.py +23 -0
  228. PipelineManager/migrations/0011_keystore_kv_hash.py +18 -0
  229. PipelineManager/migrations/0012_policy_binary_path.py +18 -0
  230. PipelineManager/migrations/0013_connection_status_blob.py +18 -0
  231. PipelineManager/migrations/0014_pipeline_pipeline_batch_delay_and_more.py +43 -0
  232. PipelineManager/migrations/0015_add_pipeline_hash.py +18 -0
  233. PipelineManager/migrations/0016_backfill_pipeline_hash.py +32 -0
  234. PipelineManager/migrations/0017_policy_keystore_password.py +31 -0
  235. PipelineManager/migrations/0018_policy_last_deployed_at.py +18 -0
  236. PipelineManager/migrations/0019_connection_restart_on_next_checkin.py +18 -0
  237. PipelineManager/migrations/0020_pipeline_no_input_pipeline_non_reloadable.py +23 -0
  238. PipelineManager/migrations/0021_connection_desired_agent_version.py +18 -0
  239. PipelineManager/migrations/0022_keystore_managed_by_pipeline_managed_by.py +23 -0
  240. PipelineManager/migrations/0023_agent_modes_policy_connection.py +89 -0
  241. PipelineManager/migrations/0024_seed_system_policies.py +173 -0
  242. PipelineManager/migrations/0025_packaged_managed_policy_types.py +166 -0
  243. PipelineManager/migrations/0026_normalize_opt_logstash_agent_paths.py +63 -0
  244. PipelineManager/migrations/0027_packaged_managed_default_ports.py +49 -0
  245. PipelineManager/migrations/0028_apikey_admin_tokens.py +80 -0
  246. PipelineManager/migrations/0029_logstash_artifacts.py +45 -0
  247. PipelineManager/migrations/0030_connection_allow_self_signed_certs.py +33 -0
  248. PipelineManager/migrations/0031_deploy_system_policies.py +93 -0
  249. PipelineManager/migrations/0032_connection_agent_inbound_key.py +30 -0
  250. PipelineManager/migrations/0033_simulation_result.py +26 -0
  251. PipelineManager/migrations/__init__.py +0 -0
  252. PipelineManager/models.py +1300 -0
  253. PipelineManager/pipelines_crud.py +738 -0
  254. PipelineManager/policies_crud.py +772 -0
  255. PipelineManager/sim_keystore.py +319 -0
  256. PipelineManager/simulation.py +1581 -0
  257. PipelineManager/static/css/codemirror.min.css +1 -0
  258. PipelineManager/static/css/graph_move.css +79 -0
  259. PipelineManager/static/css/monokai.min.css +1 -0
  260. PipelineManager/static/css/move_mode.css +144 -0
  261. PipelineManager/static/css/show-hint.min.css +1 -0
  262. PipelineManager/static/images/age.png +0 -0
  263. PipelineManager/static/images/aggregate.png +0 -0
  264. PipelineManager/static/images/alter.png +0 -0
  265. PipelineManager/static/images/azure_event_hubs.png +0 -0
  266. PipelineManager/static/images/beats.png +0 -0
  267. PipelineManager/static/images/boundary.png +0 -0
  268. PipelineManager/static/images/bytes.png +0 -0
  269. PipelineManager/static/images/cidr.png +0 -0
  270. PipelineManager/static/images/cipher.png +0 -0
  271. PipelineManager/static/images/circonus.png +0 -0
  272. PipelineManager/static/images/clone.png +0 -0
  273. PipelineManager/static/images/cloudwatch.png +0 -0
  274. PipelineManager/static/images/comment.png +0 -0
  275. PipelineManager/static/images/continue.png +0 -0
  276. PipelineManager/static/images/couchdb_changes.png +0 -0
  277. PipelineManager/static/images/csv.png +0 -0
  278. PipelineManager/static/images/datadog.png +0 -0
  279. PipelineManager/static/images/datadog_metrics.png +0 -0
  280. PipelineManager/static/images/date.png +0 -0
  281. PipelineManager/static/images/de_dot.png +0 -0
  282. PipelineManager/static/images/dead_letter_queue.png +0 -0
  283. PipelineManager/static/images/dissect.png +0 -0
  284. PipelineManager/static/images/dns.png +0 -0
  285. PipelineManager/static/images/drop.png +0 -0
  286. PipelineManager/static/images/dynatrace.png +0 -0
  287. PipelineManager/static/images/elapsed.png +0 -0
  288. PipelineManager/static/images/elastic_agent.png +0 -0
  289. PipelineManager/static/images/elastic_integration.png +0 -0
  290. PipelineManager/static/images/elastic_serverless_forwarder.png +0 -0
  291. PipelineManager/static/images/elastic_workplace_search.png +0 -0
  292. PipelineManager/static/images/elasticsearch.png +0 -0
  293. PipelineManager/static/images/else.png +0 -0
  294. PipelineManager/static/images/else_if.png +0 -0
  295. PipelineManager/static/images/email.png +0 -0
  296. PipelineManager/static/images/environment.png +0 -0
  297. PipelineManager/static/images/exec.png +0 -0
  298. PipelineManager/static/images/extractnumbers.png +0 -0
  299. PipelineManager/static/images/file.png +0 -0
  300. PipelineManager/static/images/fingerprint.png +0 -0
  301. PipelineManager/static/images/ganglia.png +0 -0
  302. PipelineManager/static/images/gelf.png +0 -0
  303. PipelineManager/static/images/generator.png +0 -0
  304. PipelineManager/static/images/geoip.png +0 -0
  305. PipelineManager/static/images/github.png +0 -0
  306. PipelineManager/static/images/google_bigquery.png +0 -0
  307. PipelineManager/static/images/google_cloud_storage.png +0 -0
  308. PipelineManager/static/images/google_pubsub.png +0 -0
  309. PipelineManager/static/images/graphite.png +0 -0
  310. PipelineManager/static/images/graphtastic.png +0 -0
  311. PipelineManager/static/images/grok.png +0 -0
  312. PipelineManager/static/images/heartbeat.png +0 -0
  313. PipelineManager/static/images/http.png +0 -0
  314. PipelineManager/static/images/http_poller.png +0 -0
  315. PipelineManager/static/images/i18n.png +0 -0
  316. PipelineManager/static/images/if.png +0 -0
  317. PipelineManager/static/images/imap.png +0 -0
  318. PipelineManager/static/images/influxdb.png +0 -0
  319. PipelineManager/static/images/irc.png +0 -0
  320. PipelineManager/static/images/java_generator.png +0 -0
  321. PipelineManager/static/images/java_stdin.png +0 -0
  322. PipelineManager/static/images/java_stdout.png +0 -0
  323. PipelineManager/static/images/java_uuid.png +0 -0
  324. PipelineManager/static/images/jdbc.png +0 -0
  325. PipelineManager/static/images/jdbc_static.png +0 -0
  326. PipelineManager/static/images/jdbc_streaming.png +0 -0
  327. PipelineManager/static/images/jms.png +0 -0
  328. PipelineManager/static/images/jmx.png +0 -0
  329. PipelineManager/static/images/json.png +0 -0
  330. PipelineManager/static/images/json_encode.png +0 -0
  331. PipelineManager/static/images/juggernaut.png +0 -0
  332. PipelineManager/static/images/kafka.png +0 -0
  333. PipelineManager/static/images/kinesis.png +0 -0
  334. PipelineManager/static/images/kv.png +0 -0
  335. PipelineManager/static/images/librato.png +0 -0
  336. PipelineManager/static/images/log4j.png +0 -0
  337. PipelineManager/static/images/loggly.png +0 -0
  338. PipelineManager/static/images/logstash.png +0 -0
  339. PipelineManager/static/images/lumberjack.png +0 -0
  340. PipelineManager/static/images/meetup.png +0 -0
  341. PipelineManager/static/images/memcached.png +0 -0
  342. PipelineManager/static/images/metriccatcher.png +0 -0
  343. PipelineManager/static/images/metricize.png +0 -0
  344. PipelineManager/static/images/metrics.png +0 -0
  345. PipelineManager/static/images/mongodb.png +0 -0
  346. PipelineManager/static/images/mutate.png +0 -0
  347. PipelineManager/static/images/nagios.png +0 -0
  348. PipelineManager/static/images/nagios_nsca.png +0 -0
  349. PipelineManager/static/images/opentsdb.png +0 -0
  350. PipelineManager/static/images/pagerduty.png +0 -0
  351. PipelineManager/static/images/pipe.png +0 -0
  352. PipelineManager/static/images/pipeline.png +0 -0
  353. PipelineManager/static/images/prune.png +0 -0
  354. PipelineManager/static/images/puppet_facter.png +0 -0
  355. PipelineManager/static/images/rabbitmq.png +0 -0
  356. PipelineManager/static/images/range.png +0 -0
  357. PipelineManager/static/images/redis.png +0 -0
  358. PipelineManager/static/images/redmine.png +0 -0
  359. PipelineManager/static/images/relp.png +0 -0
  360. PipelineManager/static/images/riak.png +0 -0
  361. PipelineManager/static/images/riemann.png +0 -0
  362. PipelineManager/static/images/rss.png +0 -0
  363. PipelineManager/static/images/ruby.png +0 -0
  364. PipelineManager/static/images/s3-sns-sqs.png +0 -0
  365. PipelineManager/static/images/s3.png +0 -0
  366. PipelineManager/static/images/salesforce.png +0 -0
  367. PipelineManager/static/images/sink.png +0 -0
  368. PipelineManager/static/images/sleep.png +0 -0
  369. PipelineManager/static/images/snmp.png +0 -0
  370. PipelineManager/static/images/snmptrap.png +0 -0
  371. PipelineManager/static/images/sns.png +0 -0
  372. PipelineManager/static/images/solr_http.png +0 -0
  373. PipelineManager/static/images/split.png +0 -0
  374. PipelineManager/static/images/sqlite.png +0 -0
  375. PipelineManager/static/images/sqs.png +0 -0
  376. PipelineManager/static/images/statsd.png +0 -0
  377. PipelineManager/static/images/stdin.png +0 -0
  378. PipelineManager/static/images/stdout.png +0 -0
  379. PipelineManager/static/images/stomp.png +0 -0
  380. PipelineManager/static/images/syslog.png +0 -0
  381. PipelineManager/static/images/syslog_pri.png +0 -0
  382. PipelineManager/static/images/tcp.png +0 -0
  383. PipelineManager/static/images/threats_classifier.png +0 -0
  384. PipelineManager/static/images/throttle.png +0 -0
  385. PipelineManager/static/images/timber.png +0 -0
  386. PipelineManager/static/images/tld.png +0 -0
  387. PipelineManager/static/images/translate.png +0 -0
  388. PipelineManager/static/images/truncate.png +0 -0
  389. PipelineManager/static/images/twitter.png +0 -0
  390. PipelineManager/static/images/udp.png +0 -0
  391. PipelineManager/static/images/unix.png +0 -0
  392. PipelineManager/static/images/urldecode.png +0 -0
  393. PipelineManager/static/images/useragent.png +0 -0
  394. PipelineManager/static/images/uuid.png +0 -0
  395. PipelineManager/static/images/varnishlog.png +0 -0
  396. PipelineManager/static/images/webhdfs.png +0 -0
  397. PipelineManager/static/images/websocket.png +0 -0
  398. PipelineManager/static/images/wmi.png +0 -0
  399. PipelineManager/static/images/wurfl_device_detection.png +0 -0
  400. PipelineManager/static/images/xml.png +0 -0
  401. PipelineManager/static/images/xmpp.png +0 -0
  402. PipelineManager/static/images/zabbix.png +0 -0
  403. PipelineManager/static/js/agent_inspect_modal.js +141 -0
  404. PipelineManager/static/js/agent_policies.js +3746 -0
  405. PipelineManager/static/js/agent_status_sse.js +166 -0
  406. PipelineManager/static/js/codemirror.min.js +1 -0
  407. PipelineManager/static/js/connections_table.js +551 -0
  408. PipelineManager/static/js/d3.v7.js +20625 -0
  409. PipelineManager/static/js/diff_modal.js +995 -0
  410. PipelineManager/static/js/expression_editor.js +291 -0
  411. PipelineManager/static/js/js-yaml.min.js +1 -0
  412. PipelineManager/static/js/logstashyml_guides.js +1063 -0
  413. PipelineManager/static/js/move_graph.js +577 -0
  414. PipelineManager/static/js/move_mode.js +559 -0
  415. PipelineManager/static/js/pipeline_editor.js +4102 -0
  416. PipelineManager/static/js/pipeline_graph_editor.js +3542 -0
  417. PipelineManager/static/js/pipeline_list.js +274 -0
  418. PipelineManager/static/js/pipeline_settings.js +121 -0
  419. PipelineManager/static/js/pipeline_text_editor.js +2088 -0
  420. PipelineManager/static/js/plugin_config_modal.js +2827 -0
  421. PipelineManager/static/js/policy_deploy_modal.js +1066 -0
  422. PipelineManager/static/js/show-hint.min.js +1 -0
  423. PipelineManager/static/js/sim_targets.js +380 -0
  424. PipelineManager/static/js/simple-comment-mode.js +56 -0
  425. PipelineManager/static/js/simulation_modal.js +1135 -0
  426. PipelineManager/static/js/simulation_results.js +2778 -0
  427. PipelineManager/static/js/stats_strip.js +231 -0
  428. PipelineManager/static/js/yaml.js +120 -0
  429. PipelineManager/system_policy_defaults.py +279 -0
  430. PipelineManager/templates/components/pipeline_editor/diff_modal.html +127 -0
  431. PipelineManager/templates/components/pipeline_editor/expression_editor.html +160 -0
  432. PipelineManager/templates/components/pipeline_editor/plugin_config_modal.html +119 -0
  433. PipelineManager/templates/components/pipeline_editor/plugin_modal.html +1016 -0
  434. PipelineManager/templates/components/pipeline_editor/simulation_modal.html +394 -0
  435. PipelineManager/templates/components/pipeline_editor/simulation_results.html +123 -0
  436. PipelineManager/templates/components/pipeline_editor/stats_strip.html +123 -0
  437. PipelineManager/templates/components/pipeline_editor/view_code_modal.html +133 -0
  438. PipelineManager/templates/components/pipeline_manager/agent_inspect_content.html +805 -0
  439. PipelineManager/templates/components/pipeline_manager/agent_inspect_modal.html +40 -0
  440. PipelineManager/templates/components/pipeline_manager/agent_policies.html +2421 -0
  441. PipelineManager/templates/components/pipeline_manager/change_policy_modal.html +210 -0
  442. PipelineManager/templates/components/pipeline_manager/collapsible_row.html +11 -0
  443. PipelineManager/templates/components/pipeline_manager/connection_modal.html +1361 -0
  444. PipelineManager/templates/components/pipeline_manager/keystore_modal.html +269 -0
  445. PipelineManager/templates/components/pipeline_manager/logstashyml_guides/centralized_pipeline_management.html +291 -0
  446. PipelineManager/templates/components/pipeline_manager/logstashyml_guides/default.html +166 -0
  447. PipelineManager/templates/components/pipeline_manager/mcp_modal.html +241 -0
  448. PipelineManager/templates/components/pipeline_manager/pipeline_list_content.html +586 -0
  449. PipelineManager/templates/components/pipeline_manager/policy_deploy_modal.html +238 -0
  450. PipelineManager/templates/pipeline_editor.html +1738 -0
  451. PipelineManager/templates/pipeline_graph_editor.html +99 -0
  452. PipelineManager/templates/pipeline_manager.html +584 -0
  453. PipelineManager/templates/pipeline_text_editor.html +350 -0
  454. PipelineManager/urls.py +99 -0
  455. SNMP/__init__.py +0 -0
  456. SNMP/ai_template_generation.py +232 -0
  457. SNMP/apps.py +9 -0
  458. SNMP/assets/device_template_generation/agents/snmp-profile-author.json +15 -0
  459. SNMP/assets/device_template_generation/skills/snmp-catalog.json +9 -0
  460. SNMP/data/authoring_instructions.md +65 -0
  461. SNMP/data/grounding/.gitignore +4 -0
  462. SNMP/data/grounding/build_grounding.py +35 -0
  463. SNMP/data/grounding/grounding.json +1 -0
  464. SNMP/data/grounding/sample_agent_payload.cisco2960x.json +2184 -0
  465. SNMP/data/mib_reference/std_bgp4_mib.json +43 -0
  466. SNMP/data/mib_reference/std_entity_sensors.json +28 -0
  467. SNMP/data/mib_reference/std_host_resources.json +32 -0
  468. SNMP/data/mib_reference/std_ospf_mib.json +55 -0
  469. SNMP/data/mib_reference/std_ucd_linux.json +27 -0
  470. SNMP/data/normalizers.json +103 -0
  471. SNMP/data/official_device_templates/arista_eos.json +24 -0
  472. SNMP/data/official_device_templates/aruba_wireless_controller.json +23 -0
  473. SNMP/data/official_device_templates/brocade_fc_switch.json +20 -0
  474. SNMP/data/official_device_templates/cisco_ios.json +21 -0
  475. SNMP/data/official_device_templates/default.json +13 -0
  476. SNMP/data/official_device_templates/dell_idrac.json +22 -0
  477. SNMP/data/official_device_templates/dell_x1026.json +16 -0
  478. SNMP/data/official_device_templates/dlink_dgs1210_switch.json +19 -0
  479. SNMP/data/official_device_templates/eastpower_ups.json +20 -0
  480. SNMP/data/official_device_templates/eaton_ups.json +22 -0
  481. SNMP/data/official_device_templates/epson_printer.json +18 -0
  482. SNMP/data/official_device_templates/geist_watchdog.json +20 -0
  483. SNMP/data/official_device_templates/generic_linux.json +18 -0
  484. SNMP/data/official_device_templates/generic_ont.json +18 -0
  485. SNMP/data/official_device_templates/generic_ups.json +16 -0
  486. SNMP/data/official_device_templates/hp_laserjet_mfp_m281cdw.json +18 -0
  487. SNMP/data/official_device_templates/hpe_nimble.json +17 -0
  488. SNMP/data/official_device_templates/huawei_ups.json +19 -0
  489. SNMP/data/official_device_templates/ingrasys_ups.json +19 -0
  490. SNMP/data/official_device_templates/isilon_onefs.json +22 -0
  491. SNMP/data/official_device_templates/mellanox_sx6036.json +20 -0
  492. SNMP/data/official_device_templates/netapp_7mode.json +22 -0
  493. SNMP/data/official_device_templates/palo_alto_firewall.json +21 -0
  494. SNMP/data/official_device_templates/phoenixtec_ups.json +18 -0
  495. SNMP/data/official_device_templates/ubiquiti_unifi_ap.json +19 -0
  496. SNMP/data/official_device_templates/ubiquiti_unifi_switch.json +18 -0
  497. SNMP/data/official_device_templates/ubiquiti_unifi_udm.json +19 -0
  498. SNMP/data/official_device_templates/versa_flexvnf_appliance.json +19 -0
  499. SNMP/data/official_profiles/arista_eos.json +16 -0
  500. SNMP/data/official_profiles/aruba_wireless_controller.json +145 -0
  501. SNMP/data/official_profiles/brocade_fibre_channel_switch_fibre_channel_ports.json +35 -0
  502. SNMP/data/official_profiles/brocade_fibre_channel_switch_name_server.json +23 -0
  503. SNMP/data/official_profiles/brocade_fibre_channel_switch_system_metrics.json +36 -0
  504. SNMP/data/official_profiles/cisco_cdp.json +26 -0
  505. SNMP/data/official_profiles/cisco_fans.json +18 -0
  506. SNMP/data/official_profiles/cisco_sensors.json +21 -0
  507. SNMP/data/official_profiles/cisco_system_metrics.json +40 -0
  508. SNMP/data/official_profiles/dell_idrac_cpu.json +19 -0
  509. SNMP/data/official_profiles/dell_idrac_fans.json +20 -0
  510. SNMP/data/official_profiles/dell_idrac_global_status.json +13 -0
  511. SNMP/data/official_profiles/dell_idrac_memory.json +20 -0
  512. SNMP/data/official_profiles/dell_idrac_power_supply.json +19 -0
  513. SNMP/data/official_profiles/dell_idrac_raid_controller.json +19 -0
  514. SNMP/data/official_profiles/dlink_dgs1210.json +15 -0
  515. SNMP/data/official_profiles/dlink_dgs1210_system_metrics.json +38 -0
  516. SNMP/data/official_profiles/eaton_ups.json +40 -0
  517. SNMP/data/official_profiles/geist_environment.json +50 -0
  518. SNMP/data/official_profiles/generic_arp.json +19 -0
  519. SNMP/data/official_profiles/generic_bgp.json +24 -0
  520. SNMP/data/official_profiles/generic_entity_psu.json +26 -0
  521. SNMP/data/official_profiles/generic_entity_sensor.json +22 -0
  522. SNMP/data/official_profiles/generic_host_system_metrics.json +68 -0
  523. SNMP/data/official_profiles/generic_interfaces.json +86 -0
  524. SNMP/data/official_profiles/generic_ip_addr.json +19 -0
  525. SNMP/data/official_profiles/generic_lldp.json +54 -0
  526. SNMP/data/official_profiles/generic_lm_sensors.json +37 -0
  527. SNMP/data/official_profiles/generic_mac_table.json +19 -0
  528. SNMP/data/official_profiles/generic_ont.json +88 -0
  529. SNMP/data/official_profiles/generic_ospf.json +21 -0
  530. SNMP/data/official_profiles/generic_printer_mib.json +48 -0
  531. SNMP/data/official_profiles/generic_rmon.json +38 -0
  532. SNMP/data/official_profiles/generic_system.json +17 -0
  533. SNMP/data/official_profiles/generic_ucd_system_metrics.json +63 -0
  534. SNMP/data/official_profiles/generic_ups_mib.json +154 -0
  535. SNMP/data/official_profiles/hpe_nimble_volumes.json +59 -0
  536. SNMP/data/official_profiles/huawei_ups.json +111 -0
  537. SNMP/data/official_profiles/isilon_performance.json +92 -0
  538. SNMP/data/official_profiles/isilon_protocols.json +77 -0
  539. SNMP/data/official_profiles/isilon_system.json +86 -0
  540. SNMP/data/official_profiles/mellanox_mlnx_os.json +15 -0
  541. SNMP/data/official_profiles/netapp_7mode_data_protection.json +106 -0
  542. SNMP/data/official_profiles/netapp_7mode_disks.json +51 -0
  543. SNMP/data/official_profiles/netapp_7mode_protocols.json +66 -0
  544. SNMP/data/official_profiles/netapp_7mode_system.json +92 -0
  545. SNMP/data/official_profiles/netapp_7mode_volumes.json +166 -0
  546. SNMP/data/official_profiles/paloalto_components.json +36 -0
  547. SNMP/data/official_profiles/paloalto_system.json +15 -0
  548. SNMP/data/official_profiles/traps.json +16 -0
  549. SNMP/data/official_profiles/ubiquiti_unifi_switch.json +18 -0
  550. SNMP/data/official_profiles/ubiquiti_unifi_switch_system.json +14 -0
  551. SNMP/data/official_profiles/ubiquiti_unifi_wireless.json +60 -0
  552. SNMP/data/official_profiles/versa_flexvnf.json +14 -0
  553. SNMP/data/schema.md +650 -0
  554. SNMP/data/schema_reference/snmp_field_schema.md +747 -0
  555. SNMP/data/snmp_template.json +629 -0
  556. SNMP/data/template_profile_context.md +3986 -0
  557. SNMP/inline_grounding.py +77 -0
  558. SNMP/management/__init__.py +1 -0
  559. SNMP/management/commands/__init__.py +1 -0
  560. SNMP/management/commands/generate_template_profile_context.py +272 -0
  561. SNMP/management/commands/load_test_snmp_data.py +240 -0
  562. SNMP/management/commands/sync_snmp_official_data.py +263 -0
  563. SNMP/management/commands/unload_test_snmp_data.py +77 -0
  564. SNMP/migrations/0001_initial.py +101 -0
  565. SNMP/migrations/0002_devicetemplate.py +34 -0
  566. SNMP/migrations/0003_remove_devicetemplate_type_remove_profile_type_and_more.py +31 -0
  567. SNMP/migrations/0004_device_device_template.py +19 -0
  568. SNMP/migrations/0005_devicetemplate_product_profile_product.py +23 -0
  569. SNMP/migrations/0006_alter_devicetemplate_model_and_more.py +28 -0
  570. SNMP/migrations/0007_remove_device_profiles.py +17 -0
  571. SNMP/migrations/0008_devicetemplate_type.py +18 -0
  572. SNMP/migrations/0009_alter_device_device_template.py +19 -0
  573. SNMP/migrations/0010_alter_device_device_template.py +19 -0
  574. SNMP/migrations/0011_network_namespace.py +18 -0
  575. SNMP/migrations/0012_profile_normalizers.py +18 -0
  576. SNMP/migrations/0013_snmpdeploymentstate.py +26 -0
  577. SNMP/migrations/0014_alter_snmpdeploymentstate_last_config_change.py +18 -0
  578. SNMP/migrations/0015_alter_snmpdeploymentstate_last_config_change.py +20 -0
  579. SNMP/migrations/0016_alter_snmpdeploymentstate_last_config_change.py +18 -0
  580. SNMP/migrations/0017_remove_network_logstash_name.py +17 -0
  581. SNMP/migrations/0018_add_official_key.py +39 -0
  582. SNMP/migrations/0019_network_namespace_from_device_template.py +18 -0
  583. SNMP/migrations/0020_device_hostname_alter_device_ip_address_and_more.py +27 -0
  584. SNMP/migrations/0021_device_building_device_latitude_device_longitude_and_more.py +43 -0
  585. SNMP/migrations/0022_alter_device_latitude_alter_device_longitude.py +23 -0
  586. SNMP/migrations/0023_network_agent_connection_network_deployment_mode_and_more.py +30 -0
  587. SNMP/migrations/0024_network_credential_mode.py +18 -0
  588. SNMP/migrations/0025_network_ssl_certificate_authorities.py +18 -0
  589. SNMP/migrations/__init__.py +0 -0
  590. SNMP/models.py +892 -0
  591. SNMP/network_map.py +660 -0
  592. SNMP/overview.py +394 -0
  593. SNMP/snmp_crud.py +6082 -0
  594. SNMP/snmp_grounding.py +146 -0
  595. SNMP/snmp_normalizers.py +594 -0
  596. SNMP/snmp_pipeline_generator.py +1658 -0
  597. SNMP/snmp_test.py +962 -0
  598. SNMP/static/css/snmp.css +33 -0
  599. SNMP/static/images/apc.png +0 -0
  600. SNMP/static/images/arista.png +0 -0
  601. SNMP/static/images/aruba.png +0 -0
  602. SNMP/static/images/brocade.png +0 -0
  603. SNMP/static/images/cisco.png +0 -0
  604. SNMP/static/images/dell.png +0 -0
  605. SNMP/static/images/dlink.png +0 -0
  606. SNMP/static/images/east.png +0 -0
  607. SNMP/static/images/eaton.png +0 -0
  608. SNMP/static/images/epson.png +0 -0
  609. SNMP/static/images/hauwei.png +0 -0
  610. SNMP/static/images/hp.png +0 -0
  611. SNMP/static/images/hpe.png +0 -0
  612. SNMP/static/images/ingrasys.png +0 -0
  613. SNMP/static/images/linux.png +0 -0
  614. SNMP/static/images/mellanox.png +0 -0
  615. SNMP/static/images/netapp.png +0 -0
  616. SNMP/static/images/paloalto.png +0 -0
  617. SNMP/static/images/phoenixtec.png +0 -0
  618. SNMP/static/images/ubiquiti.png +0 -0
  619. SNMP/static/images/unknown.png +0 -0
  620. SNMP/static/images/versa.png +0 -0
  621. SNMP/static/images/vertiv.png +0 -0
  622. SNMP/static/js/ai_device_template_modal.js +1116 -0
  623. SNMP/static/js/credentials_table.js +291 -0
  624. SNMP/static/js/devices_table.js +588 -0
  625. SNMP/static/js/discovered_devices.js +291 -0
  626. SNMP/static/js/network_map.js +1657 -0
  627. SNMP/static/js/networks_table.js +360 -0
  628. SNMP/static/js/onboarding.js +866 -0
  629. SNMP/static/js/overview.js +416 -0
  630. SNMP/static/js/snmp_changes_indicator.js +76 -0
  631. SNMP/static/js/snmp_commit_modal.js +39 -0
  632. SNMP/static/js/snmp_credentials_modal.js +217 -0
  633. SNMP/static/js/snmp_device_template_modal.js +669 -0
  634. SNMP/static/js/snmp_device_visual_preview.js +1707 -0
  635. SNMP/static/js/snmp_devices_modal.js +912 -0
  636. SNMP/static/js/snmp_diff_modal.js +1559 -0
  637. SNMP/static/js/snmp_network_modal.js +940 -0
  638. SNMP/static/js/snmp_profile_modal.js +1212 -0
  639. SNMP/static/js/snmp_profile_modal_helpers.js +17 -0
  640. SNMP/static/js/snmp_test.js +538 -0
  641. SNMP/templates/Credentials.html +325 -0
  642. SNMP/templates/DeviceTemplates.html +1059 -0
  643. SNMP/templates/Devices.html +274 -0
  644. SNMP/templates/Networks.html +469 -0
  645. SNMP/templates/Onboarding.html +521 -0
  646. SNMP/templates/Overview.html +227 -0
  647. SNMP/templates/components/ai_device_template_modal.html +46 -0
  648. SNMP/templates/components/ai_generate_template_content.html +224 -0
  649. SNMP/templates/components/device_template_profile_modal.html +60 -0
  650. SNMP/templates/components/discovered_devices_content.html +86 -0
  651. SNMP/templates/components/discovered_devices_modal.html +43 -0
  652. SNMP/templates/components/gmaps_latlon_modal.html +93 -0
  653. SNMP/templates/components/network_map.html +110 -0
  654. SNMP/templates/components/snmp_commit_modal.html +53 -0
  655. SNMP/templates/components/snmp_credentials_modal.html +189 -0
  656. SNMP/templates/components/snmp_device_modal.html +6 -0
  657. SNMP/templates/components/snmp_device_template_modal.html +129 -0
  658. SNMP/templates/components/snmp_device_visual_preview.html +347 -0
  659. SNMP/templates/components/snmp_devices_modal.html +330 -0
  660. SNMP/templates/components/snmp_diff_modal.html +148 -0
  661. SNMP/templates/components/snmp_network_modal.html +380 -0
  662. SNMP/templates/components/snmp_profile_modal.html +147 -0
  663. SNMP/templates/components/snmp_test_modal.html +398 -0
  664. SNMP/templatetags/__init__.py +0 -0
  665. SNMP/templatetags/snmp_extras.py +17 -0
  666. SNMP/urls.py +94 -0
  667. SNMP/views.py +913 -0
  668. Site/__init__.py +0 -0
  669. Site/apps.py +9 -0
  670. Site/migrations/__init__.py +0 -0
  671. Site/product_ca_views.py +41 -0
  672. Site/static/images/ElasticIcon.png +0 -0
  673. Site/static/images/LoggyIcon.png +0 -0
  674. Site/static/images/LoggyWizardIcon.png +0 -0
  675. Site/static/images/LogstashAgentIcon.png +0 -0
  676. Site/static/images/LogstashIcon.png +0 -0
  677. Site/static/js/base.js +192 -0
  678. Site/static/js/marked.min.js +69 -0
  679. Site/templates/base.html +52 -0
  680. Site/templates/error.html +65 -0
  681. Site/templates/home.html +148 -0
  682. Site/templates/navigation.html +530 -0
  683. Site/templates/popup.html +251 -0
  684. Site/templatetags/__init__.py +0 -0
  685. Site/templatetags/custom_filters.py +36 -0
  686. Site/urls.py +21 -0
  687. Site/views.py +200 -0
  688. Utilities/__init__.py +0 -0
  689. Utilities/apps.py +9 -0
  690. Utilities/data/grok-patterns/LICENSE +202 -0
  691. Utilities/data/grok-patterns/ecs-v1/aws +33 -0
  692. Utilities/data/grok-patterns/ecs-v1/bacula +53 -0
  693. Utilities/data/grok-patterns/ecs-v1/bind +13 -0
  694. Utilities/data/grok-patterns/ecs-v1/bro +30 -0
  695. Utilities/data/grok-patterns/ecs-v1/exim +26 -0
  696. Utilities/data/grok-patterns/ecs-v1/firewalls +111 -0
  697. Utilities/data/grok-patterns/ecs-v1/grok-patterns +95 -0
  698. Utilities/data/grok-patterns/ecs-v1/haproxy +40 -0
  699. Utilities/data/grok-patterns/ecs-v1/httpd +17 -0
  700. Utilities/data/grok-patterns/ecs-v1/java +34 -0
  701. Utilities/data/grok-patterns/ecs-v1/junos +13 -0
  702. Utilities/data/grok-patterns/ecs-v1/linux-syslog +16 -0
  703. Utilities/data/grok-patterns/ecs-v1/maven +1 -0
  704. Utilities/data/grok-patterns/ecs-v1/mcollective +4 -0
  705. Utilities/data/grok-patterns/ecs-v1/mongodb +7 -0
  706. Utilities/data/grok-patterns/ecs-v1/nagios +124 -0
  707. Utilities/data/grok-patterns/ecs-v1/postgresql +2 -0
  708. Utilities/data/grok-patterns/ecs-v1/rails +13 -0
  709. Utilities/data/grok-patterns/ecs-v1/redis +3 -0
  710. Utilities/data/grok-patterns/ecs-v1/ruby +2 -0
  711. Utilities/data/grok-patterns/ecs-v1/squid +6 -0
  712. Utilities/data/grok-patterns/ecs-v1/zeek +33 -0
  713. Utilities/data/grok-patterns/legacy/aws +14 -0
  714. Utilities/data/grok-patterns/legacy/bacula +50 -0
  715. Utilities/data/grok-patterns/legacy/bind +3 -0
  716. Utilities/data/grok-patterns/legacy/bro +13 -0
  717. Utilities/data/grok-patterns/legacy/exim +19 -0
  718. Utilities/data/grok-patterns/legacy/firewalls +91 -0
  719. Utilities/data/grok-patterns/legacy/grok-patterns +95 -0
  720. Utilities/data/grok-patterns/legacy/haproxy +39 -0
  721. Utilities/data/grok-patterns/legacy/httpd +15 -0
  722. Utilities/data/grok-patterns/legacy/java +17 -0
  723. Utilities/data/grok-patterns/legacy/junos +9 -0
  724. Utilities/data/grok-patterns/legacy/linux-syslog +16 -0
  725. Utilities/data/grok-patterns/legacy/maven +1 -0
  726. Utilities/data/grok-patterns/legacy/mcollective +1 -0
  727. Utilities/data/grok-patterns/legacy/mcollective-patterns +4 -0
  728. Utilities/data/grok-patterns/legacy/mongodb +7 -0
  729. Utilities/data/grok-patterns/legacy/nagios +124 -0
  730. Utilities/data/grok-patterns/legacy/postgresql +3 -0
  731. Utilities/data/grok-patterns/legacy/rails +13 -0
  732. Utilities/data/grok-patterns/legacy/redis +3 -0
  733. Utilities/data/grok-patterns/legacy/ruby +2 -0
  734. Utilities/data/grok-patterns/legacy/squid +4 -0
  735. Utilities/dissect.py +302 -0
  736. Utilities/grok.py +412 -0
  737. Utilities/migrations/__init__.py +0 -0
  738. Utilities/static/css/debugger_editor.css +88 -0
  739. Utilities/static/js/debugger_editor.js +93 -0
  740. Utilities/static/js/grok_debugger.js +131 -0
  741. Utilities/templates/dissect_debugger.html +95 -0
  742. Utilities/templates/grok_debugger.html +99 -0
  743. Utilities/urls.py +14 -0
  744. Utilities/views.py +363 -0
  745. logstashui-0.5.5.dev0.dist-info/METADATA +333 -0
  746. logstashui-0.5.5.dev0.dist-info/RECORD +762 -0
  747. logstashui-0.5.5.dev0.dist-info/WHEEL +4 -0
  748. logstashui-0.5.5.dev0.dist-info/entry_points.txt +2 -0
  749. logstashui-0.5.5.dev0.dist-info/licenses/LICENSE.txt +93 -0
  750. logstashui-0.5.5.dev0.dist-info/licenses/NOTICE.txt +2772 -0
  751. theme/__init__.py +0 -0
  752. theme/apps.py +9 -0
  753. theme/package-lock.json +6 -0
  754. theme/static/css/dist/styles.css +2 -0
  755. theme/static/images/favicon.ico +0 -0
  756. theme/static_src/.gitignore +1 -0
  757. theme/static_src/package-lock.json +1930 -0
  758. theme/static_src/package.json +26 -0
  759. theme/static_src/postcss.config.js +7 -0
  760. theme/static_src/src/styles.css +38 -0
  761. theme/static_src/tailwind.config.js +43 -0
  762. theme/templates/base.html +32 -0
@@ -0,0 +1,2421 @@
1
+ <!--
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License;
4
+ * you may not use this file except in compliance with the Elastic License.
5
+ -->
6
+
7
+ {% extends "base.html" %}
8
+ {% load static %}
9
+
10
+ {% block content %}
11
+ <link rel="stylesheet" href="{% static 'css/codemirror.min.css' %}">
12
+
13
+ <style>
14
+ @keyframes glowPulse {
15
+ 0% {
16
+ box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7), 0 0 20px rgba(59, 130, 246, 0.5);
17
+ }
18
+ 50% {
19
+ box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.3), 0 0 30px rgba(59, 130, 246, 0.3);
20
+ }
21
+ 100% {
22
+ box-shadow: 0 0 0 0 rgba(59, 130, 246, 0), 0 0 0 rgba(59, 130, 246, 0);
23
+ }
24
+ }
25
+
26
+ @keyframes notificationGlowWarning {
27
+ 0%, 100% {
28
+ box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
29
+ }
30
+ 50% {
31
+ box-shadow: 0 0 16px rgba(251, 191, 36, 0.9);
32
+ }
33
+ }
34
+
35
+ @keyframes notificationGlowError {
36
+ 0%, 100% {
37
+ box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
38
+ }
39
+ 50% {
40
+ box-shadow: 0 0 16px rgba(239, 68, 68, 0.9);
41
+ }
42
+ }
43
+
44
+ .glow-button {
45
+ animation: glowPulse 2s ease-in-out infinite;
46
+ position: relative;
47
+ }
48
+
49
+ .notification-glow-warning {
50
+ animation: notificationGlowWarning 2s ease-in-out infinite;
51
+ }
52
+
53
+ .notification-glow-error {
54
+ animation: notificationGlowError 2s ease-in-out infinite;
55
+ }
56
+
57
+ .notification-badge-warning {
58
+ background-color: #fbbf24;
59
+ }
60
+
61
+ .notification-badge-error {
62
+ background-color: #ef4444;
63
+ }
64
+
65
+ /* Prominent purple glow for Save button with unsaved changes */
66
+ @keyframes saveButtonGlow {
67
+ 0%, 100% {
68
+ box-shadow: 0 0 20px rgba(147, 51, 234, 0.8), 0 0 40px rgba(147, 51, 234, 0.4);
69
+ }
70
+ 50% {
71
+ box-shadow: 0 0 30px rgba(147, 51, 234, 1), 0 0 60px rgba(147, 51, 234, 0.6);
72
+ }
73
+ }
74
+
75
+ .save-button-glow {
76
+ animation: saveButtonGlow 2s ease-in-out infinite;
77
+ }
78
+
79
+ /* Tab change indicator */
80
+ .tab-changed::after {
81
+ content: '';
82
+ position: absolute;
83
+ top: 8px;
84
+ right: 8px;
85
+ width: 6px;
86
+ height: 6px;
87
+ background-color: #a855f7;
88
+ border-radius: 50%;
89
+ box-shadow: 0 0 8px rgba(168, 85, 247, 0.8);
90
+ }
91
+
92
+ /* Subtle purple glow for modified form fields */
93
+ .field-modified {
94
+ border-color: rgba(147, 51, 234, 0.5) !important;
95
+ box-shadow: 0 0 0 1px rgba(147, 51, 234, 0.3), 0 0 8px rgba(147, 51, 234, 0.2) !important;
96
+ transition: all 0.3s ease;
97
+ }
98
+
99
+ .field-modified:focus {
100
+ border-color: rgba(147, 51, 234, 0.7) !important;
101
+ box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.4), 0 0 12px rgba(147, 51, 234, 0.3) !important;
102
+ }
103
+
104
+ /* CodeMirror container styling - matching pipeline_text_editor */
105
+ .CodeMirror {
106
+ height: 100%;
107
+ font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
108
+ font-size: 14px;
109
+ background: #1f2937;
110
+ color: #e5e7eb;
111
+ border: none !important;
112
+ }
113
+
114
+ .CodeMirror-gutters {
115
+ background: #374151;
116
+ border-right: 1px solid #4b5563;
117
+ }
118
+
119
+ .CodeMirror-linenumber {
120
+ color: #9ca3af;
121
+ }
122
+
123
+ .CodeMirror-cursor {
124
+ border-left: 1px solid #e5e7eb;
125
+ }
126
+
127
+ /* Selection highlight */
128
+ .CodeMirror-selected {
129
+ background: #3b82f6 !important;
130
+ }
131
+
132
+ .CodeMirror-focused .CodeMirror-selected {
133
+ background: #3b82f6 !important;
134
+ }
135
+
136
+ /* Bracket matching */
137
+ .CodeMirror-matchingbracket {
138
+ color: #22c55e !important;
139
+ background-color: rgba(34, 197, 94, 0.2);
140
+ font-weight: bold;
141
+ }
142
+
143
+ .CodeMirror-nonmatchingbracket {
144
+ color: #ef4444 !important;
145
+ background-color: rgba(239, 68, 68, 0.2);
146
+ font-weight: bold;
147
+ }
148
+
149
+ /* Scrollbar styling */
150
+ .CodeMirror-vscrollbar::-webkit-scrollbar,
151
+ .CodeMirror-hscrollbar::-webkit-scrollbar {
152
+ width: 12px;
153
+ height: 12px;
154
+ }
155
+
156
+ .CodeMirror-vscrollbar::-webkit-scrollbar-track,
157
+ .CodeMirror-hscrollbar::-webkit-scrollbar-track {
158
+ background: rgba(15, 23, 42, 0.3);
159
+ border-radius: 6px;
160
+ }
161
+
162
+ .CodeMirror-vscrollbar::-webkit-scrollbar-thumb,
163
+ .CodeMirror-hscrollbar::-webkit-scrollbar-thumb {
164
+ background: linear-gradient(180deg, #475569 0%, #334155 100%);
165
+ border-radius: 6px;
166
+ border: 2px solid rgba(30, 41, 59, 0.5);
167
+ }
168
+
169
+ .CodeMirror-vscrollbar::-webkit-scrollbar-thumb:hover,
170
+ .CodeMirror-hscrollbar::-webkit-scrollbar-thumb:hover {
171
+ background: linear-gradient(180deg, #64748b 0%, #475569 100%);
172
+ }
173
+
174
+ .file-tab {
175
+ padding: 0.75rem 1.25rem;
176
+ cursor: pointer;
177
+ border-bottom: 3px solid transparent;
178
+ transition: all 0.2s ease;
179
+ position: relative;
180
+ display: flex;
181
+ align-items: center;
182
+ border-top-left-radius: 0.375rem;
183
+ border-top-right-radius: 0.375rem;
184
+ }
185
+
186
+ .file-tab:hover:not(.active) {
187
+ background-color: #374151;
188
+ }
189
+
190
+ .file-tab:hover:not(.active) span {
191
+ color: #d1d5db;
192
+ }
193
+
194
+ .file-tab:hover:not(.active) svg {
195
+ opacity: 0.6;
196
+ }
197
+
198
+ .file-tab.active {
199
+ border-bottom-color: #3b82f6;
200
+ background-color: #1a1f2e;
201
+ box-shadow: inset 0 1px 0 rgba(59, 130, 246, 0.1);
202
+ margin-bottom: -1px;
203
+ z-index: 1;
204
+ }
205
+
206
+ .file-tab.active span {
207
+ font-weight: 600;
208
+ }
209
+
210
+ .file-tab.active svg {
211
+ opacity: 0.8;
212
+ }
213
+
214
+ .mode-toggle {
215
+ display: inline-flex;
216
+ border-radius: 0.375rem;
217
+ overflow: hidden;
218
+ }
219
+
220
+ .mode-toggle button {
221
+ padding: 0.25rem 0.75rem;
222
+ background-color: #374151;
223
+ color: #9ca3af;
224
+ border: none;
225
+ cursor: pointer;
226
+ transition: all 0.2s;
227
+ }
228
+
229
+ .mode-toggle button:hover {
230
+ background-color: #4b5563;
231
+ }
232
+
233
+ .mode-toggle button.active {
234
+ background-color: #3b82f6;
235
+ color: white;
236
+ }
237
+
238
+ /* YAML Syntax Highlighting - Brighter Colors */
239
+ .cm-atom { color: #60a5fa !important; } /* Keys - bright blue */
240
+ .cm-string { color: #86efac !important; } /* Strings - bright green */
241
+ .cm-number { color: #fbbf24 !important; } /* Numbers - bright yellow */
242
+ .cm-keyword { color: #c084fc !important; } /* Keywords - bright purple */
243
+ .cm-comment { color: #6b7280 !important; } /* Comments - gray (matching image) */
244
+ .cm-meta { color: #fb923c !important; } /* Meta - bright orange */
245
+ .cm-variable-2 { color: #f472b6 !important; } /* Variables - bright pink */
246
+ .cm-def { color: #34d399 !important; } /* Definitions - bright teal */
247
+
248
+ @keyframes guide-section-pulse {
249
+ 0% { box-shadow: 0 0 8px 2px rgba(168, 85, 247, 0.2); }
250
+ 50% { box-shadow: 0 0 20px 6px rgba(168, 85, 247, 0.45); }
251
+ 100% { box-shadow: 0 0 8px 2px rgba(168, 85, 247, 0.2); }
252
+ }
253
+
254
+ .guide-btn-highlight {
255
+ animation: guide-section-pulse 2s ease-in-out infinite;
256
+ border-color: rgba(168, 85, 247, 0.6) !important;
257
+ }
258
+
259
+ .requirement-tile-ok {
260
+ background: rgba(16, 185, 129, 0.08);
261
+ border-color: rgba(16, 185, 129, 0.3);
262
+ color: #6ee7b7;
263
+ }
264
+
265
+ .requirement-tile-fail {
266
+ background: rgba(190, 18, 60, 0.08);
267
+ border-color: rgba(219, 39, 119, 0.3);
268
+ color: #f9a8d4;
269
+ }
270
+
271
+ /* Policy Switcher */
272
+ .policy-switcher {
273
+ position: relative;
274
+ }
275
+
276
+ .policy-switcher-btn {
277
+ display: flex;
278
+ align-items: baseline;
279
+ gap: 0.5rem;
280
+ padding: 0.25rem 0.4rem 0.25rem 0;
281
+ background: transparent;
282
+ border: none;
283
+ border-radius: 0.375rem;
284
+ cursor: pointer;
285
+ transition: opacity 0.15s ease;
286
+ white-space: nowrap;
287
+ }
288
+
289
+ .policy-switcher-btn:hover {
290
+ opacity: 0.85;
291
+ }
292
+
293
+ .policy-switcher-prefix {
294
+ font-size: 1.6rem;
295
+ font-weight: 400;
296
+ color: #9ca3af;
297
+ letter-spacing: -0.01em;
298
+ }
299
+
300
+ .policy-switcher-name {
301
+ font-size: 1.6rem;
302
+ font-weight: 700;
303
+ color: #f3f4f6;
304
+ letter-spacing: -0.02em;
305
+ }
306
+
307
+ .policy-switcher-chevron {
308
+ opacity: 0.4;
309
+ transition: transform 0.15s ease, opacity 0.15s ease;
310
+ flex-shrink: 0;
311
+ align-self: center;
312
+ color: #a78bfa;
313
+ }
314
+
315
+ .policy-switcher-btn:hover .policy-switcher-chevron {
316
+ opacity: 0.7;
317
+ }
318
+
319
+ .policy-switcher-btn.open .policy-switcher-chevron {
320
+ transform: rotate(180deg);
321
+ opacity: 0.8;
322
+ }
323
+
324
+ .policy-switcher-menu {
325
+ position: absolute;
326
+ top: calc(100% + 6px);
327
+ left: 0;
328
+ min-width: 100%;
329
+ width: max-content;
330
+ background: #1a1f2e;
331
+ border: 1px solid rgba(139, 92, 246, 0.2);
332
+ border-radius: 0.5rem;
333
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0,0,0,0.1);
334
+ z-index: 100;
335
+ overflow: hidden;
336
+ animation: switcher-in 0.1s ease;
337
+ }
338
+
339
+ @keyframes switcher-in {
340
+ from { opacity: 0; transform: translateY(-4px); }
341
+ to { opacity: 1; transform: translateY(0); }
342
+ }
343
+
344
+ .policy-switcher-item {
345
+ display: flex;
346
+ align-items: center;
347
+ gap: 0.6rem;
348
+ padding: 0.5rem 0.875rem;
349
+ font-size: 0.9rem;
350
+ color: #d1d5db;
351
+ cursor: pointer;
352
+ transition: background 0.1s ease, color 0.1s ease;
353
+ position: relative;
354
+ }
355
+
356
+ .policy-switcher-item:hover {
357
+ background: rgba(139, 92, 246, 0.1);
358
+ color: #ede9fe;
359
+ }
360
+
361
+ .policy-switcher-item.selected {
362
+ background: rgba(139, 92, 246, 0.12);
363
+ color: #ede9fe;
364
+ font-weight: 600;
365
+ }
366
+
367
+ /* Role color coding in the policy list */
368
+ .policy-switcher-item.role-default,
369
+ .policy-switcher-item.role-packaged {
370
+ border-left: 3px solid #60a5fa;
371
+ }
372
+ .policy-switcher-item.role-default .policy-role-badge,
373
+ .policy-switcher-item.role-packaged .policy-role-badge,
374
+ .policy-role-badge.role-default,
375
+ .policy-role-badge.role-packaged {
376
+ background: rgba(37, 99, 235, 0.25);
377
+ color: #93c5fd;
378
+ border: 1px solid rgba(96, 165, 250, 0.35);
379
+ }
380
+ .policy-switcher-item.role-managed {
381
+ border-left: 3px solid #fbbf24;
382
+ }
383
+ .policy-switcher-item.role-managed .policy-role-badge,
384
+ .policy-role-badge.role-managed {
385
+ background: rgba(180, 83, 9, 0.3);
386
+ color: #fde68a;
387
+ border: 1px solid rgba(251, 191, 36, 0.55);
388
+ }
389
+ .policy-switcher-item.role-simulate {
390
+ border-left: 3px solid #c084fc;
391
+ }
392
+ .policy-switcher-item.role-simulate .policy-role-badge,
393
+ .policy-role-badge.role-simulate {
394
+ background: rgba(147, 51, 234, 0.25);
395
+ color: #e9d5ff;
396
+ border: 1px solid rgba(192, 132, 252, 0.4);
397
+ }
398
+ .policy-switcher-item.role-embedded {
399
+ border-left: 3px solid #22d3ee;
400
+ }
401
+ .policy-switcher-item.role-embedded .policy-role-badge,
402
+ .policy-role-badge.role-embedded {
403
+ background: rgba(8, 145, 178, 0.3);
404
+ color: #a5f3fc;
405
+ border: 1px solid rgba(34, 211, 238, 0.4);
406
+ }
407
+
408
+ .policy-role-badge {
409
+ margin-left: auto;
410
+ font-size: 0.65rem;
411
+ font-weight: 700;
412
+ letter-spacing: 0.04em;
413
+ padding: 0.1rem 0.4rem;
414
+ border-radius: 9999px;
415
+ text-transform: uppercase;
416
+ border: 1px solid transparent;
417
+ }
418
+
419
+ .policy-type-control {
420
+ position: relative;
421
+ display: flex;
422
+ align-items: center;
423
+ gap: 0.5rem;
424
+ }
425
+ .policy-type-info-btn {
426
+ display: inline-flex;
427
+ align-items: center;
428
+ justify-content: center;
429
+ width: 1.1rem;
430
+ height: 1.1rem;
431
+ padding: 0;
432
+ border: none;
433
+ background: transparent;
434
+ color: #9ca3af;
435
+ cursor: pointer;
436
+ border-radius: 9999px;
437
+ position: relative;
438
+ }
439
+ .policy-type-info-btn:hover,
440
+ .policy-type-info-btn[aria-expanded="true"] {
441
+ color: #e5e7eb;
442
+ }
443
+ .policy-type-info-btn svg {
444
+ width: 0.95rem;
445
+ height: 0.95rem;
446
+ }
447
+ .policy-type-info-hover {
448
+ position: absolute;
449
+ top: calc(100% + 6px);
450
+ left: 50%;
451
+ transform: translateX(-50%);
452
+ min-width: 12rem;
453
+ max-width: 16rem;
454
+ padding: 0.4rem 0.55rem;
455
+ font-size: 0.7rem;
456
+ line-height: 1.35;
457
+ color: #e5e7eb;
458
+ background: #1a1f2e;
459
+ border: 1px solid rgba(139, 92, 246, 0.2);
460
+ border-radius: 0.375rem;
461
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
462
+ z-index: 110;
463
+ white-space: normal;
464
+ text-align: left;
465
+ pointer-events: none;
466
+ }
467
+ .policy-type-info-pop {
468
+ position: absolute;
469
+ top: calc(100% + 6px);
470
+ left: 0;
471
+ width: 18rem;
472
+ padding: 0.7rem 0.8rem;
473
+ background: #1a1f2e;
474
+ border: 1px solid rgba(139, 92, 246, 0.2);
475
+ border-radius: 0.5rem;
476
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
477
+ z-index: 120;
478
+ }
479
+ .policy-type-info-pop-body {
480
+ margin: 0.45rem 0 0;
481
+ font-size: 0.75rem;
482
+ line-height: 1.45;
483
+ color: #d1d5db;
484
+ }
485
+ .policy-switcher-filters {
486
+ display: flex;
487
+ flex-wrap: wrap;
488
+ gap: 0.35rem;
489
+ padding: 0.5rem 0.75rem 0.35rem;
490
+ border-bottom: 1px solid rgba(255,255,255,0.06);
491
+ }
492
+ .policy-filter-chip {
493
+ font-size: 0.7rem;
494
+ font-weight: 600;
495
+ padding: 0.2rem 0.55rem;
496
+ border-radius: 9999px;
497
+ border: 1px solid rgba(255,255,255,0.12);
498
+ background: rgba(255,255,255,0.04);
499
+ color: #9ca3af;
500
+ cursor: pointer;
501
+ transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
502
+ }
503
+ .policy-filter-chip:hover {
504
+ color: #e5e7eb;
505
+ border-color: rgba(255,255,255,0.2);
506
+ }
507
+ .policy-filter-chip.active {
508
+ color: #f3f4f6;
509
+ border-color: rgba(167, 139, 250, 0.5);
510
+ background: rgba(139, 92, 246, 0.2);
511
+ }
512
+ .policy-filter-chip.active[data-filter="PACKAGED"],
513
+ .policy-filter-chip.active[data-filter="DEFAULT"] {
514
+ border-color: rgba(96, 165, 250, 0.55);
515
+ background: rgba(37, 99, 235, 0.25);
516
+ color: #bfdbfe;
517
+ }
518
+ .policy-filter-chip.active[data-filter="MANAGED"] {
519
+ border-color: rgba(251, 191, 36, 0.55);
520
+ background: rgba(180, 83, 9, 0.3);
521
+ color: #fde68a;
522
+ }
523
+ .policy-filter-chip.active[data-filter="SIMULATE"] {
524
+ border-color: rgba(192, 132, 252, 0.55);
525
+ background: rgba(147, 51, 234, 0.25);
526
+ color: #e9d5ff;
527
+ }
528
+ .policy-filter-chip.active[data-filter="EMBEDDED"] {
529
+ border-color: rgba(34, 211, 238, 0.5);
530
+ background: rgba(8, 145, 178, 0.25);
531
+ color: #a5f3fc;
532
+ }
533
+
534
+ .policy-switcher-name.role-default,
535
+ .policy-switcher-name.role-packaged { color: #93c5fd; }
536
+ .policy-switcher-name.role-managed { color: #fde68a; }
537
+ .policy-switcher-name.role-simulate { color: #e9d5ff; }
538
+ .policy-switcher-name.role-embedded { color: #a5f3fc; }
539
+
540
+ .policy-switcher-empty {
541
+ padding: 0.75rem 0.875rem;
542
+ font-size: 0.8rem;
543
+ color: #6b7280;
544
+ text-align: center;
545
+ }
546
+
547
+ .policy-switcher-check {
548
+ width: 0.875rem;
549
+ height: 0.875rem;
550
+ flex-shrink: 0;
551
+ color: #a78bfa;
552
+ }
553
+
554
+ .policy-switcher-check.invisible {
555
+ visibility: hidden;
556
+ }
557
+
558
+ .policy-switcher-divider {
559
+ height: 1px;
560
+ background: rgba(255,255,255,0.06);
561
+ margin: 0.25rem 0;
562
+ }
563
+
564
+ .policy-switcher-add {
565
+ display: flex;
566
+ align-items: center;
567
+ gap: 0.6rem;
568
+ padding: 0.5rem 0.875rem;
569
+ font-size: 0.875rem;
570
+ color: #a78bfa;
571
+ cursor: pointer;
572
+ transition: background 0.1s ease;
573
+ font-weight: 500;
574
+ }
575
+
576
+ .policy-switcher-add:hover {
577
+ background: rgba(139, 92, 246, 0.1);
578
+ }
579
+ </style>
580
+
581
+ <div class="p-6">
582
+ <!-- Empty State (shown when no policies exist) -->
583
+ <div id="emptyState" class="hidden flex items-center justify-center min-h-[calc(100vh-12rem)]">
584
+ <div class="max-w-2xl w-full">
585
+ <div class="bg-gray-800/95 rounded-lg p-8 shadow-xl text-center mb-6">
586
+ <div class="inline-flex items-center justify-center w-16 h-16 bg-blue-600/20 rounded-full mb-4">
587
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-blue-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
588
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
589
+ </svg>
590
+ </div>
591
+ <h2 class="text-2xl font-bold text-white mb-2">Get Started with Agent Policies</h2>
592
+ <p class="text-gray-300 mb-4">Create your first policy to manage Logstash agent configurations</p>
593
+ <div class="flex justify-center mb-8">
594
+ <button id="emptyStateAddPolicyBtn" class="btn btn-primary flex items-center gap-x-2 glow-button">
595
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
596
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
597
+ </svg>
598
+ Add Your First Policy
599
+ </button>
600
+ </div>
601
+ </div>
602
+ </div>
603
+ </div>
604
+
605
+ <!-- Main Content (shown when policies exist) -->
606
+ <div id="mainContent">
607
+ <!-- Header with Policy Selector and Actions -->
608
+ <div class="bg-gray-800/95 rounded-lg shadow-xl p-4 mb-4">
609
+ <div class="flex items-center justify-between">
610
+ <div class="flex items-center gap-2">
611
+ <!-- Hidden native select — all JS logic targets this -->
612
+ <select id="policySelect" class="hidden">
613
+ <option value="add_new">+ Add Policy</option>
614
+ </select>
615
+ <!-- Headline-style switcher -->
616
+ <div class="policy-switcher" id="policySwitcher">
617
+ <button type="button" class="policy-switcher-btn" id="policySwitcherBtn" onclick="togglePolicySwitcher()">
618
+ <span class="policy-switcher-prefix">Agent Policy</span>
619
+ <span id="policySwitcherLabel" class="policy-switcher-name">Loading...</span>
620
+ <svg class="policy-switcher-chevron w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
621
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M19 9l-7 7-7-7"/>
622
+ </svg>
623
+ </button>
624
+ <div class="policy-switcher-menu hidden" id="policySwitcherMenu"></div>
625
+ </div>
626
+ <button id="clonePolicyBtn" class="btn btn-sm btn-ghost text-blue-400/60 hover:text-blue-300 hover:bg-blue-900/20" onclick="cloneCurrentPolicy()">
627
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
628
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
629
+ </svg>
630
+ </button>
631
+ <button id="deletePolicyBtn" class="btn btn-sm btn-ghost text-red-400/60 hover:text-red-300 hover:bg-red-900/20" onclick="deleteCurrentPolicy()">
632
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
633
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
634
+ </svg>
635
+ </button>
636
+ <!-- Deploy indicator -->
637
+ <div id="deployBtnIndicator" class="hidden flex items-center gap-1 px-2 py-1 bg-orange-500/20 border border-orange-500/40 rounded-full">
638
+ <div class="w-1.5 h-1.5 bg-orange-400 rounded-full animate-pulse"></div>
639
+ <span id="deployBtnIndicatorText" class="text-xs text-orange-300 font-medium whitespace-nowrap"></span>
640
+ </div>
641
+ </div>
642
+ <div class="flex gap-3 items-center">
643
+ <!-- Notification Indicator -->
644
+ <div id="notificationIndicator" class="hidden relative group">
645
+ <button id="notificationIndicatorBtn" class="relative p-2 rounded-full hover:bg-gray-700 transition-colors">
646
+ <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
647
+ <path d="M10 2a6 6 0 00-6 6v3.586l-.707.707A1 1 0 004 14h12a1 1 0 00.707-1.707L16 11.586V8a6 6 0 00-6-6zM10 18a3 3 0 01-3-3h6a3 3 0 01-3 3z" />
648
+ </svg>
649
+ <span id="notificationBadge" class="absolute top-0 right-0 block h-2 w-2 rounded-full ring-2 ring-gray-900"></span>
650
+ </button>
651
+
652
+ <!-- Tooltip -->
653
+ <div id="notificationTooltip" class="hidden group-hover:block absolute right-0 top-full mt-2 w-80 bg-gray-800 rounded-lg shadow-xl border border-gray-700 z-50">
654
+ <div class="p-3">
655
+ <div class="text-sm font-semibold text-white mb-2">Active Notifications</div>
656
+ <div id="notificationTooltipContent" class="space-y-2 text-xs">
657
+ <!-- Notifications will be populated here -->
658
+ </div>
659
+ <div class="mt-2 pt-2 border-t border-gray-700 text-xs text-gray-400">
660
+ Click to navigate to the affected tab
661
+ </div>
662
+ </div>
663
+ </div>
664
+ </div>
665
+
666
+ <!-- Unsaved Changes Indicator -->
667
+ <div id="unsavedChangesIndicator" class="hidden flex items-center gap-2 text-purple-400 text-sm font-medium">
668
+ <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
669
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
670
+ </svg>
671
+ <span>Unsaved Changes</span>
672
+ </div>
673
+
674
+ <button id="saveBtn" class="btn btn-primary px-4 py-2.5">
675
+ <svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
676
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4" />
677
+ </svg>
678
+ Save
679
+ </button>
680
+ <button id="deployBtn" class="btn bg-green-600 hover:bg-green-700 text-white px-4 py-2.5">
681
+ <svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
682
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" />
683
+ </svg>
684
+ Deploy
685
+ </button>
686
+ </div>
687
+ </div>
688
+
689
+ <!-- Policy Stats Row -->
690
+ <div class="grid grid-cols-4 gap-3 mt-4 pt-4 border-t border-gray-700">
691
+ <div class="flex items-center gap-3">
692
+ <div class="w-8 h-8 rounded-lg bg-blue-500/15 flex items-center justify-center flex-shrink-0">
693
+ <svg class="w-4 h-4 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
694
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
695
+ </svg>
696
+ </div>
697
+ <div>
698
+ <div class="text-xs text-gray-400">Revision</div>
699
+ <div id="statRevision" class="text-sm font-semibold text-white">—</div>
700
+ </div>
701
+ </div>
702
+ <div class="flex items-center gap-3">
703
+ <div class="w-8 h-8 rounded-lg bg-green-500/15 flex items-center justify-center flex-shrink-0">
704
+ <svg class="w-4 h-4 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
705
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01" />
706
+ </svg>
707
+ </div>
708
+ <div>
709
+ <div class="text-xs text-gray-400">Managed Instances</div>
710
+ <div id="statInstances" class="text-sm font-semibold text-white">—</div>
711
+ </div>
712
+ </div>
713
+ <div class="flex items-center gap-3">
714
+ <div class="w-8 h-8 rounded-lg bg-purple-500/15 flex items-center justify-center flex-shrink-0">
715
+ <svg class="w-4 h-4 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
716
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
717
+ </svg>
718
+ </div>
719
+ <div>
720
+ <div class="text-xs text-gray-400">Last Deployed</div>
721
+ <div id="statLastDeployed" class="text-sm font-semibold text-white">—</div>
722
+ </div>
723
+ </div>
724
+ <div class="flex items-center gap-3">
725
+ <div class="w-8 h-8 rounded-lg bg-orange-500/15 flex items-center justify-center flex-shrink-0">
726
+ <svg class="w-4 h-4 text-orange-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
727
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
728
+ </svg>
729
+ </div>
730
+ <div>
731
+ <div class="text-xs text-gray-400">Undeployed Changes</div>
732
+ <div id="statPendingChanges" class="text-sm font-semibold text-white">—</div>
733
+ </div>
734
+ </div>
735
+ </div>
736
+ </div>
737
+
738
+ <!-- Global Config Section -->
739
+ <div class="bg-gray-800/95 rounded-lg shadow-xl p-4 mb-4">
740
+ <div class="flex items-center mb-2 gap-3">
741
+ <button id="globalConfigToggle" class="flex items-center gap-2 text-white font-medium hover:text-blue-400 transition-colors relative">
742
+ <svg class="w-5 h-5 transform transition-transform" id="globalConfigChevron" fill="none" stroke="currentColor" viewBox="0 0 24 24">
743
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
744
+ </svg>
745
+ Policy Config
746
+ </button>
747
+ <div id="policyTypeControl" class="policy-type-control">
748
+ <select id="policyTypeSelect" class="select select-xs select-bordered bg-gray-700 text-white border-gray-600 opacity-50 cursor-not-allowed" disabled aria-label="Policy type">
749
+ <option value="PACKAGED" selected>Packaged</option>
750
+ <option value="MANAGED">Managed</option>
751
+ <option value="SIMULATE">Simulate</option>
752
+ </select>
753
+ <button type="button" id="policyTypeInfoBtn" class="policy-type-info-btn" aria-label="About this policy type" aria-expanded="false" aria-describedby="policyTypeInfoHover">
754
+ <svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
755
+ <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/>
756
+ </svg>
757
+ <span id="policyTypeInfoHover" class="policy-type-info-hover hidden" role="tooltip">Distro Logstash as a system service.</span>
758
+ </button>
759
+ <span id="policySystemBadge" class="hidden px-2 py-0.5 rounded-full text-xs font-semibold bg-blue-900/50 text-blue-300 border border-blue-500/40">System</span>
760
+ <div id="policyTypeInfoPop" class="policy-type-info-pop hidden" role="dialog" aria-label="Policy type details">
761
+ <span id="policyTypeInfoPopBadge" class="policy-role-badge role-packaged">PACKAGED</span>
762
+ <p id="policyTypeInfoPopBody" class="policy-type-info-pop-body"></p>
763
+ </div>
764
+ </div>
765
+ <span id="policyConfigChangedIndicator" class="hidden w-2 h-2 bg-purple-500 rounded-full" style="box-shadow: 0 0 8px rgba(168, 85, 247, 0.8);"></span>
766
+ </div>
767
+ <div id="globalConfigContent" class="mt-3 space-y-3">
768
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
769
+ <div>
770
+ <label class="block text-sm font-medium text-gray-300 mb-1 flex items-center gap-1">
771
+ Settings Path:
772
+ <span id="settingsPathNotification" class="hidden tooltip tooltip-bottom" data-tip="">
773
+ <svg class="w-3.5 h-3.5 text-gray-400 cursor-default" fill="currentColor" viewBox="0 0 20 20">
774
+ <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/>
775
+ </svg>
776
+ </span>
777
+ </label>
778
+ <input type="text" id="settingsPath" value="/etc/logstash/" class="input input-bordered input-sm w-full bg-gray-700 text-white border-gray-600">
779
+ </div>
780
+ <div>
781
+ <label class="block text-sm font-medium text-gray-300 mb-1 flex items-center gap-1">
782
+ Logs Path:
783
+ <span id="logsPathNotification" class="hidden tooltip tooltip-bottom" data-tip="">
784
+ <svg class="w-3.5 h-3.5 text-gray-400 cursor-default" fill="currentColor" viewBox="0 0 20 20">
785
+ <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/>
786
+ </svg>
787
+ </span>
788
+ </label>
789
+ <input type="text" id="logsPath" value="/var/log/logstash" class="input input-bordered input-sm w-full bg-gray-700 text-white border-gray-600">
790
+ </div>
791
+ <div>
792
+ <label class="block text-sm font-medium text-gray-300 mb-1 flex items-center gap-1">
793
+ Binary Path:
794
+ <span id="binaryPathNotification" class="hidden tooltip tooltip-bottom" data-tip="">
795
+ <svg class="w-3.5 h-3.5 text-gray-400 cursor-default" fill="currentColor" viewBox="0 0 20 20">
796
+ <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/>
797
+ </svg>
798
+ </span>
799
+ </label>
800
+ <input type="text" id="binaryPath" value="/usr/share/logstash/bin" class="input input-bordered input-sm w-full bg-gray-700 text-white border-gray-600">
801
+ </div>
802
+ </div>
803
+
804
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
805
+ <div>
806
+ <label class="block text-sm font-medium text-gray-300 mb-1">Data Path <span class="text-gray-500 font-normal">(optional)</span>:</label>
807
+ <input type="text" id="dataPath" value="" placeholder="e.g. /var/lib/logstash" class="input input-bordered input-sm w-full bg-gray-700 text-white border-gray-600">
808
+ <p class="mt-1 text-xs text-gray-500">Simulate instances use <code class="text-gray-400">/opt/logstash-agent/simulate-N/data</code> at enroll.</p>
809
+ </div>
810
+ <div>
811
+ <label class="block text-sm font-medium text-gray-300 mb-1">Keystore env file:</label>
812
+ <input type="text" id="keystoreEnvFile" value="/etc/default/logstash" class="input input-bordered input-sm w-full bg-gray-700 text-white border-gray-600">
813
+ <p class="mt-1 text-xs text-gray-500">Where <code class="text-gray-400">LOGSTASH_KEYSTORE_PASS</code> is written for systemd.</p>
814
+ </div>
815
+ </div>
816
+
817
+ <!-- Simulate / Managed binary source fields -->
818
+ <div id="simulatePolicyFields" class="hidden border border-purple-500/30 rounded-lg p-3 space-y-3 bg-purple-950/20">
819
+ <div class="text-sm font-medium text-purple-300">Logstash binary source (simulate / managed)</div>
820
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
821
+ <div>
822
+ <label class="block text-sm font-medium text-gray-300 mb-1">Source:</label>
823
+ <select id="logstashSource" class="select select-bordered select-sm w-full bg-gray-700 text-white border-gray-600">
824
+ <option value="SYSTEM">SYSTEM — host install / binary path</option>
825
+ <option value="VERSION">VERSION — download pinned release</option>
826
+ </select>
827
+ </div>
828
+ <div id="logstashVersionWrap">
829
+ <label class="block text-sm font-medium text-gray-300 mb-1">Version:</label>
830
+ <input type="text" id="logstashVersion" value="" placeholder="e.g. 9.4.3" class="input input-bordered input-sm w-full bg-gray-700 text-white border-gray-600">
831
+ </div>
832
+ <div id="logstashDownloadDirWrap">
833
+ <label class="block text-sm font-medium text-gray-300 mb-1">Download directory:</label>
834
+ <input type="text" id="logstashDownloadDir" value="/opt/logstash-agent/logstash-versions" class="input input-bordered input-sm w-full bg-gray-700 text-white border-gray-600">
835
+ </div>
836
+ </div>
837
+ <div id="logstashViaUiWrap" class="hidden">
838
+ <label class="flex items-start gap-2 cursor-pointer">
839
+ <input type="checkbox" id="logstashViaUi" class="checkbox checkbox-sm mt-1 border-gray-600">
840
+ <span class="text-sm text-gray-300">
841
+ Download the tarball from LogstashUI
842
+ <span class="block text-xs text-gray-400">
843
+ LogstashUI fetches each release once and serves it to every agent, instead of
844
+ each agent pulling ~450&nbsp;MB from artifacts.elastic.co. Required for air-gapped
845
+ sites. Manage the cache in <strong>Management → Logstash Tarballs</strong>.
846
+ </span>
847
+ </span>
848
+ </label>
849
+ </div>
850
+ <p id="versionLifecycleHint" class="hidden text-xs text-cyan-200/90 bg-cyan-950/30 border border-cyan-500/25 rounded px-2 py-1.5">
851
+ <strong class="text-cyan-100">VERSION lifecycle:</strong>
852
+ Save this policy — enrolled agents download the pin on the next check-in
853
+ (no separate Deploy needed for binary-only changes), write
854
+ <code class="text-cyan-100">LOGSTASH_BINARY</code> into the instance env,
855
+ and restart Logstash when the binary path changes.
856
+ Host cache: <code class="text-cyan-100">/opt/logstash-agent/logstash-versions</code>
857
+ (<code class="text-cyan-100">logstash-agent list-versions</code> /
858
+ <code class="text-cyan-100">ensure-version</code> /
859
+ <code class="text-cyan-100">prune-versions</code>).
860
+ </p>
861
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
862
+ <div>
863
+ <label class="block text-sm font-medium text-gray-300 mb-1">Default agent API port:</label>
864
+ <input type="number" id="agentApiPort" value="9500" class="input input-bordered input-sm w-full bg-gray-700 text-white border-gray-600" title="Managed enroll is 9550+N; Simulate is 9500+N; Packaged uses 9550 as-is">
865
+ <p id="agentApiPortHint" class="mt-1 text-xs text-gray-500">Enroll assigns <strong class="text-gray-400">base+N</strong> per instance (Managed 9550+N, Simulate 9500+N).</p>
866
+ </div>
867
+ <div>
868
+ <label class="block text-sm font-medium text-gray-300 mb-1">Default Logstash API port:</label>
869
+ <input type="number" id="logstashApiPort" value="9560" class="input input-bordered input-sm w-full bg-gray-700 text-white border-gray-600" title="Managed enroll is 9700+N; Simulate is 9560+N; Packaged uses 9600 as-is">
870
+ <p id="logstashApiPortHint" class="mt-1 text-xs text-gray-500">Enroll assigns <strong class="text-gray-400">base+N</strong> per instance (Managed 9700+N, Simulate 9560+N).</p>
871
+ </div>
872
+ </div>
873
+ </div>
874
+
875
+ <div id="policyLockBanner" class="hidden text-xs text-amber-300 bg-amber-900/20 border border-amber-500/30 rounded px-3 py-2"></div>
876
+ </div>
877
+ </div>
878
+
879
+ <!-- File Tabs and Editor -->
880
+ <div class="bg-gray-800/95 rounded-lg shadow-xl overflow-hidden">
881
+ <!-- File Tabs -->
882
+ <div class="flex items-center justify-between bg-gray-900 border-b border-gray-700">
883
+ <div class="flex items-center">
884
+ <!-- Config Files Section -->
885
+ <div class="file-tab active" data-file="logstash.yml">
886
+ <svg class="w-3.5 h-3.5 mr-1.5 opacity-60" fill="none" stroke="currentColor" viewBox="0 0 24 24">
887
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
888
+ </svg>
889
+ <span class="text-white text-sm font-semibold">logstash.yml</span>
890
+ </div>
891
+ <div class="file-tab" data-file="jvm.options">
892
+ <svg class="w-3.5 h-3.5 mr-1.5 opacity-40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
893
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
894
+ </svg>
895
+ <span class="text-gray-500 text-sm">jvm.options</span>
896
+ </div>
897
+ <div class="file-tab" data-file="log4j2.properties">
898
+ <svg class="w-3.5 h-3.5 mr-1.5 opacity-40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
899
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
900
+ </svg>
901
+ <span class="text-gray-500 text-sm">log4j2.properties</span>
902
+ </div>
903
+
904
+ <!-- Visual Separator -->
905
+ <div class="h-6 w-px bg-gradient-to-b from-transparent via-gray-600/50 to-transparent mx-3 self-center"></div>
906
+
907
+ <!-- Pipeline & Keystore Section -->
908
+ <div class="file-tab" data-file="pipelines">
909
+ <svg class="w-3.5 h-3.5 mr-1.5 opacity-40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
910
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4" />
911
+ </svg>
912
+ <span class="text-gray-500 text-sm">Pipelines</span>
913
+ </div>
914
+ <div class="file-tab" data-file="keystore">
915
+ <svg class="w-3.5 h-3.5 mr-1.5 opacity-40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
916
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
917
+ </svg>
918
+ <span class="text-gray-500 text-sm">Keystore</span>
919
+ </div>
920
+
921
+ <!-- Visual Separator -->
922
+ <div class="h-6 w-px bg-gradient-to-b from-transparent via-gray-600/50 to-transparent mx-3 self-center"></div>
923
+
924
+ <!-- Agents Section -->
925
+ <div class="file-tab" data-file="nodes">
926
+ <svg class="w-3.5 h-3.5 mr-1.5 opacity-40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
927
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01" />
928
+ </svg>
929
+ <span class="text-gray-500 text-sm">Agents</span>
930
+ </div>
931
+
932
+ <!-- Enrollment Tokens Section -->
933
+ <div class="file-tab" data-file="enrollment-tokens">
934
+ <svg class="w-3.5 h-3.5 mr-1.5 opacity-40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
935
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
936
+ </svg>
937
+ <span class="text-gray-500 text-sm">Enrollment Tokens</span>
938
+ </div>
939
+ </div>
940
+
941
+ <!-- Mode Toggle (only visible for logstash.yml) -->
942
+ <div id="modeToggleContainer" class="pr-4">
943
+ <span class="text-gray-400 text-sm mr-2">Mode:</span>
944
+ <div class="mode-toggle">
945
+ <button id="formModeBtn" class="active">Form</button>
946
+ <button id="codeModeBtn">YML</button>
947
+ </div>
948
+ </div>
949
+ </div>
950
+
951
+ <!-- Editor Area -->
952
+ <div class="flex flex-col flex-1 overflow-hidden">
953
+ <!-- Banner row — layout varies by tab -->
954
+ <div id="bannerRow" class="mx-4 mt-4 mb-3 grid gap-3 flex-shrink-0" style="grid-template-columns: 1fr;">
955
+
956
+ <!-- Guided Setup (logstash.yml only) -->
957
+ <div id="quickSetupRow" class="hidden p-3 bg-purple-900/20 border border-purple-500/40 rounded-lg">
958
+ <div class="flex items-center justify-between h-full">
959
+ <div class="flex items-center gap-2">
960
+ <svg class="w-4 h-4 text-purple-400 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
961
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
962
+ </svg>
963
+ <span class="text-sm text-purple-300 font-medium">Guided Setup</span>
964
+ </div>
965
+ <div class="flex gap-2">
966
+ <button id="defaultGuideBtn" onclick="openDefaultGuideModal()" class="px-3 py-1.5 bg-gray-700/50 hover:bg-gray-600 border border-gray-600 hover:border-gray-500 text-gray-200 text-sm rounded-full transition-all hover:shadow-md">
967
+ <span class="flex items-center gap-1.5">
968
+ <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
969
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
970
+ </svg>
971
+ Default
972
+ </span>
973
+ </button>
974
+ <button onclick="openCentralizedPipelineManagementModal()" class="px-3 py-1.5 bg-gray-700/50 hover:bg-gray-600 border border-gray-600 hover:border-gray-500 text-gray-200 text-sm rounded-full transition-all hover:shadow-md">
975
+ <span class="flex items-center gap-1.5">
976
+ <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
977
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01" />
978
+ </svg>
979
+ Centralized
980
+ </span>
981
+ </button>
982
+ </div>
983
+ </div>
984
+ </div>
985
+
986
+ <!-- Requirements tile (logstash.yml only) -->
987
+ <div id="requirementsTile" class="hidden p-3 border rounded-lg cursor-pointer transition-all requirement-tile-ok" onclick="openDefaultGuideModal()">
988
+ <div class="flex items-center justify-between h-full">
989
+ <div class="flex items-center gap-2">
990
+ <svg id="requirementsIcon" class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
991
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
992
+ </svg>
993
+ <span id="requirementsLabel" class="text-sm font-medium">Requirements</span>
994
+ </div>
995
+ <span id="requirementsBadge" class="hidden text-xs font-semibold px-2 py-0.5 rounded-full bg-pink-900/40 text-pink-300 border border-pink-500/40"></span>
996
+ </div>
997
+ <!-- Hidden stubs kept so existing JS still finds them without errors -->
998
+ <div id="logsPathMismatchNotification" class="hidden"></div>
999
+ <div id="logLevelFormatNotification" class="hidden"></div>
1000
+ </div>
1001
+
1002
+ <!-- Tip tile (pipelines / keystore only) -->
1003
+ <div id="tipTile" class="hidden p-3 bg-amber-900/15 border border-amber-500/30 rounded-lg flex items-center gap-2">
1004
+ <svg class="w-4 h-4 text-amber-400 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1005
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" />
1006
+ </svg>
1007
+ <span id="tipText" class="text-sm text-amber-300/80"></span>
1008
+ </div>
1009
+
1010
+ <!-- Documentation link — always visible, full tile clickable -->
1011
+ <a id="docsLink" href="https://www.elastic.co/docs/reference/logstash/logstash-settings-file" target="_blank" class="p-3 bg-blue-900/20 border border-blue-500/40 rounded-lg flex items-center gap-2 hover:bg-blue-900/30 transition-colors no-underline">
1012
+ <svg class="w-4 h-4 text-blue-400 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1013
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253" />
1014
+ </svg>
1015
+ <span class="text-sm text-blue-300 font-medium">Documentation</span>
1016
+ </a>
1017
+
1018
+ </div>
1019
+
1020
+ <!-- Notifications Container (warnings only — unsafe shutdown, superuser, config debug, batch delay) -->
1021
+ <div id="notificationsContainer" class="mx-4 mb-3 space-y-2 flex-shrink-0 hidden">
1022
+ <!-- Unsafe Shutdown Notification -->
1023
+ <div id="unsafeShutdownNotification" class="p-3 bg-red-900/20 border border-red-500/40 rounded-lg cursor-pointer hover:bg-red-900/30 transition-colors hidden" onclick="fixUnsafeShutdown()">
1024
+ <div class="flex items-start gap-3">
1025
+ <svg class="w-5 h-5 text-red-400 flex-shrink-0 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1026
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
1027
+ </svg>
1028
+ <div class="flex-1">
1029
+ <div class="text-sm font-medium text-red-300 mb-1">Unsafe Shutdown Enabled</div>
1030
+ <div class="text-xs text-gray-300">This could result in data loss. Click here to set it back to the default (false).</div>
1031
+ </div>
1032
+ <svg class="w-5 h-5 text-red-400 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1033
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7l5 5m0 0l-5 5m5-5H6" />
1034
+ </svg>
1035
+ </div>
1036
+ </div>
1037
+
1038
+ <!-- Allow Superuser Notification -->
1039
+ <div id="allowSuperuserNotification" class="p-3 bg-yellow-900/20 border border-yellow-500/40 rounded-lg cursor-pointer hover:bg-yellow-900/30 transition-colors hidden" onclick="fixAllowSuperuser()">
1040
+ <div class="flex items-start gap-3">
1041
+ <svg class="w-5 h-5 text-yellow-400 flex-shrink-0 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1042
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
1043
+ </svg>
1044
+ <div class="flex-1">
1045
+ <div class="text-sm font-medium text-yellow-300 mb-1">Allow Superuser Enabled</div>
1046
+ <div class="text-xs text-gray-300">We don't recommend using this setting for security purposes. Click to set back to the default (false).</div>
1047
+ </div>
1048
+ <svg class="w-5 h-5 text-yellow-400 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1049
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7l5 5m0 0l-5 5m5-5H6" />
1050
+ </svg>
1051
+ </div>
1052
+ </div>
1053
+
1054
+ <!-- Config Debug Notification -->
1055
+ <div id="configDebugNotification" class="p-3 bg-yellow-900/20 border border-yellow-500/40 rounded-lg cursor-pointer hover:bg-yellow-900/30 transition-colors hidden" onclick="fixConfigDebug()">
1056
+ <div class="flex items-start gap-3">
1057
+ <svg class="w-5 h-5 text-yellow-400 flex-shrink-0 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1058
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
1059
+ </svg>
1060
+ <div class="flex-1">
1061
+ <div class="text-sm font-medium text-yellow-300 mb-1">Config Debug Enabled</div>
1062
+ <div class="text-xs text-gray-300">This prints your fully compiled pipeline configuration into the logs as a debug log message. We don't recommend enabling this. Click to set it back to default (false).</div>
1063
+ </div>
1064
+ <svg class="w-5 h-5 text-yellow-400 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1065
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7l5 5m0 0l-5 5m5-5H6" />
1066
+ </svg>
1067
+ </div>
1068
+ </div>
1069
+
1070
+ <!-- Batch Delay Notification -->
1071
+ <div id="batchDelayNotification" class="p-3 bg-yellow-900/20 border border-yellow-500/40 rounded-lg cursor-pointer hover:bg-yellow-900/30 transition-colors hidden" onclick="fixBatchDelay()">
1072
+ <div class="flex items-start gap-3">
1073
+ <svg class="w-5 h-5 text-yellow-400 flex-shrink-0 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1074
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
1075
+ </svg>
1076
+ <div class="flex-1">
1077
+ <div class="text-sm font-medium text-yellow-300 mb-1">Batch Delay Modified</div>
1078
+ <div class="text-xs text-gray-300">It's typically not a good idea to change this setting. Click to set it to the default.</div>
1079
+ </div>
1080
+ <svg class="w-5 h-5 text-yellow-400 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1081
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7l5 5m0 0l-5 5m5-5H6" />
1082
+ </svg>
1083
+ </div>
1084
+ </div>
1085
+ </div>
1086
+
1087
+ <!-- Form Mode -->
1088
+ <div id="formModeEditor" class="flex-1 overflow-y-auto px-4">
1089
+ <div class="space-y-6 pb-6">
1090
+
1091
+ <!-- Row 1: Node Identity + Data Path -->
1092
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
1093
+ <!-- Node Identity Section -->
1094
+ <div class="bg-gray-900/50 rounded-lg p-4">
1095
+ <h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
1096
+ <svg class="w-5 h-5 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1097
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
1098
+ </svg>
1099
+ Node Identity
1100
+ </h3>
1101
+ <div class="space-y-3">
1102
+ <div>
1103
+ <label class="block text-sm font-medium text-gray-300 mb-1">Node Name</label>
1104
+ <input type="text" name="node.name" placeholder="e.g., test" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1105
+ <p class="text-xs text-gray-500 mt-1">Descriptive name for the node (defaults to hostname if omitted)</p>
1106
+ </div>
1107
+ </div>
1108
+ </div>
1109
+
1110
+ <!-- Data Path Section -->
1111
+ <div class="bg-gray-900/50 rounded-lg p-4">
1112
+ <h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
1113
+ <svg class="w-5 h-5 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1114
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
1115
+ </svg>
1116
+ Data Path
1117
+ </h3>
1118
+ <div class="space-y-3">
1119
+ <div>
1120
+ <label class="block text-sm font-medium text-gray-300 mb-1">Data Directory</label>
1121
+ <input type="text" name="path.data" placeholder="Defaults to LOGSTASH_HOME/data" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1122
+ <p class="text-xs text-gray-500 mt-1">Directory for persistent data storage</p>
1123
+ </div>
1124
+ </div>
1125
+ </div>
1126
+ </div>
1127
+
1128
+ <!-- Row 2: Pipeline Settings + API Settings -->
1129
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
1130
+ <!-- Pipeline Settings Section -->
1131
+ <div class="bg-gray-900/50 rounded-lg p-4">
1132
+ <h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
1133
+ <svg class="w-5 h-5 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1134
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
1135
+ </svg>
1136
+ Pipeline Settings
1137
+ </h3>
1138
+
1139
+ <!-- Common Settings -->
1140
+ <div class="grid grid-cols-2 gap-4">
1141
+ <div>
1142
+ <label class="block text-sm font-medium text-gray-300 mb-1">Pipeline ID</label>
1143
+ <input type="text" name="pipeline.id" placeholder="main" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1144
+ </div>
1145
+ <div>
1146
+ <label class="block text-sm font-medium text-gray-300 mb-1">Workers</label>
1147
+ <input type="number" name="pipeline.workers" placeholder="Defaults to CPU cores" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1148
+ </div>
1149
+ <div>
1150
+ <label class="block text-sm font-medium text-gray-300 mb-1">Batch Size</label>
1151
+ <input type="number" name="pipeline.batch.size" placeholder="125" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1152
+ </div>
1153
+ <div>
1154
+ <label class="block text-sm font-medium text-gray-300 mb-1">Batch Delay (ms)</label>
1155
+ <input type="number" name="pipeline.batch.delay" placeholder="50" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1156
+ </div>
1157
+ </div>
1158
+
1159
+ <!-- Advanced Settings Toggle -->
1160
+ <div class="mt-4">
1161
+ <button type="button" onclick="toggleAdvanced('pipeline-advanced')" class="flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300">
1162
+ <svg id="pipeline-advanced-icon" class="w-4 h-4 transform transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1163
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
1164
+ </svg>
1165
+ Advanced
1166
+ </button>
1167
+ </div>
1168
+
1169
+ <!-- Advanced Settings (Hidden by default) -->
1170
+ <div id="pipeline-advanced" class="hidden mt-4 grid grid-cols-2 gap-4">
1171
+ <div>
1172
+ <label class="block text-sm font-medium text-gray-300 mb-1">Output Chunking Growth Factor</label>
1173
+ <input type="number" name="pipeline.batch.output_chunking.growth_threshold_factor" placeholder="1000" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1174
+ <p class="text-xs text-gray-500 mt-1">Default 1000 (effectively disabled)</p>
1175
+ </div>
1176
+ <div>
1177
+ <label class="block text-sm font-medium text-gray-300 mb-1">Batch Metrics Sampling</label>
1178
+ <select name="pipeline.batch.metrics.sampling_mode" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1179
+ <option value="">Default (minimal)</option>
1180
+ <option value="disabled">Disabled</option>
1181
+ <option value="minimal">Minimal</option>
1182
+ <option value="full">Full</option>
1183
+ </select>
1184
+ </div>
1185
+ <div>
1186
+ <label class="block text-sm font-medium text-gray-300 mb-1">Unsafe Shutdown</label>
1187
+ <select name="pipeline.unsafe_shutdown" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1188
+ <option value="">Default (false)</option>
1189
+ <option value="true">True</option>
1190
+ <option value="false">False</option>
1191
+ </select>
1192
+ <p class="text-xs text-red-400 mt-1">⚠️ Can lead to data loss</p>
1193
+ </div>
1194
+ <div>
1195
+ <label class="block text-sm font-medium text-gray-300 mb-1">Event Ordering</label>
1196
+ <select name="pipeline.ordered" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1197
+ <option value="">Default (auto)</option>
1198
+ <option value="auto">Auto</option>
1199
+ <option value="true">True</option>
1200
+ <option value="false">False</option>
1201
+ </select>
1202
+ </div>
1203
+ <div>
1204
+ <label class="block text-sm font-medium text-gray-300 mb-1">ECS Compatibility</label>
1205
+ <select name="pipeline.ecs_compatibility" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1206
+ <option value="">Default (v8)</option>
1207
+ <option value="disabled">Disabled</option>
1208
+ <option value="v1">v1</option>
1209
+ <option value="v8">v8</option>
1210
+ </select>
1211
+ </div>
1212
+ <div>
1213
+ <label class="block text-sm font-medium text-gray-300 mb-1">Separate Logs</label>
1214
+ <select name="pipeline.separate_logs" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1215
+ <option value="">Default (false)</option>
1216
+ <option value="true">True</option>
1217
+ <option value="false">False</option>
1218
+ </select>
1219
+ </div>
1220
+ <div>
1221
+ <label class="block text-sm font-medium text-gray-300 mb-1">Buffer Type</label>
1222
+ <select name="pipeline.buffer.type" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1223
+ <option value="">Default (heap)</option>
1224
+ <option value="heap">Heap</option>
1225
+ <option value="direct">Direct</option>
1226
+ </select>
1227
+ </div>
1228
+ </div>
1229
+ </div>
1230
+
1231
+ <!-- API Settings Section -->
1232
+ <div class="bg-gray-900/50 rounded-lg p-4">
1233
+ <h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
1234
+ <svg class="w-5 h-5 text-yellow-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1235
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" />
1236
+ </svg>
1237
+ API Settings
1238
+ </h3>
1239
+
1240
+ <!-- Common Settings -->
1241
+ <div class="grid grid-cols-2 gap-4">
1242
+ <div>
1243
+ <label class="block text-sm font-medium text-gray-300 mb-1">API Enabled</label>
1244
+ <select name="api.enabled" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1245
+ <option value="">Default (true)</option>
1246
+ <option value="true">Enabled</option>
1247
+ <option value="false">Disabled</option>
1248
+ </select>
1249
+ </div>
1250
+ <div>
1251
+ <label class="block text-sm font-medium text-gray-300 mb-1">API Host</label>
1252
+ <input type="text" name="api.http.host" placeholder="127.0.0.1" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1253
+ </div>
1254
+ <div>
1255
+ <label class="block text-sm font-medium text-gray-300 mb-1">API Port</label>
1256
+ <input type="text" name="api.http.port" placeholder="9600-9700" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1257
+ </div>
1258
+ <div>
1259
+ <label class="block text-sm font-medium text-gray-300 mb-1">Environment</label>
1260
+ <input type="text" name="api.environment" placeholder="production" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1261
+ </div>
1262
+ </div>
1263
+
1264
+ <!-- Advanced Settings Toggle -->
1265
+ <div class="mt-4">
1266
+ <button type="button" onclick="toggleAdvanced('api-advanced')" class="flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300">
1267
+ <svg id="api-advanced-icon" class="w-4 h-4 transform transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1268
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
1269
+ </svg>
1270
+ Advanced
1271
+ </button>
1272
+ </div>
1273
+
1274
+ <!-- Advanced Settings (Hidden by default) -->
1275
+ <div id="api-advanced" class="hidden mt-4 grid grid-cols-2 gap-4">
1276
+ <div>
1277
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Enabled</label>
1278
+ <select name="api.ssl.enabled" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1279
+ <option value="">Default (false)</option>
1280
+ <option value="true">True</option>
1281
+ <option value="false">False</option>
1282
+ </select>
1283
+ </div>
1284
+ <div>
1285
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Keystore Path</label>
1286
+ <input type="text" name="api.ssl.keystore.path" placeholder="/path/to/keystore.jks" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1287
+ </div>
1288
+ <div>
1289
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Keystore Password</label>
1290
+ <input type="password" name="api.ssl.keystore.password" placeholder="Password" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1291
+ </div>
1292
+ <div class="col-span-2">
1293
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Supported Protocols</label>
1294
+ <input type="text" name="api.ssl.supported_protocols" placeholder="TLSv1.2, TLSv1.3" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1295
+ <p class="text-xs text-gray-500 mt-1">Comma-separated list (e.g., TLSv1.2,TLSv1.3)</p>
1296
+ </div>
1297
+ <div>
1298
+ <label class="block text-sm font-medium text-gray-300 mb-1">Auth Type</label>
1299
+ <select name="api.auth.type" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1300
+ <option value="">Default (none)</option>
1301
+ <option value="none">None</option>
1302
+ <option value="basic">Basic</option>
1303
+ </select>
1304
+ </div>
1305
+ <div>
1306
+ <label class="block text-sm font-medium text-gray-300 mb-1">Basic Auth Username</label>
1307
+ <input type="text" name="api.auth.basic.username" placeholder="logstash-user" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1308
+ </div>
1309
+ <div>
1310
+ <label class="block text-sm font-medium text-gray-300 mb-1">Basic Auth Password</label>
1311
+ <input type="password" name="api.auth.basic.password" placeholder="Password" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1312
+ </div>
1313
+ <div>
1314
+ <label class="block text-sm font-medium text-gray-300 mb-1">Password Policy Mode</label>
1315
+ <select name="api.auth.basic.password_policy.mode" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1316
+ <option value="">Default (WARN)</option>
1317
+ <option value="WARN">WARN</option>
1318
+ <option value="ERROR">ERROR</option>
1319
+ </select>
1320
+ </div>
1321
+ </div>
1322
+ </div>
1323
+ </div>
1324
+
1325
+ <!-- Row 3: Queue Settings + Dead Letter Queue -->
1326
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
1327
+ <!-- Queue Settings Section -->
1328
+ <div class="bg-gray-900/50 rounded-lg p-4">
1329
+ <h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
1330
+ <svg class="w-5 h-5 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1331
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7h16M4 12h16M4 17h16" />
1332
+ </svg>
1333
+ Queue Settings
1334
+ </h3>
1335
+
1336
+ <!-- Common Settings -->
1337
+ <div class="grid grid-cols-2 gap-4">
1338
+ <div>
1339
+ <label class="block text-sm font-medium text-gray-300 mb-1">Queue Type</label>
1340
+ <select name="queue.type" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1341
+ <option value="">Default (memory)</option>
1342
+ <option value="memory">Memory</option>
1343
+ <option value="persisted">Persisted</option>
1344
+ </select>
1345
+ </div>
1346
+ <div>
1347
+ <label class="block text-sm font-medium text-gray-300 mb-1">Max Bytes</label>
1348
+ <input type="text" name="queue.max_bytes" placeholder="1024mb" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1349
+ </div>
1350
+ </div>
1351
+
1352
+ <!-- Advanced Settings Toggle -->
1353
+ <div class="mt-4">
1354
+ <button type="button" onclick="toggleAdvanced('queue-advanced')" class="flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300">
1355
+ <svg id="queue-advanced-icon" class="w-4 h-4 transform transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1356
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
1357
+ </svg>
1358
+ Advanced
1359
+ </button>
1360
+ </div>
1361
+
1362
+ <!-- Advanced Settings (Hidden by default) -->
1363
+ <div id="queue-advanced" class="hidden mt-4 grid grid-cols-2 gap-4">
1364
+ <div>
1365
+ <label class="block text-sm font-medium text-gray-300 mb-1">Queue Path</label>
1366
+ <input type="text" name="path.queue" placeholder="path.data/queue" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1367
+ </div>
1368
+ <div>
1369
+ <label class="block text-sm font-medium text-gray-300 mb-1">Page Capacity</label>
1370
+ <input type="text" name="queue.page_capacity" placeholder="64mb" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1371
+ </div>
1372
+ <div>
1373
+ <label class="block text-sm font-medium text-gray-300 mb-1">Max Events</label>
1374
+ <input type="number" name="queue.max_events" placeholder="0 (unlimited)" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1375
+ </div>
1376
+ <div>
1377
+ <label class="block text-sm font-medium text-gray-300 mb-1">Max Bytes</label>
1378
+ <input type="text" name="queue.max_bytes" placeholder="1024mb" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1379
+ </div>
1380
+ <div>
1381
+ <label class="block text-sm font-medium text-gray-300 mb-1">Checkpoint Acks</label>
1382
+ <input type="number" name="queue.checkpoint.acks" placeholder="1024" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1383
+ </div>
1384
+ <div>
1385
+ <label class="block text-sm font-medium text-gray-300 mb-1">Checkpoint Writes</label>
1386
+ <input type="number" name="queue.checkpoint.writes" placeholder="1024" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1387
+ </div>
1388
+ <div>
1389
+ <label class="block text-sm font-medium text-gray-300 mb-1">Compression</label>
1390
+ <select name="queue.compression" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1391
+ <option value="">Default (none)</option>
1392
+ <option value="none">None</option>
1393
+ <option value="speed">Speed</option>
1394
+ <option value="balanced">Balanced</option>
1395
+ <option value="size">Size</option>
1396
+ </select>
1397
+ </div>
1398
+ </div>
1399
+ </div>
1400
+
1401
+ <!-- Dead Letter Queue Section -->
1402
+ <div class="bg-gray-900/50 rounded-lg p-4">
1403
+ <h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
1404
+ <svg class="w-5 h-5 text-red-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1405
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
1406
+ </svg>
1407
+ Dead Letter Queue
1408
+ </h3>
1409
+
1410
+ <!-- Common Settings -->
1411
+ <div class="grid grid-cols-2 gap-4">
1412
+ <div>
1413
+ <label class="block text-sm font-medium text-gray-300 mb-1">DLQ Enabled</label>
1414
+ <select name="dead_letter_queue.enable" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1415
+ <option value="">Default (false)</option>
1416
+ <option value="true">Enabled</option>
1417
+ <option value="false">Disabled</option>
1418
+ </select>
1419
+ </div>
1420
+ <div>
1421
+ <label class="block text-sm font-medium text-gray-300 mb-1">Max Bytes</label>
1422
+ <input type="text" name="dead_letter_queue.max_bytes" placeholder="1024mb" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1423
+ </div>
1424
+ </div>
1425
+
1426
+ <!-- Advanced Settings Toggle -->
1427
+ <div class="mt-4">
1428
+ <button type="button" onclick="toggleAdvanced('dlq-advanced')" class="flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300">
1429
+ <svg id="dlq-advanced-icon" class="w-4 h-4 transform transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1430
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
1431
+ </svg>
1432
+ Advanced
1433
+ </button>
1434
+ </div>
1435
+
1436
+ <!-- Advanced Settings (Hidden by default) -->
1437
+ <div id="dlq-advanced" class="hidden mt-4 grid grid-cols-2 gap-4">
1438
+ <div>
1439
+ <label class="block text-sm font-medium text-gray-300 mb-1">DLQ Path</label>
1440
+ <input type="text" name="path.dead_letter_queue" placeholder="path.data/dead_letter_queue" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1441
+ </div>
1442
+ <div>
1443
+ <label class="block text-sm font-medium text-gray-300 mb-1">Flush Interval (ms)</label>
1444
+ <input type="number" name="dead_letter_queue.flush_interval" placeholder="5000" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1445
+ </div>
1446
+ <div>
1447
+ <label class="block text-sm font-medium text-gray-300 mb-1">Storage Policy</label>
1448
+ <select name="dead_letter_queue.storage_policy" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1449
+ <option value="">Default (drop_newer)</option>
1450
+ <option value="drop_newer">Drop Newer</option>
1451
+ <option value="drop_older">Drop Older</option>
1452
+ </select>
1453
+ </div>
1454
+ <div>
1455
+ <label class="block text-sm font-medium text-gray-300 mb-1">Retain Age</label>
1456
+ <input type="text" name="dead_letter_queue.retain.age" placeholder="e.g., 1d, 24h" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1457
+ </div>
1458
+ </div>
1459
+ </div>
1460
+ </div>
1461
+
1462
+ <!-- Row 4: Pipeline Configuration + Logging Settings -->
1463
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
1464
+ <!-- Pipeline Configuration Settings Section -->
1465
+ <div class="bg-gray-900/50 rounded-lg p-4">
1466
+ <h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
1467
+ <svg class="w-5 h-5 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1468
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
1469
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
1470
+ </svg>
1471
+ Pipeline Configuration
1472
+ </h3>
1473
+
1474
+ <!-- Common Settings -->
1475
+ <div class="grid grid-cols-2 gap-4">
1476
+ <div class="col-span-2">
1477
+ <label class="block text-sm font-medium text-gray-300 mb-1">Config Path</label>
1478
+ <input type="text" name="path.config" placeholder="Path to pipeline configuration" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1479
+ </div>
1480
+ <div>
1481
+ <label class="block text-sm font-medium text-gray-300 mb-1">Config Reload Automatic</label>
1482
+ <select name="config.reload.automatic" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1483
+ <option value="">Default (false)</option>
1484
+ <option value="true">True</option>
1485
+ <option value="false">False</option>
1486
+ </select>
1487
+ </div>
1488
+ <div>
1489
+ <label class="block text-sm font-medium text-gray-300 mb-1">Config Reload Interval</label>
1490
+ <input type="text" name="config.reload.interval" placeholder="3s" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1491
+ </div>
1492
+ </div>
1493
+
1494
+ <!-- Advanced Settings Toggle -->
1495
+ <div class="mt-4">
1496
+ <button type="button" onclick="toggleAdvanced('pipelineconfig-advanced')" class="flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300">
1497
+ <svg id="pipelineconfig-advanced-icon" class="w-4 h-4 transform transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1498
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
1499
+ </svg>
1500
+ Advanced
1501
+ </button>
1502
+ </div>
1503
+
1504
+ <!-- Advanced Settings (Hidden by default) -->
1505
+ <div id="pipelineconfig-advanced" class="hidden mt-4 grid grid-cols-2 gap-4">
1506
+ <div class="col-span-2">
1507
+ <label class="block text-sm font-medium text-gray-300 mb-1">Config String</label>
1508
+ <textarea name="config.string" placeholder="Pipeline configuration string" rows="3" class="textarea textarea-sm textarea-bordered w-full bg-gray-700 text-white border-gray-600"></textarea>
1509
+ <p class="text-xs text-gray-500 mt-1">Pipeline configuration string for the main pipeline</p>
1510
+ </div>
1511
+ <div>
1512
+ <label class="block text-sm font-medium text-gray-300 mb-1">Config Test and Exit</label>
1513
+ <select name="config.test_and_exit" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1514
+ <option value="">Default (false)</option>
1515
+ <option value="true">True</option>
1516
+ <option value="false">False</option>
1517
+ </select>
1518
+ </div>
1519
+ <div>
1520
+ <label class="block text-sm font-medium text-gray-300 mb-1">Config Debug</label>
1521
+ <select name="config.debug" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1522
+ <option value="">Default (false)</option>
1523
+ <option value="true">True</option>
1524
+ <option value="false">False</option>
1525
+ </select>
1526
+ </div>
1527
+ <div>
1528
+ <label class="block text-sm font-medium text-gray-300 mb-1">Config Support Escapes</label>
1529
+ <select name="config.support_escapes" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1530
+ <option value="">Default (false)</option>
1531
+ <option value="true">True</option>
1532
+ <option value="false">False</option>
1533
+ </select>
1534
+ </div>
1535
+ </div>
1536
+ </div>
1537
+
1538
+ <!-- Logging Settings Section -->
1539
+ <div class="bg-gray-900/50 rounded-lg p-4">
1540
+ <h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
1541
+ <svg class="w-5 h-5 text-orange-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1542
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
1543
+ </svg>
1544
+ Logging Settings
1545
+ </h3>
1546
+
1547
+ <!-- Common Settings -->
1548
+ <div class="grid grid-cols-2 gap-4">
1549
+ <div>
1550
+ <label class="block text-sm font-medium text-gray-300 mb-1">Log Level</label>
1551
+ <select name="log.level" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1552
+ <option value="">Default (info)</option>
1553
+ <option value="fatal">Fatal</option>
1554
+ <option value="error">Error</option>
1555
+ <option value="warn">Warn</option>
1556
+ <option value="info">Info</option>
1557
+ <option value="debug">Debug</option>
1558
+ <option value="trace">Trace</option>
1559
+ </select>
1560
+ </div>
1561
+ <div>
1562
+ <label class="block text-sm font-medium text-gray-300 mb-1">Log Format</label>
1563
+ <select name="log.format" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1564
+ <option value="">Default (plain)</option>
1565
+ <option value="plain">Plain</option>
1566
+ <option value="json">JSON</option>
1567
+ </select>
1568
+ </div>
1569
+ </div>
1570
+
1571
+ <!-- Advanced Settings Toggle -->
1572
+ <div class="mt-4">
1573
+ <button type="button" onclick="toggleAdvanced('logging-advanced')" class="flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300">
1574
+ <svg id="logging-advanced-icon" class="w-4 h-4 transform transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1575
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
1576
+ </svg>
1577
+ Advanced
1578
+ </button>
1579
+ </div>
1580
+
1581
+ <!-- Advanced Settings (Hidden by default) -->
1582
+ <div id="logging-advanced" class="hidden mt-4 grid grid-cols-2 gap-4">
1583
+ <div>
1584
+ <label class="block text-sm font-medium text-gray-300 mb-1">JSON Fix Duplicate Message Fields</label>
1585
+ <select name="log.format.json.fix_duplicate_message_fields" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1586
+ <option value="">Default (true)</option>
1587
+ <option value="true">True</option>
1588
+ <option value="false">False</option>
1589
+ </select>
1590
+ </div>
1591
+ <div>
1592
+ <label class="block text-sm font-medium text-gray-300 mb-1">Logs Path</label>
1593
+ <input type="text" name="path.logs" placeholder="Default path" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1594
+ </div>
1595
+ </div>
1596
+ </div>
1597
+ </div>
1598
+
1599
+ <!-- Row 6: X-Pack Monitoring + X-Pack Management -->
1600
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
1601
+ <!-- X-Pack Monitoring Section -->
1602
+ <div class="bg-gray-900/50 rounded-lg p-4">
1603
+ <h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
1604
+ <svg class="w-5 h-5 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1605
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
1606
+ </svg>
1607
+ X-Pack Monitoring
1608
+ </h3>
1609
+
1610
+ <!-- Common Settings -->
1611
+ <div class="grid grid-cols-2 gap-4">
1612
+ <div>
1613
+ <label class="block text-sm font-medium text-gray-300 mb-1">Monitoring Enabled</label>
1614
+ <select name="xpack.monitoring.enabled" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1615
+ <option value="">Default (false)</option>
1616
+ <option value="true">True</option>
1617
+ <option value="false">False</option>
1618
+ </select>
1619
+ </div>
1620
+ <div>
1621
+ <label class="block text-sm font-medium text-gray-300 mb-1">Collection Interval</label>
1622
+ <input type="text" name="xpack.monitoring.collection.interval" placeholder="10s" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1623
+ </div>
1624
+ <div class="col-span-2">
1625
+ <label class="block text-sm font-medium text-gray-300 mb-1">ES Hosts (comma-separated)</label>
1626
+ <input type="text" name="xpack.monitoring.elasticsearch.hosts" placeholder="https://es1:9200, https://es2:9200" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1627
+ </div>
1628
+ <div>
1629
+ <label class="block text-sm font-medium text-gray-300 mb-1">Cloud ID</label>
1630
+ <input type="text" name="xpack.monitoring.elasticsearch.cloud_id" placeholder="monitoring_cluster_id:xxxxxxxxxx" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1631
+ </div>
1632
+ <div>
1633
+ <label class="block text-sm font-medium text-gray-300 mb-1">API Key</label>
1634
+ <input type="text" name="xpack.monitoring.elasticsearch.api_key" placeholder="id:api_key" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1635
+ </div>
1636
+ </div>
1637
+
1638
+ <!-- Advanced Settings Toggle -->
1639
+ <div class="mt-4">
1640
+ <button type="button" onclick="toggleAdvanced('xpack-monitoring-advanced')" class="flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300">
1641
+ <svg id="xpack-monitoring-advanced-icon" class="w-4 h-4 transform transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1642
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
1643
+ </svg>
1644
+ Advanced
1645
+ </button>
1646
+ </div>
1647
+
1648
+ <!-- Advanced Settings (Hidden by default) -->
1649
+ <div id="xpack-monitoring-advanced" class="hidden mt-4 grid grid-cols-2 gap-4">
1650
+ <div>
1651
+ <label class="block text-sm font-medium text-gray-300 mb-1">ES Username</label>
1652
+ <input type="text" name="xpack.monitoring.elasticsearch.username" placeholder="logstash_system" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1653
+ </div>
1654
+ <div>
1655
+ <label class="block text-sm font-medium text-gray-300 mb-1">ES Password</label>
1656
+ <input type="password" name="xpack.monitoring.elasticsearch.password" placeholder="password" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1657
+ </div>
1658
+ <div>
1659
+ <label class="block text-sm font-medium text-gray-300 mb-1">Cloud Auth</label>
1660
+ <input type="text" name="xpack.monitoring.elasticsearch.cloud_auth" placeholder="logstash_system:password" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1661
+ </div>
1662
+ <div class="col-span-2">
1663
+ <label class="block text-sm font-medium text-gray-300 mb-1">Proxy (comma-separated)</label>
1664
+ <input type="text" name="xpack.monitoring.elasticsearch.proxy" placeholder="http://proxy:port" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1665
+ </div>
1666
+ <div>
1667
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Certificate Authority</label>
1668
+ <input type="text" name="xpack.monitoring.elasticsearch.ssl.certificate_authority" placeholder="/path/to/ca.crt" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1669
+ </div>
1670
+ <div>
1671
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL CA Trusted Fingerprint</label>
1672
+ <input type="text" name="xpack.monitoring.elasticsearch.ssl.ca_trusted_fingerprint" placeholder="xxxxxxxxxx" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1673
+ </div>
1674
+ <div>
1675
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Truststore Path</label>
1676
+ <input type="text" name="xpack.monitoring.elasticsearch.ssl.truststore.path" placeholder="path/to/file" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1677
+ </div>
1678
+ <div>
1679
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Truststore Password</label>
1680
+ <input type="password" name="xpack.monitoring.elasticsearch.ssl.truststore.password" placeholder="password" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1681
+ </div>
1682
+ <div>
1683
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Keystore Path</label>
1684
+ <input type="text" name="xpack.monitoring.elasticsearch.ssl.keystore.path" placeholder="/path/to/file" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1685
+ </div>
1686
+ <div>
1687
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Keystore Password</label>
1688
+ <input type="password" name="xpack.monitoring.elasticsearch.ssl.keystore.password" placeholder="password" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1689
+ </div>
1690
+ <div>
1691
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Certificate</label>
1692
+ <input type="text" name="xpack.monitoring.elasticsearch.ssl.certificate" placeholder="/path/to/file" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1693
+ </div>
1694
+ <div>
1695
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Key</label>
1696
+ <input type="text" name="xpack.monitoring.elasticsearch.ssl.key" placeholder="/path/to/key" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1697
+ </div>
1698
+ <div>
1699
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Verification Mode</label>
1700
+ <select name="xpack.monitoring.elasticsearch.ssl.verification_mode" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1701
+ <option value="">Default (full)</option>
1702
+ <option value="full">Full</option>
1703
+ <option value="certificate">Certificate</option>
1704
+ <option value="none">None</option>
1705
+ </select>
1706
+ </div>
1707
+ <div>
1708
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Cipher Suites</label>
1709
+ <input type="text" name="xpack.monitoring.elasticsearch.ssl.cipher_suites" placeholder="Comma-separated" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1710
+ </div>
1711
+ <div>
1712
+ <label class="block text-sm font-medium text-gray-300 mb-1">Sniffing</label>
1713
+ <select name="xpack.monitoring.elasticsearch.sniffing" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1714
+ <option value="">Default (false)</option>
1715
+ <option value="true">True</option>
1716
+ <option value="false">False</option>
1717
+ </select>
1718
+ </div>
1719
+ <div>
1720
+ <label class="block text-sm font-medium text-gray-300 mb-1">Allow Legacy Collection</label>
1721
+ <select name="xpack.monitoring.allow_legacy_collection" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1722
+ <option value="">Default (false)</option>
1723
+ <option value="true">True</option>
1724
+ <option value="false">False</option>
1725
+ </select>
1726
+ </div>
1727
+ <div>
1728
+ <label class="block text-sm font-medium text-gray-300 mb-1">Collection Pipeline Details Enabled</label>
1729
+ <select name="xpack.monitoring.collection.pipeline.details.enabled" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1730
+ <option value="">Default (true)</option>
1731
+ <option value="true">True</option>
1732
+ <option value="false">False</option>
1733
+ </select>
1734
+ </div>
1735
+ </div>
1736
+ </div>
1737
+
1738
+ <!-- X-Pack Management Section -->
1739
+ <div class="bg-gray-900/50 rounded-lg p-4">
1740
+ <h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
1741
+ <svg class="w-5 h-5 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1742
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
1743
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
1744
+ </svg>
1745
+ X-Pack Management
1746
+ </h3>
1747
+
1748
+ <!-- Common Settings -->
1749
+ <div class="grid grid-cols-2 gap-4">
1750
+ <div>
1751
+ <label class="block text-sm font-medium text-gray-300 mb-1">Management Enabled</label>
1752
+ <select name="xpack.management.enabled" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1753
+ <option value="">Default (false)</option>
1754
+ <option value="true">True</option>
1755
+ <option value="false">False</option>
1756
+ </select>
1757
+ </div>
1758
+ <div>
1759
+ <label class="block text-sm font-medium text-gray-300 mb-1">Poll Interval</label>
1760
+ <input type="text" name="xpack.management.logstash.poll_interval" placeholder="5s" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1761
+ </div>
1762
+ <div class="col-span-2">
1763
+ <label class="block text-sm font-medium text-gray-300 mb-1">Pipeline IDs (comma-separated)</label>
1764
+ <input type="text" name="xpack.management.pipeline.id" placeholder="main, apache_logs" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1765
+ </div>
1766
+ <div class="col-span-2">
1767
+ <label class="block text-sm font-medium text-gray-300 mb-1">ES Hosts (comma-separated)</label>
1768
+ <input type="text" name="xpack.management.elasticsearch.hosts" placeholder="https://es1:9200, https://es2:9200" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1769
+ </div>
1770
+ <div>
1771
+ <label class="block text-sm font-medium text-gray-300 mb-1">Cloud ID</label>
1772
+ <input type="text" name="xpack.management.elasticsearch.cloud_id" placeholder="management_cluster_id:xxxxxxxxxx" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1773
+ </div>
1774
+ <div>
1775
+ <label class="block text-sm font-medium text-gray-300 mb-1">API Key</label>
1776
+ <input type="text" name="xpack.management.elasticsearch.api_key" placeholder="id:api_key" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1777
+ </div>
1778
+ </div>
1779
+
1780
+ <!-- Advanced Settings Toggle -->
1781
+ <div class="mt-4">
1782
+ <button type="button" onclick="toggleAdvanced('xpack-management-advanced')" class="flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300">
1783
+ <svg id="xpack-management-advanced-icon" class="w-4 h-4 transform transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1784
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
1785
+ </svg>
1786
+ Advanced
1787
+ </button>
1788
+ </div>
1789
+
1790
+ <!-- Advanced Settings (Hidden by default) -->
1791
+ <div id="xpack-management-advanced" class="hidden mt-4 grid grid-cols-2 gap-4">
1792
+ <div>
1793
+ <label class="block text-sm font-medium text-gray-300 mb-1">ES Username</label>
1794
+ <input type="text" name="xpack.management.elasticsearch.username" placeholder="logstash_admin_user" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1795
+ </div>
1796
+ <div>
1797
+ <label class="block text-sm font-medium text-gray-300 mb-1">ES Password</label>
1798
+ <input type="password" name="xpack.management.elasticsearch.password" placeholder="password" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1799
+ </div>
1800
+ <div>
1801
+ <label class="block text-sm font-medium text-gray-300 mb-1">Cloud Auth</label>
1802
+ <input type="text" name="xpack.management.elasticsearch.cloud_auth" placeholder="logstash_admin_user:password" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1803
+ </div>
1804
+ <div class="col-span-2">
1805
+ <label class="block text-sm font-medium text-gray-300 mb-1">Proxy (comma-separated)</label>
1806
+ <input type="text" name="xpack.management.elasticsearch.proxy" placeholder="http://proxy:port" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1807
+ </div>
1808
+ <div>
1809
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Certificate Authority</label>
1810
+ <input type="text" name="xpack.management.elasticsearch.ssl.certificate_authority" placeholder="/path/to/ca.crt" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1811
+ </div>
1812
+ <div>
1813
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL CA Trusted Fingerprint</label>
1814
+ <input type="text" name="xpack.management.elasticsearch.ssl.ca_trusted_fingerprint" placeholder="xxxxxxxxxx" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1815
+ </div>
1816
+ <div>
1817
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Truststore Path</label>
1818
+ <input type="text" name="xpack.management.elasticsearch.ssl.truststore.path" placeholder="path/to/file" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1819
+ </div>
1820
+ <div>
1821
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Truststore Password</label>
1822
+ <input type="password" name="xpack.management.elasticsearch.ssl.truststore.password" placeholder="password" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1823
+ </div>
1824
+ <div>
1825
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Keystore Path</label>
1826
+ <input type="text" name="xpack.management.elasticsearch.ssl.keystore.path" placeholder="/path/to/file" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1827
+ </div>
1828
+ <div>
1829
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Keystore Password</label>
1830
+ <input type="password" name="xpack.management.elasticsearch.ssl.keystore.password" placeholder="password" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1831
+ </div>
1832
+ <div>
1833
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Certificate</label>
1834
+ <input type="text" name="xpack.management.elasticsearch.ssl.certificate" placeholder="/path/to/file" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1835
+ </div>
1836
+ <div>
1837
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Key</label>
1838
+ <input type="text" name="xpack.management.elasticsearch.ssl.key" placeholder="/path/to/certificate_key_file" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1839
+ </div>
1840
+ <div>
1841
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Verification Mode</label>
1842
+ <select name="xpack.management.elasticsearch.ssl.verification_mode" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1843
+ <option value="">Default (full)</option>
1844
+ <option value="full">Full</option>
1845
+ <option value="certificate">Certificate</option>
1846
+ <option value="none">None</option>
1847
+ </select>
1848
+ </div>
1849
+ <div>
1850
+ <label class="block text-sm font-medium text-gray-300 mb-1">SSL Cipher Suites</label>
1851
+ <input type="text" name="xpack.management.elasticsearch.ssl.cipher_suites" placeholder="Comma-separated" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1852
+ </div>
1853
+ <div>
1854
+ <label class="block text-sm font-medium text-gray-300 mb-1">Sniffing</label>
1855
+ <select name="xpack.management.elasticsearch.sniffing" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1856
+ <option value="">Default (false)</option>
1857
+ <option value="true">True</option>
1858
+ <option value="false">False</option>
1859
+ </select>
1860
+ </div>
1861
+ </div>
1862
+ </div>
1863
+ </div>
1864
+ </div>
1865
+
1866
+ <!-- Row 8: Other Settings + X-Pack GeoIP -->
1867
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
1868
+ <!-- Other Settings Section -->
1869
+ <div class="bg-gray-900/50 rounded-lg p-4">
1870
+ <h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
1871
+ <svg class="w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1872
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4" />
1873
+ </svg>
1874
+ Other Settings
1875
+ </h3>
1876
+
1877
+ <!-- All Settings -->
1878
+ <div class="grid grid-cols-2 gap-4">
1879
+ <div>
1880
+ <label class="block text-sm font-medium text-gray-300 mb-1">Allow Superuser</label>
1881
+ <select name="allow_superuser" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1882
+ <option value="">Default (false)</option>
1883
+ <option value="true">True</option>
1884
+ <option value="false">False</option>
1885
+ </select>
1886
+ </div>
1887
+ <div>
1888
+ <label class="block text-sm font-medium text-gray-300 mb-1">Pipeline Separate Logs</label>
1889
+ <select name="pipeline.separate_logs" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1890
+ <option value="">Default (false)</option>
1891
+ <option value="true">True</option>
1892
+ <option value="false">False</option>
1893
+ </select>
1894
+ </div>
1895
+ <div class="col-span-2">
1896
+ <label class="block text-sm font-medium text-gray-300 mb-1">Plugins Path</label>
1897
+ <input type="text" name="path.plugins" placeholder="Path to custom plugins" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1898
+ </div>
1899
+ </div>
1900
+ </div>
1901
+
1902
+ <!-- X-Pack GeoIP Section -->
1903
+ <div class="bg-gray-900/50 rounded-lg p-4">
1904
+ <h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
1905
+ <svg class="w-5 h-5 text-teal-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1906
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
1907
+ </svg>
1908
+ X-Pack GeoIP
1909
+ </h3>
1910
+
1911
+ <!-- All Settings (GeoIP is simple, no advanced needed) -->
1912
+ <div class="grid grid-cols-2 gap-4">
1913
+ <div>
1914
+ <label class="block text-sm font-medium text-gray-300 mb-1">Downloader Enabled</label>
1915
+ <select name="xpack.geoip.downloader.enabled" class="select select-sm select-bordered w-full bg-gray-700 text-white border-gray-600">
1916
+ <option value="">Default (true)</option>
1917
+ <option value="true">True</option>
1918
+ <option value="false">False</option>
1919
+ </select>
1920
+ </div>
1921
+ <div>
1922
+ <label class="block text-sm font-medium text-gray-300 mb-1">Downloader Endpoint</label>
1923
+ <input type="text" name="xpack.geoip.downloader.endpoint" placeholder="https://geoip.elastic.co/v1/database" class="input input-sm input-bordered w-full bg-gray-700 text-white border-gray-600">
1924
+ </div>
1925
+ </div>
1926
+ </div>
1927
+ </div>
1928
+
1929
+ </div>
1930
+ </div>
1931
+
1932
+ <!-- JVM Form Mode -->
1933
+ <div id="jvmFormView" class="hidden flex-1 overflow-y-auto px-4 py-4 space-y-3">
1934
+ <!-- Mismatch banner (styled like Unsafe Shutdown) -->
1935
+ <div id="jvmMismatchBanner" class="p-3 bg-yellow-900/20 border border-yellow-500/40 rounded-lg hidden">
1936
+ <div class="flex items-start gap-3">
1937
+ <svg class="w-5 h-5 text-yellow-400 flex-shrink-0 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1938
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
1939
+ </svg>
1940
+ <div>
1941
+ <div class="text-sm font-medium text-yellow-300 mb-1">Heap Size Mismatch</div>
1942
+ <div class="text-xs text-gray-300">Initial Space (<code>-Xms</code>) and Total Space (<code>-Xmx</code>) differ. It is strongly recommended to keep them equal to avoid GC overhead and performance issues.</div>
1943
+ </div>
1944
+ </div>
1945
+ </div>
1946
+ <!-- Side-by-side inputs -->
1947
+ <div class="grid grid-cols-2 gap-3">
1948
+ <!-- Heap: Initial Space (Xms) -->
1949
+ <div class="bg-gray-900/50 rounded-lg p-4">
1950
+ <h3 class="text-base font-semibold text-white mb-1">Heap: Initial Space</h3>
1951
+ <p class="text-xs text-gray-400 mb-3">Controls <code class="text-gray-300">-Xms</code> — initial heap at JVM startup.</p>
1952
+ <div class="flex items-center gap-2">
1953
+ <input type="number" id="jvmXmsInput" min="1" step="1" placeholder="e.g., 1"
1954
+ class="input input-sm input-bordered w-28 bg-gray-700 text-white border-gray-600">
1955
+ <span class="text-gray-400 text-sm">GB</span>
1956
+ </div>
1957
+ </div>
1958
+ <!-- Heap: Total Space (Xmx) -->
1959
+ <div class="bg-gray-900/50 rounded-lg p-4">
1960
+ <h3 class="text-base font-semibold text-white mb-1">Heap: Maximum Space</h3>
1961
+ <p class="text-xs text-gray-400 mb-3">Controls <code class="text-gray-300">-Xmx</code> — maximum heap the JVM may use.</p>
1962
+ <div class="flex items-center gap-2">
1963
+ <input type="number" id="jvmXmxInput" min="1" step="1" placeholder="e.g., 1"
1964
+ class="input input-sm input-bordered w-28 bg-gray-700 text-white border-gray-600">
1965
+ <span class="text-gray-400 text-sm">GB</span>
1966
+ </div>
1967
+ </div>
1968
+ </div>
1969
+ <p class="text-xs text-gray-500 px-1">Logstash defaults to 1 GB each. Set to half of available system RAM for production use.</p>
1970
+ </div>
1971
+
1972
+ <!-- Code Mode -->
1973
+ <div id="codeModeEditor" class="flex-1 overflow-hidden hidden px-4">
1974
+ <textarea id="codeEditor" class="h-full w-full"></textarea>
1975
+ </div>
1976
+
1977
+ <!-- Pipelines View -->
1978
+ <div id="pipelinesView" class="hidden flex-1 overflow-auto px-4 py-6">
1979
+ <!-- CPM Warning (shown when xpack.management.enabled is true) -->
1980
+ <div id="cpmPipelineWarning" class="hidden mb-4 p-4 bg-orange-900/20 border border-orange-500/40 rounded-lg">
1981
+ <div class="flex items-start gap-3">
1982
+ <svg class="w-5 h-5 text-orange-400 flex-shrink-0 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1983
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
1984
+ </svg>
1985
+ <div>
1986
+ <h4 class="text-orange-300 font-semibold mb-1">Warning</h4>
1987
+ <p class="text-gray-300 text-sm">These pipelines will not be applied because this policy uses Centralized Pipeline Management. We will still push the pipelines to the node, but Logstash will not load them. To edit pipelines for this policy, add the Elasticsearch instance as a Connection in the Connection Manager</p>
1988
+ </div>
1989
+ </div>
1990
+ </div>
1991
+
1992
+ {% include 'components/pipeline_manager/pipeline_list_content.html' %}
1993
+ </div>
1994
+
1995
+ <!-- Keystore View -->
1996
+ <div id="keystoreView" class="hidden flex-1 overflow-auto px-4 py-6">
1997
+
1998
+ <!-- No-password banner (shown when policy has no keystore password set) -->
1999
+ <div id="keystoreNoPasswordBanner" class="hidden mb-4 p-4 bg-yellow-900/30 border border-yellow-600/50 rounded-lg flex items-center justify-between">
2000
+ <div class="flex items-center gap-3">
2001
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-yellow-400 flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
2002
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.834-2.694-.834-3.464 0L3.34 16.5C2.57 18.333 3.532 20 5.072 20z" />
2003
+ </svg>
2004
+ <span class="text-yellow-300 text-sm">A keystore password must be set before managing keystore entries.</span>
2005
+ </div>
2006
+ <button onclick="showSetKeystorePasswordModal()" class="btn btn-sm btn-warning ml-4 flex-shrink-0">
2007
+ Set Keystore Password
2008
+ </button>
2009
+ </div>
2010
+
2011
+ <!-- Controls (hidden until keystore password is set) -->
2012
+ <div id="keystorePasswordedControls" class="hidden mb-4 flex gap-4 items-center">
2013
+ <button onclick="showCreateKeystoreModal()" class="btn btn-primary btn-sm">
2014
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
2015
+ <path fill-rule="evenodd" d="M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z" clip-rule="evenodd" />
2016
+ </svg>
2017
+ Create Key
2018
+ </button>
2019
+
2020
+ <button onclick="showChangeKeystorePasswordModal()" class="btn btn-secondary btn-sm">
2021
+ Change Keystore Password
2022
+ </button>
2023
+
2024
+ <!-- Search Bar -->
2025
+ <div style="max-width: 500px; flex: 1;">
2026
+ <input type="text" id="keystoreSearch" placeholder="Search by variable or key..." class="input input-bordered input-sm w-full bg-gray-700 text-white border-gray-600">
2027
+ </div>
2028
+ </div>
2029
+
2030
+ <!-- Table + pagination (hidden until keystore password is set) -->
2031
+ <div id="keystoreTableContainer" class="hidden">
2032
+ <!-- No Results State -->
2033
+ <div id="keystoreNoResults" class="hidden p-8 text-center bg-gray-900/50 rounded-lg mb-4">
2034
+ <div class="inline-flex items-center justify-center w-12 h-12 bg-yellow-600/20 rounded-full mb-3">
2035
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-yellow-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
2036
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
2037
+ </svg>
2038
+ </div>
2039
+ <h3 class="text-lg font-bold text-white mb-1">No results found</h3>
2040
+ <p class="text-gray-400 text-sm">Try adjusting your search terms</p>
2041
+ </div>
2042
+
2043
+ <!-- Keystore Table -->
2044
+ <div id="keystoreList" class="overflow-hidden">
2045
+ <table class="w-full">
2046
+ <thead>
2047
+ <tr class="border-b border-gray-700">
2048
+ <th class="text-left px-4 py-3 text-sm font-medium text-gray-400">Variable</th>
2049
+ <th class="text-left px-4 py-3 text-sm font-medium text-gray-400">Value</th>
2050
+ <th class="text-left px-4 py-3 text-sm font-medium text-gray-400">Updated At</th>
2051
+ <th class="text-right px-4 py-3 text-sm font-medium text-gray-400">Actions</th>
2052
+ </tr>
2053
+ </thead>
2054
+ <tbody id="keystoreTableBody" class="divide-y divide-gray-800">
2055
+ <!-- Keystore entries will be loaded here via JavaScript -->
2056
+ <tr>
2057
+ <td colspan="4" class="px-4 py-8 text-center text-gray-400">
2058
+ <div class="flex flex-col items-center gap-2">
2059
+ <svg class="w-12 h-12 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
2060
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
2061
+ </svg>
2062
+ <p>No keystore entries found</p>
2063
+ </div>
2064
+ </td>
2065
+ </tr>
2066
+ </tbody>
2067
+ </table>
2068
+ </div>
2069
+
2070
+ <!-- Pagination Controls -->
2071
+ <div id="keystorePagination" class="mt-4 flex justify-between items-center">
2072
+ <div class="flex gap-3 items-center">
2073
+ <div class="text-sm text-gray-400 whitespace-nowrap">
2074
+ Showing <span id="keystoreShowingStart">0</span> to <span id="keystoreShowingEnd">0</span> of <span id="keystoreTotalCount">0</span> entries
2075
+ </div>
2076
+ <select id="keystorePageSize" class="select select-bordered select-sm bg-gray-700 text-white border-gray-600" style="width: 70px;">
2077
+ <option value="10" selected>10</option>
2078
+ <option value="25">25</option>
2079
+ <option value="50">50</option>
2080
+ </select>
2081
+ </div>
2082
+ <div class="flex gap-2">
2083
+ <button id="keystorePrevBtn" class="btn btn-sm btn-secondary" onclick="previousKeystorePage()">Previous</button>
2084
+ <span id="keystorePageInfo" class="px-4 py-2 text-gray-300">Page 1 of 1</span>
2085
+ <button id="keystoreNextBtn" class="btn btn-sm btn-secondary" onclick="nextKeystorePage()">Next</button>
2086
+ </div>
2087
+ </div>
2088
+ </div>
2089
+ </div>
2090
+
2091
+ <!-- Nodes View -->
2092
+ <div id="nodesView" class="flex-1 hidden overflow-auto px-4 py-6">
2093
+ <!-- Nodes Table -->
2094
+ <div id="nodesList" class="overflow-hidden">
2095
+ <table class="w-full">
2096
+ <thead>
2097
+ <tr class="border-b border-gray-700">
2098
+ <th class="text-center px-4 py-3 text-sm font-medium text-gray-400">Type</th>
2099
+ <th class="text-left px-4 py-3 text-sm font-medium text-gray-400">Name</th>
2100
+ <th class="text-left px-4 py-3 text-sm font-medium text-gray-400">Host</th>
2101
+ <th class="text-left px-4 py-3 text-sm font-medium text-gray-400">Status</th>
2102
+ </tr>
2103
+ </thead>
2104
+ <tbody id="nodesTableBody" class="divide-y divide-gray-800">
2105
+ <!-- Nodes will be loaded here via JavaScript -->
2106
+ <tr>
2107
+ <td colspan="4" class="px-4 py-8 text-center text-gray-400">
2108
+ <div class="flex flex-col items-center gap-2">
2109
+ <svg class="w-12 h-12 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
2110
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01" />
2111
+ </svg>
2112
+ <p>No agents found</p>
2113
+ <p class="text-sm">Agents will appear here when they enroll with this policy</p>
2114
+ </div>
2115
+ </td>
2116
+ </tr>
2117
+ </tbody>
2118
+ </table>
2119
+ </div>
2120
+ </div>
2121
+
2122
+ <!-- Enrollment Tokens View -->
2123
+ <div id="enrollmentTokensView" class="flex-1 hidden overflow-auto px-4 py-6">
2124
+ <!-- Header with Create Button -->
2125
+ <div class="mb-4 flex gap-4 items-center">
2126
+ <button id="addTokenBtn" onclick="addEnrollmentToken()" class="btn btn-primary btn-sm">
2127
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
2128
+ <path fill-rule="evenodd" d="M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z" clip-rule="evenodd" />
2129
+ </svg>
2130
+ Add Token
2131
+ </button>
2132
+ </div>
2133
+
2134
+ <!-- Enrollment Tokens Table -->
2135
+ <div id="enrollmentTokensList" class="overflow-hidden">
2136
+ <table class="w-full">
2137
+ <thead>
2138
+ <tr class="border-b border-gray-700">
2139
+ <th class="text-left px-4 py-3 text-sm font-medium text-gray-400">Name</th>
2140
+ <th class="text-left px-4 py-3 text-sm font-medium text-gray-400">Token</th>
2141
+ <th class="text-right px-4 py-3 text-sm font-medium text-gray-400">Actions</th>
2142
+ </tr>
2143
+ </thead>
2144
+ <tbody id="enrollmentTokensTableBody" class="divide-y divide-gray-800">
2145
+ <!-- Tokens will be loaded here via JavaScript -->
2146
+ <tr>
2147
+ <td colspan="3" class="px-4 py-8 text-center text-gray-400">
2148
+ <div class="flex flex-col items-center gap-2">
2149
+ <svg class="w-12 h-12 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
2150
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
2151
+ </svg>
2152
+ <p>No enrollment tokens found</p>
2153
+ <p class="text-sm">Tokens will be created automatically when you save this policy</p>
2154
+ </div>
2155
+ </td>
2156
+ </tr>
2157
+ </tbody>
2158
+ </table>
2159
+ </div>
2160
+ </div>
2161
+ </div>
2162
+ </div>
2163
+ </div> <!-- Close mainContent -->
2164
+ </div>
2165
+
2166
+ <!-- Default Guide Modal -->
2167
+ <div id="defaultGuideModal" class="hidden fixed inset-0 flex items-center justify-center z-50 p-4">
2168
+ <div class="absolute inset-0 bg-black/30 backdrop-blur-sm" onclick="closeDefaultGuideModal()"></div>
2169
+ <div class="bg-gray-800 rounded-lg w-full max-w-7xl flex flex-col relative z-10" style="height: 90vh; max-height: 90vh;">
2170
+ <!-- Header -->
2171
+ <div class="p-4 border-b border-gray-700 flex justify-between items-center flex-shrink-0">
2172
+ <div>
2173
+ <h3 class="text-lg font-semibold text-white">Default Logstash Configuration Guide</h3>
2174
+ <p class="text-gray-400 text-sm mt-1">Quick setup for standard Logstash configurations</p>
2175
+ </div>
2176
+ <button onclick="closeDefaultGuideModal()" class="text-gray-400 hover:text-white">
2177
+ <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
2178
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
2179
+ </svg>
2180
+ </button>
2181
+ </div>
2182
+
2183
+ <!-- Content -->
2184
+ <div class="flex-1 overflow-auto p-4">
2185
+ {% include 'components/pipeline_manager/logstashyml_guides/default.html' %}
2186
+ </div>
2187
+
2188
+ <!-- Footer with actions -->
2189
+ <div class="p-4 border-t border-gray-700 flex justify-end items-center flex-shrink-0">
2190
+ <button onclick="closeDefaultGuideModal()" class="px-4 py-2 bg-gray-700 text-white rounded hover:bg-gray-600">
2191
+ Close
2192
+ </button>
2193
+ </div>
2194
+ </div>
2195
+ </div>
2196
+
2197
+ <!-- Centralized Pipeline Management Guide Modal -->
2198
+ <div id="centralizedPipelineManagementModal" class="hidden fixed inset-0 flex items-center justify-center z-50 p-4">
2199
+ <div class="absolute inset-0 bg-black/30 backdrop-blur-sm" onclick="closeCentralizedPipelineManagementModal()"></div>
2200
+ <div class="bg-gray-800 rounded-lg w-full max-w-7xl flex flex-col relative z-10" style="height: 90vh; max-height: 90vh;">
2201
+ <!-- Header -->
2202
+ <div class="p-4 border-b border-gray-700 flex justify-between items-center flex-shrink-0">
2203
+ <div>
2204
+ <h3 class="text-lg font-semibold text-white">Centralized Pipeline Management Guide</h3>
2205
+ <p class="text-gray-400 text-sm mt-1">Configure Logstash for centralized pipeline management</p>
2206
+ </div>
2207
+ <button onclick="closeCentralizedPipelineManagementModal()" class="text-gray-400 hover:text-white">
2208
+ <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
2209
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
2210
+ </svg>
2211
+ </button>
2212
+ </div>
2213
+
2214
+ <!-- Content -->
2215
+ <div class="flex-1 overflow-auto p-4">
2216
+ {% include 'components/pipeline_manager/logstashyml_guides/centralized_pipeline_management.html' %}
2217
+ </div>
2218
+
2219
+ <!-- Footer with actions -->
2220
+ <div class="p-4 border-t border-gray-700 flex justify-end items-center flex-shrink-0">
2221
+ <button onclick="closeCentralizedPipelineManagementModal()" class="px-4 py-2 bg-gray-700 text-white rounded hover:bg-gray-600">
2222
+ Close
2223
+ </button>
2224
+ </div>
2225
+ </div>
2226
+ </div>
2227
+
2228
+ <!-- Include popup modal -->
2229
+ {% include 'popup.html' %}
2230
+
2231
+ <!-- Include deploy diff modal -->
2232
+ {% include 'components/pipeline_manager/policy_deploy_modal.html' %}
2233
+
2234
+ <!-- Include keystore modal -->
2235
+ {% include 'components/pipeline_manager/keystore_modal.html' %}
2236
+
2237
+ <script src="{% static 'js/js-yaml.min.js' %}"></script>
2238
+ <script src="{% static 'js/codemirror.min.js' %}"></script>
2239
+ <script src="{% static 'js/yaml.js' %}"></script>
2240
+ <script src="{% static 'js/simple-comment-mode.js' %}"></script>
2241
+ <script src="{% static 'js/pipeline_list.js' %}"></script>
2242
+ <script src="{% static 'js/logstashyml_guides.js' %}"></script>
2243
+ <script src="{% static 'js/agent_policies.js' %}"></script>
2244
+
2245
+ <script>
2246
+ // Policy Switcher — visual layer over the hidden native #policySelect
2247
+ (function() {
2248
+ // Active role filters: empty set or all selected = show everything
2249
+ let roleFilter = new Set(['PACKAGED', 'MANAGED', 'SIMULATE']);
2250
+
2251
+ function roleClass(ptype) {
2252
+ if (typeof policyRoleClassName === 'function') {
2253
+ return policyRoleClassName(ptype);
2254
+ }
2255
+ let t = (ptype || 'PACKAGED').toUpperCase();
2256
+ if (t === 'DEFAULT') t = 'PACKAGED';
2257
+ if (t === 'SIMULATE') return 'role-simulate';
2258
+ if (t === 'EMBEDDED') return 'role-embedded';
2259
+ if (t === 'MANAGED') return 'role-managed';
2260
+ if (t === 'PACKAGED') return 'role-packaged';
2261
+ return 'role-default';
2262
+ }
2263
+
2264
+ function updateLabel(sel) {
2265
+ const label = document.getElementById('policySwitcherLabel');
2266
+ if (!label || !sel) return;
2267
+ if (sel.value === 'add_new') {
2268
+ label.textContent = 'Select policy…';
2269
+ label.className = 'policy-switcher-name';
2270
+ return;
2271
+ }
2272
+ label.textContent = sel.dataset.policyName || sel.textContent;
2273
+ label.className = 'policy-switcher-name ' + roleClass(sel.dataset.policyType);
2274
+ }
2275
+
2276
+ function rebuildMenu() {
2277
+ const select = document.getElementById('policySelect');
2278
+ const menu = document.getElementById('policySwitcherMenu');
2279
+ if (!select || !menu) return;
2280
+
2281
+ const sel = select.options[select.selectedIndex];
2282
+ updateLabel(sel);
2283
+
2284
+ menu.innerHTML = '';
2285
+
2286
+ // Role filter chips
2287
+ const filters = document.createElement('div');
2288
+ filters.className = 'policy-switcher-filters';
2289
+ filters.setAttribute('role', 'group');
2290
+ filters.setAttribute('aria-label', 'Filter policies by role');
2291
+ [
2292
+ { key: 'PACKAGED', label: 'Packaged' },
2293
+ { key: 'MANAGED', label: 'Managed' },
2294
+ { key: 'SIMULATE', label: 'Simulate' },
2295
+ ].forEach(({ key, label }) => {
2296
+ const chip = document.createElement('button');
2297
+ chip.type = 'button';
2298
+ chip.className = 'policy-filter-chip' + (roleFilter.has(key) ? ' active' : '');
2299
+ chip.dataset.filter = key;
2300
+ chip.textContent = label;
2301
+ chip.addEventListener('click', (e) => {
2302
+ e.stopPropagation();
2303
+ if (roleFilter.has(key) && roleFilter.size > 1) {
2304
+ roleFilter.delete(key);
2305
+ } else if (roleFilter.has(key) && roleFilter.size === 1) {
2306
+ // keep at least one? allow empty then show empty state
2307
+ roleFilter.delete(key);
2308
+ } else {
2309
+ roleFilter.add(key);
2310
+ }
2311
+ // If user cleared all, re-enable all (toggle UX)
2312
+ if (roleFilter.size === 0) {
2313
+ roleFilter = new Set(['PACKAGED', 'MANAGED', 'SIMULATE']);
2314
+ }
2315
+ rebuildMenu();
2316
+ });
2317
+ filters.appendChild(chip);
2318
+ });
2319
+ menu.appendChild(filters);
2320
+
2321
+ const policies = Array.from(select.options).filter(o => o.value !== 'add_new');
2322
+ const visible = policies.filter(o => {
2323
+ let t = (o.dataset.policyType || 'PACKAGED').toUpperCase();
2324
+ if (t === 'DEFAULT') t = 'PACKAGED';
2325
+ return roleFilter.has(t);
2326
+ });
2327
+
2328
+ if (visible.length === 0) {
2329
+ const empty = document.createElement('div');
2330
+ empty.className = 'policy-switcher-empty';
2331
+ empty.textContent = 'No policies match this filter';
2332
+ menu.appendChild(empty);
2333
+ }
2334
+
2335
+ visible.forEach(opt => {
2336
+ const isSelected = opt === sel;
2337
+ const ptype = (opt.dataset.policyType || 'DEFAULT').toUpperCase();
2338
+ const item = document.createElement('div');
2339
+ item.className = 'policy-switcher-item ' + roleClass(ptype) + (isSelected ? ' selected' : '');
2340
+ item.innerHTML = `
2341
+ <svg class="policy-switcher-check ${isSelected ? '' : 'invisible'}" fill="none" stroke="currentColor" viewBox="0 0 24 24">
2342
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 13l4 4L19 7"/>
2343
+ </svg>
2344
+ <span>${opt.dataset.policyName || opt.textContent}</span>
2345
+ <span class="policy-role-badge">${ptype}</span>`;
2346
+ item.addEventListener('click', () => {
2347
+ select.value = opt.value;
2348
+ select.dispatchEvent(new Event('change'));
2349
+ closePolicySwitcher();
2350
+ });
2351
+ menu.appendChild(item);
2352
+ });
2353
+
2354
+ // Divider + Add Policy action
2355
+ if (policies.length > 0 || visible.length > 0) {
2356
+ const divider = document.createElement('div');
2357
+ divider.className = 'policy-switcher-divider';
2358
+ menu.appendChild(divider);
2359
+ }
2360
+
2361
+ const addRow = document.createElement('div');
2362
+ addRow.className = 'policy-switcher-add';
2363
+ addRow.innerHTML = `
2364
+ <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
2365
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M12 4v16m8-8H4"/>
2366
+ </svg>
2367
+ <span>Add Policy</span>`;
2368
+ addRow.addEventListener('click', () => {
2369
+ select.value = 'add_new';
2370
+ select.dispatchEvent(new Event('change'));
2371
+ closePolicySwitcher();
2372
+ });
2373
+ menu.appendChild(addRow);
2374
+ }
2375
+
2376
+ window.togglePolicySwitcher = function() {
2377
+ const menu = document.getElementById('policySwitcherMenu');
2378
+ const btn = document.getElementById('policySwitcherBtn');
2379
+ if (!menu) return;
2380
+ const isOpen = !menu.classList.contains('hidden');
2381
+ if (isOpen) {
2382
+ closePolicySwitcher();
2383
+ } else {
2384
+ rebuildMenu();
2385
+ menu.classList.remove('hidden');
2386
+ btn.classList.add('open');
2387
+ }
2388
+ };
2389
+
2390
+ window.closePolicySwitcher = function() {
2391
+ const menu = document.getElementById('policySwitcherMenu');
2392
+ const btn = document.getElementById('policySwitcherBtn');
2393
+ menu?.classList.add('hidden');
2394
+ btn?.classList.remove('open');
2395
+ };
2396
+
2397
+ window.syncPolicySwitcherLabel = function() {
2398
+ const select = document.getElementById('policySelect');
2399
+ const sel = select?.options[select.selectedIndex];
2400
+ updateLabel(sel);
2401
+ };
2402
+
2403
+ // Close on outside click
2404
+ document.addEventListener('click', function(e) {
2405
+ const switcher = document.getElementById('policySwitcher');
2406
+ if (switcher && !switcher.contains(e.target)) {
2407
+ closePolicySwitcher();
2408
+ }
2409
+ });
2410
+
2411
+ // Keep button label (and color) in sync whenever the hidden select changes
2412
+ const select = document.getElementById('policySelect');
2413
+ if (select) {
2414
+ select.addEventListener('change', function() {
2415
+ const sel = this.options[this.selectedIndex];
2416
+ updateLabel(sel);
2417
+ });
2418
+ }
2419
+ })();
2420
+ </script>
2421
+ {% endblock %}