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,2783 @@
1
+ # REST API Reference
2
+
3
+ LogstashUI exposes a JSON REST API under `/api/`. All endpoints require an API key
4
+ unless noted otherwise. The same endpoints are available to AI clients as tools through the
5
+ [MCP server](/docs/docs/logstashui/mcp.md).
6
+
7
+ ---
8
+
9
+ ## Contents
10
+
11
+ - [Authentication](#authentication)
12
+ - [Connections](#connections)
13
+ - [Security](#security)
14
+ - [SNMP](#snmp-devices)
15
+ - [Policies](#policies)
16
+ - [Pipelines](#pipelines)
17
+ - [Agent guides](#agent-guides)
18
+
19
+ ---
20
+
21
+ ## Authentication
22
+
23
+ ### Creating an API key
24
+
25
+ Go to **[Management](/Management) → [API Keys](/Management/ApiTokens) → Create Key.**
26
+
27
+ Give the key a name, optionally set an expiry in days, and copy the value shown:
28
+
29
+ ```
30
+ lsui_<prefix>_<secret>
31
+ ```
32
+
33
+ The secret portion is shown **exactly once** — only a hash is stored server-side. If you lose it,
34
+ revoke it and create a new one.
35
+
36
+ Generated API secrets contain 256 bits of randomness and are stored as SHA-256
37
+ digests, verified with a constant-time comparison. Existing PBKDF2 token hashes
38
+ upgrade after successful authentication; the token value does not change.
39
+ Human login passwords continue to use Django's password hashing.
40
+
41
+ When upgrading from a release that only understands PBKDF2 tokens, replace all UI
42
+ workers together: older workers cannot verify upgraded token hashes. Rolling back
43
+ to such a release requires reissuing affected tokens or restoring compatible
44
+ stored hashes from a backup.
45
+
46
+ A key acts as the user who created it and inherits that account's role. A key created by a
47
+ `readonly` user can read but not write. Revocation takes effect on the next request.
48
+
49
+ ### Sending the key
50
+
51
+ Pass the key in an `Authorization` header on every request:
52
+
53
+ ```bash
54
+ export KEY="lsui_<prefix>_<secret>"
55
+ curl -H "Authorization: ApiKey $KEY" https://logstashui.example.com/api/...
56
+ ```
57
+
58
+ Key requests are exempt from CSRF. No cookie jar or `X-CSRFToken` header is needed.
59
+
60
+ > [!NOTE]
61
+ > LogstashUI serves TLS from its own product CA. Pass `-k` to skip verification, or fetch
62
+ > the CA and trust it properly:
63
+ >
64
+ > ```bash
65
+ > curl -sk https://logstashui.example.com/.well-known/logstashui/ca.crt -o logstashui-ca.crt
66
+ > curl --cacert logstashui-ca.crt -H "Authorization: ApiKey $KEY" ...
67
+ > ```
68
+
69
+ ### Response conventions
70
+
71
+ All endpoints return `application/json`. HTTP status codes are meaningful:
72
+
73
+ | Status | Meaning |
74
+ |--------|---------|
75
+ | `200` | Success (GET, PUT, DELETE) |
76
+ | `201` | Created (POST) |
77
+ | `400` | Validation error — body contains `error` with details |
78
+ | `401` | Missing or invalid API key |
79
+ | `403` | Key is valid but the owning user lacks the required role |
80
+ | `404` | Resource not found |
81
+ | `405` | Wrong HTTP method |
82
+ | `408` | Simulation timeout — agent did not return results within the requested window |
83
+ | `409` | Conflict: a duplicate name, or a write to a protected object (body has `"code": "protected"`) |
84
+ | `502` | Upstream error — Elasticsearch or simulate agent returned an unexpected response |
85
+
86
+ ---
87
+
88
+ ## Connections
89
+
90
+ Manage Elasticsearch connections used by Centralized Pipeline Management and SNMP.
91
+
92
+ ### List connections
93
+
94
+ ```
95
+ GET /api/connections/
96
+ ```
97
+
98
+ Returns an array of all connections. No query parameters.
99
+
100
+ ```bash
101
+ curl -H "Authorization: ApiKey $KEY" https://logstashui.example.com/api/connections/
102
+ ```
103
+
104
+ ```json
105
+ [
106
+ {
107
+ "id": 1,
108
+ "name": "my-cluster",
109
+ "connection_type": "CENTRALIZED",
110
+ "host": null,
111
+ "port": 443,
112
+ "cloud_id": "<redacted>",
113
+ "cloud_url": "https://my-cluster.es.us-east-2.aws.elastic-cloud.com",
114
+ "username": null,
115
+ "is_active": true,
116
+ "created_at": "2026-01-01T12:00:00Z"
117
+ }
118
+ ]
119
+ ```
120
+
121
+ ---
122
+
123
+ ### Get a connection
124
+
125
+ ```
126
+ GET /api/connections/{id}/
127
+ ```
128
+
129
+ ```bash
130
+ curl -H "Authorization: ApiKey $KEY" https://logstashui.example.com/api/connections/1/
131
+ ```
132
+
133
+ Returns the same fields as the list. `404` if not found.
134
+
135
+ ---
136
+
137
+ ### Create a connection
138
+
139
+ ```
140
+ POST /api/connections/
141
+ ```
142
+
143
+ **Required role:** admin
144
+
145
+ The connection is tested before being saved. If the connectivity test fails the record is
146
+ rolled back and an error is returned.
147
+
148
+ Put the port in `port`, not in `host`. A port written into `host` (`https://es.example.com:9200`)
149
+ is moved to `port`; if `port` is also set to a different value, the request fails with `400`.
150
+
151
+ **URL + basic auth:**
152
+
153
+ ```bash
154
+ curl -X POST https://logstashui.example.com/api/connections/ \
155
+ -H "Authorization: ApiKey $KEY" \
156
+ -H "Content-Type: application/json" \
157
+ -d '{
158
+ "name": "my-cluster",
159
+ "connection_type": "CENTRALIZED",
160
+ "connection_mode": "url",
161
+ "auth_type": "basic",
162
+ "host": "https://es.example.com",
163
+ "port": 9200,
164
+ "username": "elastic",
165
+ "password": "<password>"
166
+ }'
167
+ ```
168
+
169
+ **Elastic Cloud + API key:**
170
+
171
+ ```bash
172
+ curl -X POST https://logstashui.example.com/api/connections/ \
173
+ -H "Authorization: ApiKey $KEY" \
174
+ -H "Content-Type: application/json" \
175
+ -d '{
176
+ "name": "my-cloud",
177
+ "connection_type": "CENTRALIZED",
178
+ "connection_mode": "cloud",
179
+ "auth_type": "api_key",
180
+ "cloud_id": "<elastic-cloud-id>",
181
+ "cloud_url": "https://my-cluster.es.us-east-2.aws.elastic-cloud.com",
182
+ "port": 443,
183
+ "api_key": "<elasticsearch-api-key>"
184
+ }'
185
+ ```
186
+
187
+ ```json
188
+ {"success": true, "connection_id": 1, "message": "Connection created and tested successfully."}
189
+ ```
190
+
191
+ | Field | Required | Notes |
192
+ |-------|----------|-------|
193
+ | `name` | yes | Must be unique |
194
+ | `connection_type` | yes | `CENTRALIZED` or `AGENT` |
195
+ | `connection_mode` | no | `url` or `cloud` |
196
+ | `auth_type` | no | `basic` or `api_key` |
197
+ | `host` | one of | Full URL e.g. `https://es.example.com` |
198
+ | `cloud_id` | one of | Elastic Cloud ID |
199
+ | `cloud_url` | no | Full cluster URL |
200
+ | `port` | no | `9200` for URL, `443` for Cloud |
201
+ | `username` / `password` | no | Basic auth |
202
+ | `api_key` | no | Elasticsearch API key |
203
+ | `allow_self_signed_certs` | no | `true` to skip TLS certificate verification for Elasticsearch and Kibana calls. Defaults to `false` on create; omitted on update keeps the stored value |
204
+
205
+ ---
206
+
207
+ ### Update a connection
208
+
209
+ ```
210
+ PUT /api/connections/{id}/
211
+ ```
212
+
213
+ **Required role:** admin
214
+
215
+ Accepts the same fields as POST. The connectivity test is re-run; on failure the update is
216
+ rolled back.
217
+
218
+ ```bash
219
+ curl -X PUT https://logstashui.example.com/api/connections/1/ \
220
+ -H "Authorization: ApiKey $KEY" \
221
+ -H "Content-Type: application/json" \
222
+ -d '{"name": "my-cluster-renamed", "port": 443}'
223
+ ```
224
+
225
+ ```json
226
+ {"success": true, "connection_id": 1, "message": "Connection updated and tested successfully."}
227
+ ```
228
+
229
+ ---
230
+
231
+ ### Delete a connection
232
+
233
+ ```
234
+ DELETE /api/connections/{id}/
235
+ ```
236
+
237
+ **Required role:** admin
238
+
239
+ ```bash
240
+ curl -X DELETE https://logstashui.example.com/api/connections/1/ \
241
+ -H "Authorization: ApiKey $KEY"
242
+ ```
243
+
244
+ ```json
245
+ {"success": true, "message": "Connection 'my-cluster' deleted."}
246
+ ```
247
+
248
+ ---
249
+
250
+ ### Test a connection
251
+
252
+ ```
253
+ POST /api/connections/{id}/test/
254
+ ```
255
+
256
+ Runs a live connectivity check against the saved connection without modifying it.
257
+
258
+ ```bash
259
+ curl -X POST https://logstashui.example.com/api/connections/1/test/ \
260
+ -H "Authorization: ApiKey $KEY"
261
+ ```
262
+
263
+ ```json
264
+ {"success": true, "message": "Connection test successful."}
265
+ ```
266
+
267
+ ---
268
+
269
+ ## Security
270
+
271
+ Manage users, roles, and API keys. All write operations require admin role, except
272
+ `/api/security/bootstrap/` (unauthenticated when no users exist) and
273
+ `/api/security/me/` (any authenticated user).
274
+
275
+ ### Bootstrap
276
+
277
+ ```
278
+ GET /api/security/bootstrap/
279
+ POST /api/security/bootstrap/
280
+ ```
281
+
282
+ Checks whether the initial admin account has been created. Unauthenticated; returns
283
+ `{"bootstrapped": false}` when no users exist yet.
284
+
285
+ **Check status:**
286
+
287
+ ```bash
288
+ curl https://logstashui.example.com/api/security/bootstrap/
289
+ ```
290
+
291
+ ```json
292
+ {"bootstrapped": false, "message": "No users exist. POST to this endpoint to create the first admin."}
293
+ ```
294
+
295
+ **Create the first admin (optionally also create an API key):**
296
+
297
+ ```bash
298
+ curl -X POST https://logstashui.example.com/api/security/bootstrap/ \
299
+ -H "Content-Type: application/json" \
300
+ -d '{
301
+ "username": "admin",
302
+ "password": "<strong-password>",
303
+ "email": "admin@example.com",
304
+ "create_key": true,
305
+ "key_name": "bootstrap-key"
306
+ }'
307
+ ```
308
+
309
+ ```json
310
+ {
311
+ "success": true,
312
+ "message": "Admin user created successfully.",
313
+ "user_id": 1,
314
+ "key": "lsui_<prefix>_<secret>"
315
+ }
316
+ ```
317
+
318
+ ---
319
+
320
+ ### Current user (me)
321
+
322
+ ```
323
+ GET /api/security/me/
324
+ ```
325
+
326
+ Returns the identity of the caller. Any authenticated user.
327
+
328
+ ```bash
329
+ curl -H "Authorization: ApiKey $KEY" https://logstashui.example.com/api/security/me/
330
+ ```
331
+
332
+ ```json
333
+ {
334
+ "id": 1,
335
+ "username": "admin",
336
+ "email": "admin@example.com",
337
+ "role": "admin",
338
+ "is_active": true
339
+ }
340
+ ```
341
+
342
+ ---
343
+
344
+ ### List users
345
+
346
+ ```
347
+ GET /api/security/users/
348
+ ```
349
+
350
+ **Required role:** admin
351
+
352
+ ```bash
353
+ curl -H "Authorization: ApiKey $KEY" https://logstashui.example.com/api/security/users/
354
+ ```
355
+
356
+ ```json
357
+ {
358
+ "users": [
359
+ {"id": 1, "username": "admin", "email": "admin@example.com", "role": "admin", "is_active": true}
360
+ ]
361
+ }
362
+ ```
363
+
364
+ ---
365
+
366
+ ### Create a user
367
+
368
+ ```
369
+ POST /api/security/users/
370
+ ```
371
+
372
+ **Required role:** admin
373
+
374
+ ```bash
375
+ curl -X POST https://logstashui.example.com/api/security/users/ \
376
+ -H "Authorization: ApiKey $KEY" \
377
+ -H "Content-Type: application/json" \
378
+ -d '{
379
+ "username": "reader",
380
+ "password": "<strong-password>",
381
+ "email": "reader@example.com",
382
+ "role": "readonly"
383
+ }'
384
+ ```
385
+
386
+ ```json
387
+ {"success": true, "user_id": 2, "message": "User created."}
388
+ ```
389
+
390
+ | Field | Required | Notes |
391
+ |-------|----------|-------|
392
+ | `username` | yes | Must be unique |
393
+ | `password` | yes | Minimum 8 characters |
394
+ | `email` | no | |
395
+ | `role` | no | `admin` or `readonly` (default: `readonly`) |
396
+
397
+ ---
398
+
399
+ ### Get a user
400
+
401
+ ```
402
+ GET /api/security/users/{id}/
403
+ ```
404
+
405
+ **Required role:** admin
406
+
407
+ ```bash
408
+ curl -H "Authorization: ApiKey $KEY" https://logstashui.example.com/api/security/users/2/
409
+ ```
410
+
411
+ ---
412
+
413
+ ### Update a user
414
+
415
+ ```
416
+ PUT /api/security/users/{id}/
417
+ ```
418
+
419
+ **Required role:** admin
420
+
421
+ ```bash
422
+ curl -X PUT https://logstashui.example.com/api/security/users/2/ \
423
+ -H "Authorization: ApiKey $KEY" \
424
+ -H "Content-Type: application/json" \
425
+ -d '{"role": "admin", "email": "reader-promoted@example.com"}'
426
+ ```
427
+
428
+ ```json
429
+ {"success": true, "message": "User updated."}
430
+ ```
431
+
432
+ ---
433
+
434
+ ### Delete a user
435
+
436
+ ```
437
+ DELETE /api/security/users/{id}/
438
+ ```
439
+
440
+ **Required role:** admin. Cannot delete your own account or the last remaining user.
441
+
442
+ ```bash
443
+ curl -X DELETE https://logstashui.example.com/api/security/users/2/ \
444
+ -H "Authorization: ApiKey $KEY"
445
+ ```
446
+
447
+ ```json
448
+ {"success": true, "message": "User 'reader' deleted."}
449
+ ```
450
+
451
+ ---
452
+
453
+ ### List API keys
454
+
455
+ ```
456
+ GET /api/security/keys/
457
+ ```
458
+
459
+ **Required role:** admin. Secret values are never returned.
460
+
461
+ ```bash
462
+ curl -H "Authorization: ApiKey $KEY" https://logstashui.example.com/api/security/keys/
463
+ ```
464
+
465
+ ```json
466
+ {
467
+ "keys": [
468
+ {
469
+ "id": 1,
470
+ "name": "ci-key",
471
+ "prefix": "lsui_abc123",
472
+ "created_at": "2026-01-01T12:00:00Z",
473
+ "expires_at": null,
474
+ "revoked": false,
475
+ "username": "admin"
476
+ }
477
+ ]
478
+ }
479
+ ```
480
+
481
+ ---
482
+
483
+ ### Create an API key
484
+
485
+ ```
486
+ POST /api/security/keys/
487
+ ```
488
+
489
+ **Required role:** admin. The full key value is returned **once** — store it immediately.
490
+
491
+ ```bash
492
+ curl -X POST https://logstashui.example.com/api/security/keys/ \
493
+ -H "Authorization: ApiKey $KEY" \
494
+ -H "Content-Type: application/json" \
495
+ -d '{"name": "ci-key", "expires_in_days": 90, "user_id": 1}'
496
+ ```
497
+
498
+ ```json
499
+ {
500
+ "success": true,
501
+ "key": "lsui_<prefix>_<secret>",
502
+ "id": 1,
503
+ "message": "API key created. Store it now — it will not be shown again."
504
+ }
505
+ ```
506
+
507
+ | Field | Required | Notes |
508
+ |-------|----------|-------|
509
+ | `name` | yes | Descriptive label |
510
+ | `user_id` | no | Defaults to the calling user |
511
+ | `expires_in_days` | no | Omit for no expiry |
512
+
513
+ ---
514
+
515
+ ### Revoke an API key
516
+
517
+ ```
518
+ POST /api/security/keys/{id}/revoke/
519
+ ```
520
+
521
+ **Required role:** admin. The key stops working immediately; the row is kept for audit.
522
+
523
+ ```bash
524
+ curl -X POST https://logstashui.example.com/api/security/keys/1/revoke/ \
525
+ -H "Authorization: ApiKey $KEY"
526
+ ```
527
+
528
+ ```json
529
+ {"success": true, "message": "Key revoked."}
530
+ ```
531
+
532
+ ---
533
+
534
+ ### Delete an API key
535
+
536
+ ```
537
+ DELETE /api/security/keys/{id}/
538
+ ```
539
+
540
+ **Required role:** admin. Hard delete — removes the audit record as well.
541
+
542
+ ```bash
543
+ curl -X DELETE https://logstashui.example.com/api/security/keys/1/ \
544
+ -H "Authorization: ApiKey $KEY"
545
+ ```
546
+
547
+ ```json
548
+ {"success": true, "message": "Key deleted."}
549
+ ```
550
+
551
+ ---
552
+
553
+ ## SNMP Devices
554
+
555
+ Create and manage the devices that LogstashUI polls via SNMP.
556
+
557
+ ### List devices
558
+
559
+ ```
560
+ GET /api/snmp/devices/
561
+ ```
562
+
563
+ Paginated, filterable. Any authenticated user.
564
+
565
+ | Parameter | Default | Notes |
566
+ |-----------|---------|-------|
567
+ | `page` | `1` | |
568
+ | `page_size` | `25` | Max 200 |
569
+ | `search` | — | Case-insensitive match on name, IP, or hostname |
570
+ | `network` | — | Filter by network ID |
571
+ | `sort_by` | `-created_at` | `name`, `-name`, `ip_address`, `-ip_address`, `hostname`, `-hostname`, `created_at`, `-created_at` |
572
+
573
+ ```bash
574
+ curl "https://logstashui.example.com/api/snmp/devices/?search=router&sort_by=name&page_size=50" \
575
+ -H "Authorization: ApiKey $KEY"
576
+ ```
577
+
578
+ ```json
579
+ {
580
+ "devices": [
581
+ {
582
+ "id": 1,
583
+ "name": "core-router",
584
+ "ip_address": "10.0.0.1",
585
+ "hostname": "router.example.com",
586
+ "port": 161,
587
+ "retries": 2,
588
+ "timeout": 1000,
589
+ "credential_id": 1,
590
+ "credential_name": "Public",
591
+ "network_id": 1,
592
+ "network_name": "Homelab",
593
+ "network_deployment_mode": "AGENT",
594
+ "device_template_id": 12,
595
+ "device_template_name": "cisco_ios",
596
+ "site": null,
597
+ "building": null,
598
+ "room": null,
599
+ "created_at": "2026-01-01T12:00:00Z"
600
+ }
601
+ ],
602
+ "total": 1,
603
+ "page": 1,
604
+ "page_size": 25,
605
+ "total_pages": 1,
606
+ "has_next": false,
607
+ "has_previous": false
608
+ }
609
+ ```
610
+
611
+ ---
612
+
613
+ ### Get a device
614
+
615
+ ```
616
+ GET /api/snmp/devices/{id}/
617
+ ```
618
+
619
+ Returns the full device record including `latitude`, `longitude`, `metadata`, and `updated_at`.
620
+ Any authenticated user.
621
+
622
+ ```bash
623
+ curl -H "Authorization: ApiKey $KEY" https://logstashui.example.com/api/snmp/devices/1/
624
+ ```
625
+
626
+ ```json
627
+ {
628
+ "success": true,
629
+ "device": {
630
+ "id": 1,
631
+ "name": "core-router",
632
+ "ip_address": "10.0.0.1",
633
+ "hostname": "router.example.com",
634
+ "port": 161,
635
+ "retries": 2,
636
+ "timeout": 1000,
637
+ "credential_id": 1,
638
+ "network_id": 1,
639
+ "device_template_id": 12,
640
+ "site": null,
641
+ "building": null,
642
+ "room": null,
643
+ "latitude": null,
644
+ "longitude": null,
645
+ "metadata": {},
646
+ "created_at": "2026-01-01T12:00:00Z",
647
+ "updated_at": "2026-01-01T12:00:00Z"
648
+ }
649
+ }
650
+ ```
651
+
652
+ ---
653
+
654
+ ### Create a device
655
+
656
+ ```
657
+ POST /api/snmp/devices/
658
+ ```
659
+
660
+ **Required role:** admin. At least one of `ip_address` or `hostname` is required.
661
+ On success, `SNMPDeploymentState` is flagged so the next deploy picks up the change.
662
+
663
+ ```bash
664
+ curl -X POST https://logstashui.example.com/api/snmp/devices/ \
665
+ -H "Authorization: ApiKey $KEY" \
666
+ -H "Content-Type: application/json" \
667
+ -d '{
668
+ "name": "core-router",
669
+ "ip_address": "10.0.0.1",
670
+ "hostname": "router.example.com",
671
+ "port": 161,
672
+ "retries": 2,
673
+ "timeout": 1000,
674
+ "credential": 1,
675
+ "network": 1,
676
+ "device_template": 12,
677
+ "site": "HQ",
678
+ "building": "Data Centre",
679
+ "room": "Rack 3",
680
+ "latitude": 37.7749,
681
+ "longitude": -122.4194,
682
+ "metadata": {"role": "core"}
683
+ }'
684
+ ```
685
+
686
+ ```json
687
+ {"success": true, "id": 1, "message": "Device created successfully."}
688
+ ```
689
+
690
+ | Field | Required | Notes |
691
+ |-------|----------|-------|
692
+ | `name` | yes | Must be unique |
693
+ | `ip_address` | one of | |
694
+ | `hostname` | one of | |
695
+ | `port` | no | Default `161` |
696
+ | `retries` | no | Default `2` |
697
+ | `timeout` | no | Milliseconds, default `1000` |
698
+ | `credential` | no | Credential ID |
699
+ | `network` | no | Network ID |
700
+ | `device_template` | no | Template ID |
701
+ | `site` / `building` / `room` | no | Location labels |
702
+ | `latitude` / `longitude` | no | Decimal degrees |
703
+ | `metadata` | no | Arbitrary JSON object |
704
+
705
+ ---
706
+
707
+ ### Update a device
708
+
709
+ ```
710
+ PUT /api/snmp/devices/{id}/
711
+ ```
712
+
713
+ **Required role:** admin. Pass `null` for any FK field to clear the association.
714
+
715
+ ```bash
716
+ curl -X PUT https://logstashui.example.com/api/snmp/devices/1/ \
717
+ -H "Authorization: ApiKey $KEY" \
718
+ -H "Content-Type: application/json" \
719
+ -d '{
720
+ "name": "core-router-updated",
721
+ "ip_address": "10.0.0.2",
722
+ "port": 1161,
723
+ "retries": 3,
724
+ "network": null
725
+ }'
726
+ ```
727
+
728
+ ```json
729
+ {"success": true, "id": 1, "message": "Device updated successfully."}
730
+ ```
731
+
732
+ ---
733
+
734
+ ### Delete a device
735
+
736
+ ```
737
+ DELETE /api/snmp/devices/{id}/
738
+ ```
739
+
740
+ **Required role:** admin.
741
+
742
+ ```bash
743
+ curl -X DELETE https://logstashui.example.com/api/snmp/devices/1/ \
744
+ -H "Authorization: ApiKey $KEY"
745
+ ```
746
+
747
+ ```json
748
+ {"success": true, "message": "Device 'core-router-updated' deleted."}
749
+ ```
750
+
751
+ ---
752
+
753
+ ---
754
+
755
+ ## SNMP Credentials
756
+
757
+ Manage SNMP community strings (v1/v2c) and SNMPv3 user security profiles.
758
+ Secret values (community string, auth/priv passwords) are **stored encrypted** and
759
+ **never returned** by the API — the response indicates only whether a secret is set.
760
+
761
+ All write operations require **admin** role. Reads require any authenticated user.
762
+
763
+ > [!NOTE]
764
+ > Every create, update, or delete on a credential flags `SNMPDeploymentState` as changed.
765
+ > This lights up the "deploy needed" indicator so keystore changes are pushed on the next
766
+ > agent deploy.
767
+
768
+ ### List credentials
769
+
770
+ ```
771
+ GET /api/snmp/credentials/
772
+ ```
773
+
774
+ | Parameter | Notes |
775
+ |-----------|-------|
776
+ | `search` | Case-insensitive match on name or description |
777
+ | `version` | Filter by SNMP version: `1`, `2c`, or `3` |
778
+
779
+ ```bash
780
+ curl -H "Authorization: ApiKey $KEY" \
781
+ "https://logstashui.example.com/api/snmp/credentials/?version=2c"
782
+ ```
783
+
784
+ ```json
785
+ {
786
+ "credentials": [
787
+ {
788
+ "id": 1,
789
+ "name": "Public",
790
+ "description": "",
791
+ "version": "2c",
792
+ "security_level": null,
793
+ "device_count": 5,
794
+ "created_at": "2026-01-01T12:00:00Z"
795
+ }
796
+ ],
797
+ "total": 1
798
+ }
799
+ ```
800
+
801
+ ---
802
+
803
+ ### Get a credential
804
+
805
+ ```
806
+ GET /api/snmp/credentials/{id}/
807
+ ```
808
+
809
+ Returns all non-secret fields. Secret fields show `***` when set or `""` when empty.
810
+
811
+ ```bash
812
+ curl -H "Authorization: ApiKey $KEY" \
813
+ https://logstashui.example.com/api/snmp/credentials/1/
814
+ ```
815
+
816
+ **v2c response:**
817
+ ```json
818
+ {
819
+ "success": true,
820
+ "credential": {
821
+ "id": 1,
822
+ "name": "Public",
823
+ "description": "",
824
+ "version": "2c",
825
+ "has_community": true,
826
+ "community": "***",
827
+ "created_at": "2026-01-01T12:00:00Z",
828
+ "updated_at": "2026-01-01T12:00:00Z"
829
+ }
830
+ }
831
+ ```
832
+
833
+ **v3 response:**
834
+ ```json
835
+ {
836
+ "success": true,
837
+ "credential": {
838
+ "id": 2,
839
+ "name": "snmpv3-user",
840
+ "version": "3",
841
+ "security_name": "snmpuser",
842
+ "security_level": "authPriv",
843
+ "auth_protocol": "sha",
844
+ "auth_pass": "***",
845
+ "priv_protocol": "aes",
846
+ "priv_pass": "***",
847
+ "has_auth_pass": true,
848
+ "has_priv_pass": true,
849
+ "created_at": "2026-01-01T12:00:00Z",
850
+ "updated_at": "2026-01-01T12:00:00Z"
851
+ }
852
+ }
853
+ ```
854
+
855
+ ---
856
+
857
+ ### Create a credential
858
+
859
+ ```
860
+ POST /api/snmp/credentials/
861
+ ```
862
+
863
+ **Required role:** admin
864
+
865
+ **SNMPv2c:**
866
+ ```bash
867
+ curl -X POST https://logstashui.example.com/api/snmp/credentials/ \
868
+ -H "Authorization: ApiKey $KEY" \
869
+ -H "Content-Type: application/json" \
870
+ -d '{
871
+ "name": "datacenter-v2c",
872
+ "description": "v2c community for datacenter switches",
873
+ "version": "2c",
874
+ "community": "s3cr3t-community"
875
+ }'
876
+ ```
877
+
878
+ **SNMPv3 (authPriv):**
879
+ ```bash
880
+ curl -X POST https://logstashui.example.com/api/snmp/credentials/ \
881
+ -H "Authorization: ApiKey $KEY" \
882
+ -H "Content-Type: application/json" \
883
+ -d '{
884
+ "name": "datacenter-v3",
885
+ "version": "3",
886
+ "security_name": "snmpuser",
887
+ "security_level": "authPriv",
888
+ "auth_protocol": "sha",
889
+ "auth_pass": "authpassword123",
890
+ "priv_protocol": "aes",
891
+ "priv_pass": "privpassword123"
892
+ }'
893
+ ```
894
+
895
+ ```json
896
+ {"success": true, "id": 3, "message": "Credential created successfully."}
897
+ ```
898
+
899
+ | Field | Required | Notes |
900
+ |-------|----------|-------|
901
+ | `name` | yes | Must be unique |
902
+ | `version` | yes | `1`, `2c`, or `3` |
903
+ | `description` | no | |
904
+ | `community` | v1/v2c | Community string (stored encrypted) |
905
+ | `security_name` | v3 | SNMPv3 username |
906
+ | `security_level` | v3 | `noAuthNoPriv`, `authNoPriv`, or `authPriv` |
907
+ | `auth_protocol` | v3 authNoPriv/authPriv | `md5`, `sha`, `sha2`, `hmac128sha224`, `hmac192sha256`, `hmac256sha384`, `hmac384sha512` |
908
+ | `auth_pass` | v3 authNoPriv/authPriv | Stored encrypted |
909
+ | `priv_protocol` | v3 authPriv | `des`, `3des`, `aes`, `aes128`, `aes192`, `aes256` |
910
+ | `priv_pass` | v3 authPriv | Stored encrypted |
911
+
912
+ ---
913
+
914
+ ### Update a credential
915
+
916
+ ```
917
+ PUT /api/snmp/credentials/{id}/
918
+ ```
919
+
920
+ **Required role:** admin
921
+
922
+ Pass the same fields as POST. To **keep an existing secret** (community, auth_pass, priv_pass),
923
+ omit the field or send an **empty string** — the stored value is preserved. Send a non-empty
924
+ string to rotate the secret.
925
+
926
+ ```bash
927
+ curl -X PUT https://logstashui.example.com/api/snmp/credentials/3/ \
928
+ -H "Authorization: ApiKey $KEY" \
929
+ -H "Content-Type: application/json" \
930
+ -d '{
931
+ "name": "datacenter-v3",
932
+ "version": "3",
933
+ "security_name": "snmpuser",
934
+ "security_level": "authPriv",
935
+ "auth_protocol": "sha",
936
+ "auth_pass": "",
937
+ "priv_protocol": "aes",
938
+ "priv_pass": "new-priv-password"
939
+ }'
940
+ ```
941
+
942
+ ```json
943
+ {"success": true, "id": 3, "message": "Credential updated successfully."}
944
+ ```
945
+
946
+ ---
947
+
948
+ ### Delete a credential
949
+
950
+ ```
951
+ DELETE /api/snmp/credentials/{id}/
952
+ ```
953
+
954
+ **Required role:** admin. Devices and networks that reference this credential will have their FK set to `null`.
955
+
956
+ ```bash
957
+ curl -X DELETE https://logstashui.example.com/api/snmp/credentials/3/ \
958
+ -H "Authorization: ApiKey $KEY"
959
+ ```
960
+
961
+ ```json
962
+ {"success": true, "message": "Credential 'datacenter-v3' deleted."}
963
+ ```
964
+
965
+ ---
966
+
967
+ ## SNMP Networks
968
+
969
+ Manage the network ranges that LogstashUI discovers and polls. Each network is associated
970
+ with an Elasticsearch connection and optional SNMP credentials.
971
+
972
+ > [!WARNING]
973
+ > Networks larger than `/20` are rejected. Discovery expands the full IP range in memory;
974
+ > a `/16` (65,536 addresses) would exhaust available RAM. Break large ranges into `/20` or
975
+ > smaller subnets.
976
+
977
+ All write operations require **admin** role. Reads require any authenticated user.
978
+
979
+ > [!NOTE]
980
+ > Deleting a network also attempts to remove the associated Logstash polling and trap
981
+ > pipelines from Elasticsearch. This is best-effort — the network row is removed regardless
982
+ > of whether pipeline cleanup succeeds.
983
+
984
+ ### List networks
985
+
986
+ ```
987
+ GET /api/snmp/networks/
988
+ ```
989
+
990
+ | Parameter | Notes |
991
+ |-----------|-------|
992
+ | `search` | Case-insensitive match on name or network range |
993
+
994
+ ```bash
995
+ curl -H "Authorization: ApiKey $KEY" \
996
+ https://logstashui.example.com/api/snmp/networks/
997
+ ```
998
+
999
+ ```json
1000
+ {
1001
+ "networks": [
1002
+ {
1003
+ "id": 1,
1004
+ "name": "Homelab",
1005
+ "network_range": "192.168.4.0/22",
1006
+ "deployment_mode": "AGENT",
1007
+ "credential_mode": "KEYSTORE",
1008
+ "connection_id": 17,
1009
+ "connection_name": "Homelab",
1010
+ "agent_connection_id": 8,
1011
+ "agent_connection_name": "LogstashAgent-Packaged",
1012
+ "discovery_credential_id": 1,
1013
+ "credential_id": null,
1014
+ "discovery_enabled": true,
1015
+ "traps_enabled": false,
1016
+ "interval": 60,
1017
+ "namespace": "default",
1018
+ "namespace_from_device_template": false,
1019
+ "ssl_certificate_authorities": "",
1020
+ "device_count": 12,
1021
+ "created_at": "2026-01-01T12:00:00Z",
1022
+ "updated_at": "2026-01-01T12:00:00Z"
1023
+ }
1024
+ ],
1025
+ "total": 1
1026
+ }
1027
+ ```
1028
+
1029
+ ---
1030
+
1031
+ ### Get a network
1032
+
1033
+ ```
1034
+ GET /api/snmp/networks/{id}/
1035
+ ```
1036
+
1037
+ Returns the same fields as the list. `404` if not found.
1038
+
1039
+ ```bash
1040
+ curl -H "Authorization: ApiKey $KEY" \
1041
+ https://logstashui.example.com/api/snmp/networks/1/
1042
+ ```
1043
+
1044
+ ---
1045
+
1046
+ ### Create a network
1047
+
1048
+ ```
1049
+ POST /api/snmp/networks/
1050
+ ```
1051
+
1052
+ **Required role:** admin
1053
+
1054
+ ```bash
1055
+ curl -X POST https://logstashui.example.com/api/snmp/networks/ \
1056
+ -H "Authorization: ApiKey $KEY" \
1057
+ -H "Content-Type: application/json" \
1058
+ -d '{
1059
+ "name": "Office",
1060
+ "network_range": "10.10.10.0/24",
1061
+ "deployment_mode": "CENTRALIZED",
1062
+ "credential_mode": "KEYSTORE",
1063
+ "connection": 1,
1064
+ "discovery_credential": 1,
1065
+ "discovery_enabled": true,
1066
+ "traps_enabled": false,
1067
+ "interval": 30,
1068
+ "namespace": "default"
1069
+ }'
1070
+ ```
1071
+
1072
+ ```json
1073
+ {"success": true, "id": 2, "message": "Network created successfully."}
1074
+ ```
1075
+
1076
+ | Field | Required | Notes |
1077
+ |-------|----------|-------|
1078
+ | `name` | yes | Must be unique |
1079
+ | `network_range` | yes | CIDR notation, prefix must be `/20` or longer |
1080
+ | `deployment_mode` | no | `CENTRALIZED` (default) or `AGENT` |
1081
+ | `credential_mode` | no | `KEYSTORE` (default) or `PLAINTEXT` (centralized only) |
1082
+ | `connection` | no | Elasticsearch connection ID (for centralized polling) |
1083
+ | `agent_connection` | no | Agent connection ID (for agent-mode polling) |
1084
+ | `discovery_credential` | no | Credential ID used for discovery |
1085
+ | `credential` | no | Credential ID used for trap ingestion |
1086
+ | `discovery_enabled` | no | Default `true` |
1087
+ | `traps_enabled` | no | Default `false` |
1088
+ | `interval` | no | Poll interval in seconds, default `30` |
1089
+ | `namespace` | no | Data-stream namespace, default `"default"` |
1090
+ | `namespace_from_device_template` | no | Derive namespace from device template name |
1091
+ | `ssl_certificate_authorities` | no | Comma-separated CA file paths (or a JSON array) for the generated Elasticsearch output to trust, e.g. `/etc/logstash/certs/ca.crt`. Paths are read on the Logstash host. Ignored for plain `http://` connections. When set, the pipeline verifies the server certificate against these CAs and does not disable verification |
1092
+
1093
+ ---
1094
+
1095
+ ### Update a network
1096
+
1097
+ ```
1098
+ PUT /api/snmp/networks/{id}/
1099
+ ```
1100
+
1101
+ **Required role:** admin. Pass `null` for any FK field to clear it. CIDR validation applies on update too.
1102
+
1103
+ ```bash
1104
+ curl -X PUT https://logstashui.example.com/api/snmp/networks/2/ \
1105
+ -H "Authorization: ApiKey $KEY" \
1106
+ -H "Content-Type: application/json" \
1107
+ -d '{
1108
+ "name": "Office-updated",
1109
+ "interval": 60,
1110
+ "traps_enabled": true,
1111
+ "connection": null
1112
+ }'
1113
+ ```
1114
+
1115
+ ```json
1116
+ {"success": true, "id": 2, "message": "Network updated successfully."}
1117
+ ```
1118
+
1119
+ ---
1120
+
1121
+ ### Delete a network
1122
+
1123
+ ```
1124
+ DELETE /api/snmp/networks/{id}/
1125
+ ```
1126
+
1127
+ **Required role:** admin.
1128
+
1129
+ ```bash
1130
+ curl -X DELETE https://logstashui.example.com/api/snmp/networks/2/ \
1131
+ -H "Authorization: ApiKey $KEY"
1132
+ ```
1133
+
1134
+ ```json
1135
+ {"success": true, "message": "Network 'Office-updated' deleted."}
1136
+ ```
1137
+
1138
+ If associated Logstash pipelines were also removed from Elasticsearch, the message will include the pipeline names.
1139
+
1140
+ ---
1141
+
1142
+ ## SNMP Profiles
1143
+
1144
+ OID profiles define which metrics to collect from a device (`get`, `walk`, `table` mappings).
1145
+ They are attached to [Device Templates](#snmp-device-templates) in a many-to-many relationship.
1146
+
1147
+ **Official profiles** ship with LogstashUI and have names ending in `.json` (e.g. `cisco_ios.json`).
1148
+ They cannot be deleted.
1149
+
1150
+ All write operations require **admin** role. Reads require any authenticated user.
1151
+
1152
+ ### List profiles
1153
+
1154
+ ```
1155
+ GET /api/snmp/profiles/
1156
+ ```
1157
+
1158
+ | Parameter | Notes |
1159
+ |-----------|-------|
1160
+ | `search` | Case-insensitive match on name or vendor |
1161
+ | `official` | `true` or `false` to filter by official status |
1162
+
1163
+ ```bash
1164
+ curl -H "Authorization: ApiKey $KEY" \
1165
+ "https://logstashui.example.com/api/snmp/profiles/?official=false"
1166
+ ```
1167
+
1168
+ ```json
1169
+ {
1170
+ "profiles": [
1171
+ {
1172
+ "id": 36,
1173
+ "name": "my_custom_switch",
1174
+ "vendor": "Acme",
1175
+ "product": "Switch X",
1176
+ "description": "Custom profile for in-house switch",
1177
+ "is_official": false,
1178
+ "created_at": "2026-01-01T12:00:00Z"
1179
+ }
1180
+ ],
1181
+ "total": 1
1182
+ }
1183
+ ```
1184
+
1185
+ > [!NOTE]
1186
+ > The list response omits `profile_data` and `normalizers` (these can be large). Fetch the
1187
+ > individual profile to get the full OID map.
1188
+
1189
+ ---
1190
+
1191
+ ### Get a profile
1192
+
1193
+ ```
1194
+ GET /api/snmp/profiles/{id}/
1195
+ ```
1196
+
1197
+ Returns the full profile including `profile_data` and `normalizers`. Official profiles
1198
+ (`is_official: true`) return the OIDs and normalizers from the JSON file they ship in.
1199
+
1200
+ ```bash
1201
+ curl -H "Authorization: ApiKey $KEY" \
1202
+ https://logstashui.example.com/api/snmp/profiles/36/
1203
+ ```
1204
+
1205
+ ```json
1206
+ {
1207
+ "success": true,
1208
+ "profile": {
1209
+ "id": 36,
1210
+ "name": "my_custom_switch",
1211
+ "vendor": "Acme",
1212
+ "product": "Switch X",
1213
+ "description": "Custom profile for in-house switch",
1214
+ "is_official": false,
1215
+ "profile_data": {
1216
+ "get": {
1217
+ "system.name": "1.3.6.1.2.1.1.5.0",
1218
+ "system.uptime": "1.3.6.1.2.1.1.3.0"
1219
+ },
1220
+ "walk": [],
1221
+ "table": {}
1222
+ },
1223
+ "normalizers": [],
1224
+ "created_at": "2026-01-01T12:00:00Z",
1225
+ "updated_at": "2026-01-01T12:00:00Z"
1226
+ }
1227
+ }
1228
+ ```
1229
+
1230
+ ---
1231
+
1232
+ ### Create a profile
1233
+
1234
+ ```
1235
+ POST /api/snmp/profiles/
1236
+ ```
1237
+
1238
+ **Required role:** admin
1239
+
1240
+ ```bash
1241
+ curl -X POST https://logstashui.example.com/api/snmp/profiles/ \
1242
+ -H "Authorization: ApiKey $KEY" \
1243
+ -H "Content-Type: application/json" \
1244
+ -d '{
1245
+ "name": "my_custom_switch",
1246
+ "description": "Custom profile for in-house switch",
1247
+ "vendor": "Acme",
1248
+ "product": "Switch X",
1249
+ "profile_data": {
1250
+ "get": {
1251
+ "system.name": "1.3.6.1.2.1.1.5.0",
1252
+ "system.uptime": "1.3.6.1.2.1.1.3.0"
1253
+ },
1254
+ "walk": [],
1255
+ "table": {}
1256
+ },
1257
+ "normalizers": []
1258
+ }'
1259
+ ```
1260
+
1261
+ ```json
1262
+ {"success": true, "id": 36, "message": "Profile created successfully."}
1263
+ ```
1264
+
1265
+ | Field | Required | Notes |
1266
+ |-------|----------|-------|
1267
+ | `name` | yes | Must be unique. Names ending in `.json` are treated as official |
1268
+ | `vendor` | yes | |
1269
+ | `product` | no | |
1270
+ | `description` | no | |
1271
+ | `profile_data` | yes | Non-empty dict with `get`, `walk`, and/or `table` keys |
1272
+ | `normalizers` | no | List of normalizer configs |
1273
+
1274
+ ---
1275
+
1276
+ ### Update a profile
1277
+
1278
+ ```
1279
+ PUT /api/snmp/profiles/{id}/
1280
+ ```
1281
+
1282
+ **Required role:** admin. Renaming is supported via the `name` field; the endpoint checks for conflicts.
1283
+ Official profiles (`is_official: true`) cannot be modified (`409`, `"code": "protected"`).
1284
+
1285
+ ```bash
1286
+ curl -X PUT https://logstashui.example.com/api/snmp/profiles/36/ \
1287
+ -H "Authorization: ApiKey $KEY" \
1288
+ -H "Content-Type: application/json" \
1289
+ -d '{
1290
+ "name": "my_custom_switch_v2",
1291
+ "description": "Updated OID map",
1292
+ "profile_data": {
1293
+ "get": {"system.uptime": "1.3.6.1.2.1.1.3.0"},
1294
+ "walk": [],
1295
+ "table": {}
1296
+ }
1297
+ }'
1298
+ ```
1299
+
1300
+ ```json
1301
+ {"success": true, "id": 36, "message": "Profile updated successfully."}
1302
+ ```
1303
+
1304
+ ---
1305
+
1306
+ ### Delete a profile
1307
+
1308
+ ```
1309
+ DELETE /api/snmp/profiles/{id}/
1310
+ ```
1311
+
1312
+ **Required role:** admin. Official profiles (names ending in `.json`) cannot be deleted (`409`, `"code": "protected"`).
1313
+
1314
+ ```bash
1315
+ curl -X DELETE https://logstashui.example.com/api/snmp/profiles/36/ \
1316
+ -H "Authorization: ApiKey $KEY"
1317
+ ```
1318
+
1319
+ ```json
1320
+ {"success": true, "message": "Profile 'my_custom_switch_v2' deleted."}
1321
+ ```
1322
+
1323
+ ---
1324
+
1325
+ ## SNMP Device Templates
1326
+
1327
+ Device templates bundle one or more OID profiles and matching rules that LogstashUI uses
1328
+ to automatically classify newly discovered devices. They also control which metrics are
1329
+ collected from a device.
1330
+
1331
+ **Official templates** ship with LogstashUI (`official: true`). They cannot be modified
1332
+ or deleted — `PUT` and `DELETE` both return `409` with `"code": "protected"`.
1333
+
1334
+ All write operations require **admin** role. Reads require any authenticated user.
1335
+
1336
+ > [!NOTE]
1337
+ > Deleting a user-created template reassigns any devices currently using it to the built-in
1338
+ > `default` template. No devices are left without a template.
1339
+
1340
+ ### List templates
1341
+
1342
+ ```
1343
+ GET /api/snmp/templates/
1344
+ ```
1345
+
1346
+ | Parameter | Notes |
1347
+ |-----------|-------|
1348
+ | `search` | Case-insensitive match on name or vendor |
1349
+ | `official` | `true` or `false` to filter by official status |
1350
+
1351
+ ```bash
1352
+ curl -H "Authorization: ApiKey $KEY" \
1353
+ "https://logstashui.example.com/api/snmp/templates/?official=false"
1354
+ ```
1355
+
1356
+ ```json
1357
+ {
1358
+ "templates": [
1359
+ {
1360
+ "id": 17,
1361
+ "name": "my_custom_switch",
1362
+ "vendor": "Acme",
1363
+ "model": "Switch-X",
1364
+ "product": "",
1365
+ "type": "switch",
1366
+ "official": false,
1367
+ "description": "Template for in-house switches",
1368
+ "created_at": "2026-01-01T12:00:00Z"
1369
+ }
1370
+ ],
1371
+ "total": 1
1372
+ }
1373
+ ```
1374
+
1375
+ > [!NOTE]
1376
+ > The list response omits `profiles` and `matching_rules`. Fetch the individual template to
1377
+ > get those fields.
1378
+
1379
+ ---
1380
+
1381
+ ### Get a template
1382
+
1383
+ ```
1384
+ GET /api/snmp/templates/{id}/
1385
+ ```
1386
+
1387
+ Returns the full template including associated profiles and matching rules.
1388
+
1389
+ ```bash
1390
+ curl -H "Authorization: ApiKey $KEY" \
1391
+ https://logstashui.example.com/api/snmp/templates/1/
1392
+ ```
1393
+
1394
+ ```json
1395
+ {
1396
+ "success": true,
1397
+ "template": {
1398
+ "id": 1,
1399
+ "name": "generic_linux",
1400
+ "vendor": "Generic",
1401
+ "model": "",
1402
+ "product": "",
1403
+ "type": "",
1404
+ "official": true,
1405
+ "description": "",
1406
+ "matching_rules": ["Linux"],
1407
+ "profiles": [
1408
+ {"id": 10, "name": "generic_host_system_metrics.json"},
1409
+ {"id": 11, "name": "generic_interfaces.json"},
1410
+ {"id": 12, "name": "generic_system.json"},
1411
+ {"id": 13, "name": "generic_ucd_system_metrics.json"}
1412
+ ],
1413
+ "created_at": "2026-01-01T12:00:00Z",
1414
+ "updated_at": "2026-01-01T12:00:00Z"
1415
+ }
1416
+ }
1417
+ ```
1418
+
1419
+ ---
1420
+
1421
+ ### Create a template
1422
+
1423
+ ```
1424
+ POST /api/snmp/templates/
1425
+ ```
1426
+
1427
+ **Required role:** admin. New templates are always created as non-official (`official: false`).
1428
+
1429
+ ```bash
1430
+ curl -X POST https://logstashui.example.com/api/snmp/templates/ \
1431
+ -H "Authorization: ApiKey $KEY" \
1432
+ -H "Content-Type: application/json" \
1433
+ -d '{
1434
+ "name": "my_custom_switch",
1435
+ "description": "Template for in-house switches",
1436
+ "vendor": "Acme",
1437
+ "model": "Switch-X",
1438
+ "product": "Switch X Series",
1439
+ "type": "switch",
1440
+ "matching_rules": ["Acme Switch", "ACME-SW"],
1441
+ "profiles": [36, 37]
1442
+ }'
1443
+ ```
1444
+
1445
+ ```json
1446
+ {"success": true, "id": 17, "message": "Device template created successfully."}
1447
+ ```
1448
+
1449
+ If any profile ID in `profiles` does not exist, it is silently skipped and the response includes a `skipped_profiles` list.
1450
+
1451
+ | Field | Required | Notes |
1452
+ |-------|----------|-------|
1453
+ | `name` | yes | Must be unique |
1454
+ | `vendor` | yes | |
1455
+ | `model` / `product` / `type` | no | Metadata labels |
1456
+ | `description` | no | |
1457
+ | `matching_rules` | no | List of sysDescr substrings for auto-classification |
1458
+ | `profiles` | no | List of profile IDs to attach |
1459
+
1460
+ ---
1461
+
1462
+ ### Update a template
1463
+
1464
+ ```
1465
+ PUT /api/snmp/templates/{id}/
1466
+ ```
1467
+
1468
+ **Required role:** admin. Returns `409` with `"code": "protected"` for official templates.
1469
+ If `profiles` is provided, the existing profile list is **replaced** (not merged).
1470
+
1471
+ ```bash
1472
+ curl -X PUT https://logstashui.example.com/api/snmp/templates/17/ \
1473
+ -H "Authorization: ApiKey $KEY" \
1474
+ -H "Content-Type: application/json" \
1475
+ -d '{
1476
+ "description": "Updated description",
1477
+ "matching_rules": ["Acme Switch", "ACME-SW", "AcmeSW"],
1478
+ "profiles": [36]
1479
+ }'
1480
+ ```
1481
+
1482
+ ```json
1483
+ {"success": true, "id": 17, "message": "Device template updated successfully."}
1484
+ ```
1485
+
1486
+ ---
1487
+
1488
+ ### Delete a template
1489
+
1490
+ ```
1491
+ DELETE /api/snmp/templates/{id}/
1492
+ ```
1493
+
1494
+ **Required role:** admin. Returns `409` with `"code": "protected"` for official templates.
1495
+
1496
+ ```bash
1497
+ curl -X DELETE https://logstashui.example.com/api/snmp/templates/17/ \
1498
+ -H "Authorization: ApiKey $KEY"
1499
+ ```
1500
+
1501
+ ```json
1502
+ {"success": true, "message": "Device template 'my_custom_switch' deleted."}
1503
+ ```
1504
+
1505
+ ---
1506
+
1507
+ ## SNMP Deploy
1508
+
1509
+ Three endpoints control the SNMP deployment lifecycle. The recommended flow is:
1510
+
1511
+ 1. **Check status** — fast timestamp comparison, no ES round-trip.
1512
+ 2. **Compute diff** — reconciles desired pipelines against ES CPM / agent records and caches the plan for 60 seconds.
1513
+ 3. **Apply** — executes the cached plan (or falls back to a fresh reconciliation if the cache expired).
1514
+
1515
+ All three endpoints require **admin** role, except `GET /api/snmp/deploy/status/` which allows any authenticated user.
1516
+
1517
+ ### Check deploy status
1518
+
1519
+ ```
1520
+ GET /api/snmp/deploy/status/
1521
+ ```
1522
+
1523
+ Returns `has_changes: true` when configuration has been modified since the last successful deploy.
1524
+
1525
+ ```bash
1526
+ curl -H "Authorization: ApiKey $KEY" \
1527
+ https://logstashui.example.com/api/snmp/deploy/status/
1528
+ ```
1529
+
1530
+ ```json
1531
+ {"success": true, "has_changes": true}
1532
+ ```
1533
+
1534
+ ---
1535
+
1536
+ ### Compute deploy diff
1537
+
1538
+ ```
1539
+ POST /api/snmp/deploy/diff/
1540
+ ```
1541
+
1542
+ **Required role:** admin. Compares the desired pipeline set against what is currently deployed.
1543
+ Results are cached for 60 seconds so the subsequent `apply` call can reuse them.
1544
+
1545
+ Leftover generated pipelines are found on **every** CENTRALIZED connection, including ones no
1546
+ current network uses, and listed as `delete` entries with `pipeline_type: "orphaned"`.
1547
+
1548
+ | Body field | Default | Description |
1549
+ |---|---|---|
1550
+ | `detail` | `full` | `full`: each entry with its raw `current` and `new` config. `summary`: `counts` and one row per entry without config. `changes`: `summary` plus a unified `diff` per entry. |
1551
+ | `pipelines` | all | Pipeline names to keep in `networks`. `counts` always cover the whole plan. |
1552
+
1553
+ Every response includes `counts` (`create`, `update`, `delete`, `keystore_updates`, `errors`),
1554
+ counted the same way `apply` reports them.
1555
+
1556
+ Secret values in the generated config (community strings, SNMPv3 passwords, Elasticsearch API
1557
+ keys and passwords) are returned as `[redacted]` at every detail level; `${VAR}` keystore
1558
+ references are kept. The pipelines `apply` pushes still contain the real values.
1559
+
1560
+ ```bash
1561
+ curl -X POST https://logstashui.example.com/api/snmp/deploy/diff/ \
1562
+ -H "Authorization: ApiKey $KEY"
1563
+ ```
1564
+
1565
+ ```bash
1566
+ curl -X POST https://logstashui.example.com/api/snmp/deploy/diff/ \
1567
+ -H "Authorization: ApiKey $KEY" \
1568
+ -H "Content-Type: application/json" \
1569
+ -d '{"detail": "changes", "pipelines": ["snmp-office-discovery"]}'
1570
+ ```
1571
+
1572
+ ```json
1573
+ {
1574
+ "success": true,
1575
+ "has_changes": true,
1576
+ "blocking_errors": [],
1577
+ "networks": [
1578
+ {
1579
+ "action": "create",
1580
+ "pipeline_name": "snmp-office-cisco_ios-polling",
1581
+ "deployment_mode": "AGENT"
1582
+ },
1583
+ {
1584
+ "action": "create",
1585
+ "pipeline_name": "snmp-office-discovery",
1586
+ "deployment_mode": "AGENT"
1587
+ },
1588
+ {
1589
+ "action": "update",
1590
+ "pipeline_name": "Keystore: Packaged Policy",
1591
+ "deployment_mode": "AGENT"
1592
+ }
1593
+ ],
1594
+ "connections": [{"id": 17, "name": "Homelab"}]
1595
+ }
1596
+ ```
1597
+
1598
+ If `blocking_errors` is non-empty the deploy cannot proceed — fix the listed issues first.
1599
+
1600
+ ---
1601
+
1602
+ ### Apply deploy
1603
+
1604
+ ```
1605
+ POST /api/snmp/deploy/apply/
1606
+ ```
1607
+
1608
+ **Required role:** admin. Executes the deployment plan. Call `diff/` first to preview changes
1609
+ and cache the plan; `apply/` will reuse it. If the cache has expired (> 60 s), a fresh
1610
+ reconciliation is performed automatically.
1611
+
1612
+ ```bash
1613
+ curl -X POST https://logstashui.example.com/api/snmp/deploy/apply/ \
1614
+ -H "Authorization: ApiKey $KEY"
1615
+ ```
1616
+
1617
+ ```json
1618
+ {
1619
+ "success": true,
1620
+ "message": "Successfully deployed: 2 pipeline(s) created, 1 keystore value(s) updated",
1621
+ "pipelines_created": 2,
1622
+ "pipelines_updated": 0,
1623
+ "pipelines_deleted": 0,
1624
+ "errors": null
1625
+ }
1626
+ ```
1627
+
1628
+ After a successful apply, `GET /api/snmp/deploy/status/` returns `has_changes: false`.
1629
+
1630
+ **Cleanup deploy example** (after removing a network):
1631
+
1632
+ ```json
1633
+ {
1634
+ "success": true,
1635
+ "message": "Successfully deployed: 2 pipeline(s) deleted, 1 keystore value(s) updated",
1636
+ "pipelines_created": 0,
1637
+ "pipelines_updated": 0,
1638
+ "pipelines_deleted": 2,
1639
+ "errors": null
1640
+ }
1641
+ ```
1642
+
1643
+ ---
1644
+
1645
+ ## Policies
1646
+
1647
+ Agent policies define the Logstash runtime configuration (paths, JVM options, config files, pipelines) that
1648
+ is pushed to enrolled agents. Each policy has an independent revision history — edits accumulate until
1649
+ a **deploy** snapshots them as a new revision. Agents pull the latest snapshot on check-in.
1650
+
1651
+ **All policy endpoints require admin role.**
1652
+
1653
+ > [!NOTE]
1654
+ > The three large text fields — `logstash_yml`, `jvm_options`, and `log4j2_properties` — contain
1655
+ > complete config file contents and can each be several kilobytes. They are included in full in
1656
+ > single-policy responses. The list response also includes them, so pagination is recommended if
1657
+ > you are scripting over many policies.
1658
+
1659
+ > [!NOTE]
1660
+ > `policy_type` is immutable after creation. `EMBEDDED` policies are internal system policies
1661
+ > that cannot be read, created, cloned, or modified via the API.
1662
+
1663
+ ### List policies
1664
+
1665
+ ```
1666
+ GET /api/policies/
1667
+ ```
1668
+
1669
+ Returns all non-EMBEDDED policies with an active agent count. Add `?include_config=false` to
1670
+ leave out `logstash_yml`, `jvm_options`, and `log4j2_properties`.
1671
+
1672
+ ```bash
1673
+ curl -H "Authorization: ApiKey $KEY" https://logstashui.example.com/api/policies/
1674
+ ```
1675
+
1676
+ ```json
1677
+ {
1678
+ "success": true,
1679
+ "policies": [
1680
+ {
1681
+ "id": 1,
1682
+ "name": "Packaged Policy",
1683
+ "policy_type": "PACKAGED",
1684
+ "is_system": true,
1685
+ "cloned_from_id": null,
1686
+ "settings_path": "/etc/logstash/",
1687
+ "logs_path": "/var/log/logstash",
1688
+ "binary_path": "/usr/share/logstash/bin",
1689
+ "data_path": "",
1690
+ "agent_api_port": 9500,
1691
+ "logstash_api_port": 9560,
1692
+ "logstash_source": "SYSTEM",
1693
+ "logstash_version": "",
1694
+ "logstash_via_ui": false,
1695
+ "logstash_yml": "# ... full logstash.yml contents ...",
1696
+ "jvm_options": "# ... full jvm.options contents ...",
1697
+ "log4j2_properties": "# ... full log4j2.properties contents ...",
1698
+ "has_undeployed_changes": false,
1699
+ "current_revision_number": 3,
1700
+ "last_deployed_at": "2026-01-01T12:00:00Z",
1701
+ "active_agent_count": 2,
1702
+ "created_at": "2026-01-01T12:00:00Z",
1703
+ "updated_at": "2026-01-01T12:00:00Z"
1704
+ }
1705
+ ],
1706
+ "total": 1
1707
+ }
1708
+ ```
1709
+
1710
+ ---
1711
+
1712
+ ### Get a policy
1713
+
1714
+ ```
1715
+ GET /api/policies/{id}/
1716
+ ```
1717
+
1718
+ ```bash
1719
+ curl -H "Authorization: ApiKey $KEY" https://logstashui.example.com/api/policies/1/
1720
+ ```
1721
+
1722
+ Returns the same fields as the list, and takes the same `?include_config=false`. `404` if not
1723
+ found.
1724
+
1725
+ ---
1726
+
1727
+ ### Create a policy
1728
+
1729
+ ```
1730
+ POST /api/policies/
1731
+ ```
1732
+
1733
+ **Required role:** admin
1734
+
1735
+ A default enrollment token is minted automatically. If `logstash_yml`, `jvm_options`, or
1736
+ `log4j2_properties` are omitted, the system defaults are used.
1737
+
1738
+ ```bash
1739
+ curl -X POST https://logstashui.example.com/api/policies/ \
1740
+ -H "Authorization: ApiKey $KEY" \
1741
+ -H "Content-Type: application/json" \
1742
+ -d '{
1743
+ "name": "my-policy",
1744
+ "policy_type": "PACKAGED"
1745
+ }'
1746
+ ```
1747
+
1748
+ ```json
1749
+ {
1750
+ "success": true,
1751
+ "id": 5,
1752
+ "name": "my-policy",
1753
+ "policy_type": "PACKAGED",
1754
+ "message": "Policy 'my-policy' created successfully."
1755
+ }
1756
+ ```
1757
+
1758
+ | Field | Required | Notes |
1759
+ |-------|----------|-------|
1760
+ | `name` | yes | Must be unique |
1761
+ | `policy_type` | yes | `PACKAGED`, `MANAGED`, or `SIMULATE` |
1762
+ | `settings_path` | no | Default `/etc/logstash/` |
1763
+ | `logs_path` | no | Default `/var/log/logstash` |
1764
+ | `binary_path` | no | Default `/usr/share/logstash/bin` |
1765
+ | `data_path` | no | |
1766
+ | `keystore_env_file` | no | Default `/etc/default/logstash` |
1767
+ | `agent_api_port` | no | Port-type default applied per policy type |
1768
+ | `logstash_api_port` | no | Port-type default applied per policy type |
1769
+ | `logstash_source` | no | `SYSTEM` (default) or `VERSION` |
1770
+ | `logstash_version` | no | Required when `logstash_source` is `VERSION` |
1771
+ | `logstash_via_ui` | no | `false` default |
1772
+ | `logstash_yml` | no | Full file contents; system default used if omitted |
1773
+ | `jvm_options` | no | Full file contents; system default used if omitted |
1774
+ | `log4j2_properties` | no | Full file contents; system default used if omitted |
1775
+
1776
+ ---
1777
+
1778
+ ### Update a policy
1779
+
1780
+ ```
1781
+ PUT /api/policies/{id}/
1782
+ ```
1783
+
1784
+ **Required role:** admin
1785
+
1786
+ Pass only the fields you want to change. Two immutability rules apply:
1787
+
1788
+ - `policy_type` cannot be changed — send it matching the current value or omit it entirely.
1789
+ - `EMBEDDED` policies cannot be updated (`409`, `"code": "protected"`).
1790
+ - System `SIMULATE` and `MANAGED` policies are **path-locked**: `settings_path`, `logs_path`,
1791
+ `data_path`, and `keystore_env_file` are ignored. `jvm_options`, `logstash_yml`,
1792
+ `log4j2_properties`, `logstash_source`, `logstash_version`, and `binary_path` remain editable.
1793
+
1794
+ ```bash
1795
+ curl -X PUT https://logstashui.example.com/api/policies/5/ \
1796
+ -H "Authorization: ApiKey $KEY" \
1797
+ -H "Content-Type: application/json" \
1798
+ -d '{
1799
+ "jvm_options": "-Xms1g\n-Xmx1g\n",
1800
+ "logstash_yml": "pipeline.workers: 4\n"
1801
+ }'
1802
+ ```
1803
+
1804
+ ```json
1805
+ {"success": true, "message": "Policy 'my-policy' updated successfully."}
1806
+ ```
1807
+
1808
+ ---
1809
+
1810
+ ### Delete a policy
1811
+
1812
+ ```
1813
+ DELETE /api/policies/{id}/
1814
+ ```
1815
+
1816
+ **Required role:** admin. System policies (`is_system: true`) cannot be deleted (`409`,
1817
+ `"code": "protected"`). A policy with one or more assigned agent connections also cannot be deleted.
1818
+
1819
+ ```bash
1820
+ curl -X DELETE https://logstashui.example.com/api/policies/5/ \
1821
+ -H "Authorization: ApiKey $KEY"
1822
+ ```
1823
+
1824
+ ```json
1825
+ {"success": true, "message": "Policy 'my-policy' deleted."}
1826
+ ```
1827
+
1828
+ ---
1829
+
1830
+ ### Deploy a policy
1831
+
1832
+ ```
1833
+ POST /api/policies/{id}/deploy/
1834
+ ```
1835
+
1836
+ **Required role:** admin
1837
+
1838
+ Snapshots the current user-authored state (pipelines, keystore, config files) as a new
1839
+ revision. `current_revision_number` is incremented and `last_deployed_at` is set. Agents
1840
+ pick up the new revision on their next check-in.
1841
+
1842
+ > [!NOTE]
1843
+ > SNMP-managed pipelines and keystore entries are excluded from the snapshot — they are
1844
+ > deployed on a separate channel and are never part of policy revision history.
1845
+
1846
+ ```bash
1847
+ curl -X POST https://logstashui.example.com/api/policies/5/deploy/ \
1848
+ -H "Authorization: ApiKey $KEY"
1849
+ ```
1850
+
1851
+ ```json
1852
+ {
1853
+ "success": true,
1854
+ "revision_number": 4,
1855
+ "policy_name": "my-policy",
1856
+ "message": "Policy deployed as revision 4."
1857
+ }
1858
+ ```
1859
+
1860
+ ---
1861
+
1862
+ ### Clone a policy
1863
+
1864
+ ```
1865
+ POST /api/policies/{id}/clone/
1866
+ ```
1867
+
1868
+ **Required role:** admin
1869
+
1870
+ Creates a new policy that is an exact copy of the source, including all user-authored pipelines
1871
+ and keystore entries. A default enrollment token is minted for the clone.
1872
+
1873
+ Type promotion rules:
1874
+ - `PACKAGED` or `DEFAULT` source → clone becomes `MANAGED` (paths rewritten to managed scheme)
1875
+ - `MANAGED` source → clone is `MANAGED`
1876
+ - `SIMULATE` source → clone is `SIMULATE`
1877
+ - `EMBEDDED` source → `409` with `"code": "protected"` (cannot clone)
1878
+
1879
+ ```bash
1880
+ curl -X POST https://logstashui.example.com/api/policies/1/clone/ \
1881
+ -H "Authorization: ApiKey $KEY" \
1882
+ -H "Content-Type: application/json" \
1883
+ -d '{"new_name": "my-cloned-policy"}'
1884
+ ```
1885
+
1886
+ ```json
1887
+ {
1888
+ "success": true,
1889
+ "id": 6,
1890
+ "name": "my-cloned-policy",
1891
+ "policy_type": "MANAGED",
1892
+ "message": "Policy 'my-cloned-policy' cloned from 'Packaged Policy'."
1893
+ }
1894
+ ```
1895
+
1896
+ | Field | Required | Notes |
1897
+ |-------|----------|-------|
1898
+ | `new_name` | yes | Must be unique |
1899
+
1900
+ ---
1901
+
1902
+ ### Get pending changes diff
1903
+
1904
+ ```
1905
+ GET /api/policies/{id}/diff/
1906
+ ```
1907
+
1908
+ **Required role:** admin
1909
+
1910
+ Compares the current live policy state against the last deployed revision. Returns a count of
1911
+ changed sections and, depending on `detail`, the full snapshots or a list of what changed.
1912
+
1913
+ Changed sections counted: `logstash_yml`, `jvm_options`, `log4j2_properties`, pipelines,
1914
+ keystore entries, keystore password, and global paths (`settings_path`, `logs_path`,
1915
+ `binary_path`).
1916
+
1917
+ ```bash
1918
+ curl -H "Authorization: ApiKey $KEY" \
1919
+ https://logstashui.example.com/api/policies/5/diff/
1920
+ ```
1921
+
1922
+ ```json
1923
+ {
1924
+ "success": true,
1925
+ "policy_name": "my-policy",
1926
+ "current_revision": 4,
1927
+ "last_deployed_revision": 4,
1928
+ "has_undeployed_changes": false,
1929
+ "pending_changes": 0,
1930
+ "current": {
1931
+ "logstash_yml": "pipeline.workers: 4\n",
1932
+ "jvm_options": "-Xms1g\n-Xmx1g\n",
1933
+ "log4j2_properties": "# ...",
1934
+ "settings_path": "/etc/logstash/",
1935
+ "logs_path": "/var/log/logstash",
1936
+ "binary_path": "/usr/share/logstash/bin",
1937
+ "pipelines": [],
1938
+ "keystore": [],
1939
+ "keystore_password_hash": ""
1940
+ },
1941
+ "previous": { "...": "same fields, values as of last deploy" }
1942
+ }
1943
+ ```
1944
+
1945
+ `pending_changes: 0` means the live state matches the last deployed revision exactly.
1946
+
1947
+ | Query param | Description |
1948
+ |-------------|-------------|
1949
+ | `detail` | `full` (default): the `current` and `previous` snapshots shown above. `summary`: a `changes` object naming what changed, without snapshots. `changes`: `summary` plus unified `diffs`. Any other value returns `400`. |
1950
+
1951
+ `pending_changes` is the same in every mode. With `detail=summary`, `changes` lists the changed
1952
+ config files and paths, the pipelines added, removed, or changed (with the fields that changed),
1953
+ and the keystore key names added, removed, or given a new value. Keystore values never appear.
1954
+ A pipeline field missing from an older snapshot is not compared.
1955
+
1956
+ ```bash
1957
+ curl -H "Authorization: ApiKey $KEY" \
1958
+ "https://logstashui.example.com/api/policies/5/diff/?detail=changes"
1959
+ ```
1960
+
1961
+ ```json
1962
+ {
1963
+ "success": true,
1964
+ "policy_name": "my-policy",
1965
+ "current_revision": 5,
1966
+ "last_deployed_revision": 4,
1967
+ "has_undeployed_changes": true,
1968
+ "pending_changes": 3,
1969
+ "changes": {
1970
+ "config_files": ["logstash_yml"],
1971
+ "paths": [],
1972
+ "pipelines": {
1973
+ "added": ["syslog"],
1974
+ "removed": [],
1975
+ "changed": [{"name": "asa", "fields": ["lscl", "pipeline_workers"]}]
1976
+ },
1977
+ "keystore": {"added": [], "removed": [], "changed": ["ES_PW"]},
1978
+ "keystore_password_changed": false,
1979
+ "diffs": {
1980
+ "config_files": {"logstash_yml": "--- a/logstash_yml\n+++ b/logstash_yml\n@@ ..."},
1981
+ "pipelines": {"asa": "--- a/asa\n+++ b/asa\n@@ ...", "syslog": "--- a/syslog\n+++ b/syslog\n@@ ..."}
1982
+ }
1983
+ }
1984
+ }
1985
+ ```
1986
+
1987
+ `diffs.pipelines` covers added pipelines and pipelines whose `lscl` changed; a pipeline that
1988
+ only changed settings appears in `changes.pipelines.changed` without a diff.
1989
+
1990
+ ---
1991
+
1992
+ ### List enrollment tokens
1993
+
1994
+ ```
1995
+ GET /api/policies/{id}/tokens/
1996
+ ```
1997
+
1998
+ **Required role:** admin
1999
+
2000
+ Returns all enrollment tokens for a policy, including the base64-encoded token payload and
2001
+ the ready-to-run install command for each.
2002
+
2003
+ ```bash
2004
+ curl -H "Authorization: ApiKey $KEY" \
2005
+ https://logstashui.example.com/api/policies/5/tokens/
2006
+ ```
2007
+
2008
+ ```json
2009
+ {
2010
+ "success": true,
2011
+ "tokens": [
2012
+ {
2013
+ "id": 1,
2014
+ "name": "default",
2015
+ "raw_token": "7CrbDG2Iok-...",
2016
+ "encoded_token": "eyJlbnJvbGxtZW50X3Rva2VuIjoi...",
2017
+ "enroll_command": "sudo logstash-agent install --enroll=eyJ... --logstash-ui-url=https://logstashui.example.com",
2018
+ "agent_ui_url": "https://logstashui.example.com"
2019
+ }
2020
+ ]
2021
+ }
2022
+ ```
2023
+
2024
+ ---
2025
+
2026
+ ### Create an enrollment token
2027
+
2028
+ ```
2029
+ POST /api/policies/{id}/tokens/
2030
+ ```
2031
+
2032
+ **Required role:** admin
2033
+
2034
+ ```bash
2035
+ curl -X POST https://logstashui.example.com/api/policies/5/tokens/ \
2036
+ -H "Authorization: ApiKey $KEY" \
2037
+ -H "Content-Type: application/json" \
2038
+ -d '{"name": "production"}'
2039
+ ```
2040
+
2041
+ ```json
2042
+ {
2043
+ "success": true,
2044
+ "id": 2,
2045
+ "name": "production",
2046
+ "raw_token": "...",
2047
+ "encoded_token": "...",
2048
+ "enroll_command": "sudo logstash-agent install --enroll=... --logstash-ui-url=...",
2049
+ "agent_ui_url": "https://logstashui.example.com",
2050
+ "message": "Enrollment token created."
2051
+ }
2052
+ ```
2053
+
2054
+ | Field | Required | Notes |
2055
+ |-------|----------|-------|
2056
+ | `name` | no | Label for the token; defaults to `"default"` |
2057
+
2058
+ ---
2059
+
2060
+ ### Delete an enrollment token
2061
+
2062
+ ```
2063
+ DELETE /api/policies/{id}/tokens/{token_id}/
2064
+ ```
2065
+
2066
+ **Required role:** admin
2067
+
2068
+ ```bash
2069
+ curl -X DELETE https://logstashui.example.com/api/policies/5/tokens/2/ \
2070
+ -H "Authorization: ApiKey $KEY"
2071
+ ```
2072
+
2073
+ ```json
2074
+ {"success": true, "message": "Token deleted."}
2075
+ ```
2076
+
2077
+ ---
2078
+
2079
+ ## Pipelines
2080
+
2081
+ Manage Logstash pipelines across two storage backends:
2082
+
2083
+ - **Agent pipelines** — stored in the LogstashUI database, scoped to an agent policy, and deployed to Logstash agents on check-in. Identified by an integer `id`.
2084
+ - **Centralized pipelines** — Logstash pipelines stored through Elasticsearch's Logstash pipeline API (`/_logstash/pipeline`) and pulled by Logstash nodes running Centralized Pipeline Management (CPM). Identified by pipeline name within a `CENTRALIZED` connection. These are not Elasticsearch ingest pipelines.
2085
+
2086
+ All write operations require **admin** role. Reads require any authenticated user.
2087
+
2088
+ > [!NOTE]
2089
+ > Saving an agent pipeline sets `has_undeployed_changes = true` on its policy. The change is
2090
+ > not pushed to agents until you call `POST /api/pipelines/policies/{id}/deploy/` (or its
2091
+ > alias `POST /api/policies/{id}/deploy/`).
2092
+
2093
+ ---
2094
+
2095
+ ## Agent Pipelines
2096
+
2097
+ ### List agent pipelines
2098
+
2099
+ ```
2100
+ GET /api/pipelines/?policy_id={id}
2101
+ ```
2102
+
2103
+ Returns user-authored pipelines for the given policy. The `policy_id` parameter is required.
2104
+
2105
+ | Parameter | Notes |
2106
+ |-----------|-------|
2107
+ | `policy_id` | Required. Policy primary key |
2108
+ | `managed_by` | Filter by ownership: `user` (default), `snmp`, or `library` |
2109
+
2110
+ ```bash
2111
+ curl -H "Authorization: ApiKey $KEY" \
2112
+ "https://logstashui.example.com/api/pipelines/?policy_id=1"
2113
+ ```
2114
+
2115
+ ```json
2116
+ {
2117
+ "policy_id": 1,
2118
+ "policy_name": "Packaged Policy",
2119
+ "has_undeployed_changes": false,
2120
+ "pipelines": [
2121
+ {
2122
+ "id": 10,
2123
+ "policy_id": 1,
2124
+ "name": "apache-logs",
2125
+ "managed_by": "user",
2126
+ "description": "Parses Apache access logs",
2127
+ "pipeline_hash": "abc123",
2128
+ "last_updated": "2026-01-01T12:00:00Z",
2129
+ "revision_number": 3,
2130
+ "no_input": false,
2131
+ "non_reloadable": false
2132
+ }
2133
+ ],
2134
+ "count": 1
2135
+ }
2136
+ ```
2137
+
2138
+ ---
2139
+
2140
+ ### Get an agent pipeline
2141
+
2142
+ ```
2143
+ GET /api/pipelines/{id}/
2144
+ ```
2145
+
2146
+ Returns the full pipeline record including `lscl` and all performance settings.
2147
+
2148
+ ```bash
2149
+ curl -H "Authorization: ApiKey $KEY" \
2150
+ https://logstashui.example.com/api/pipelines/10/
2151
+ ```
2152
+
2153
+ ```json
2154
+ {
2155
+ "success": true,
2156
+ "pipeline": {
2157
+ "id": 10,
2158
+ "policy_id": 1,
2159
+ "name": "apache-logs",
2160
+ "managed_by": "user",
2161
+ "description": "Parses Apache access logs",
2162
+ "lscl": "input { beats { port => 5044 } } filter { grok { ... } } output { elasticsearch { ... } }",
2163
+ "pipeline_hash": "abc123",
2164
+ "last_updated": "2026-01-01T12:00:00Z",
2165
+ "revision_number": 3,
2166
+ "pipeline_workers": 1,
2167
+ "pipeline_batch_size": 128,
2168
+ "pipeline_batch_delay": 50,
2169
+ "queue_type": "memory",
2170
+ "queue_max_bytes": "1gb",
2171
+ "queue_checkpoint_writes": 1024,
2172
+ "no_input": false,
2173
+ "non_reloadable": false
2174
+ }
2175
+ }
2176
+ ```
2177
+
2178
+ ---
2179
+
2180
+ ### Create an agent pipeline
2181
+
2182
+ ```
2183
+ POST /api/pipelines/
2184
+ ```
2185
+
2186
+ **Required role:** admin
2187
+
2188
+ ```bash
2189
+ curl -X POST https://logstashui.example.com/api/pipelines/ \
2190
+ -H "Authorization: ApiKey $KEY" \
2191
+ -H "Content-Type: application/json" \
2192
+ -d '{
2193
+ "policy_id": 1,
2194
+ "name": "apache-logs",
2195
+ "lscl": "input { beats { port => 5044 } }\nfilter { grok { match => { \"message\" => \"%{COMBINEDAPACHELOG}\" } } }\noutput { elasticsearch { hosts => [\"localhost:9200\"] } }",
2196
+ "description": "Parses Apache access logs",
2197
+ "pipeline_workers": 2,
2198
+ "pipeline_batch_size": 256,
2199
+ "queue_type": "memory"
2200
+ }'
2201
+ ```
2202
+
2203
+ ```json
2204
+ {"success": true, "id": 10, "message": "Pipeline created successfully."}
2205
+ ```
2206
+
2207
+ | Field | Required | Notes |
2208
+ |-------|----------|-------|
2209
+ | `policy_id` | yes | Parent policy primary key |
2210
+ | `name` | yes | Must be unique within the policy |
2211
+ | `lscl` | yes | Full Logstash config text |
2212
+ | `description` | no | |
2213
+ | `pipeline_workers` | no | Default `1` |
2214
+ | `pipeline_batch_size` | no | Default `128` |
2215
+ | `pipeline_batch_delay` | no | Milliseconds, default `50` |
2216
+ | `queue_type` | no | `memory` (default) or `persisted` |
2217
+ | `queue_max_bytes` | no | Default `"1gb"` |
2218
+ | `queue_checkpoint_writes` | no | Default `1024` |
2219
+
2220
+ ---
2221
+
2222
+ ### Update (save) an agent pipeline
2223
+
2224
+ ```
2225
+ PUT /api/pipelines/{id}/
2226
+ ```
2227
+
2228
+ **Required role:** admin. `pipeline_hash` is recomputed automatically on save.
2229
+ Sets `has_undeployed_changes = true` on the parent policy.
2230
+
2231
+ ```bash
2232
+ curl -X PUT https://logstashui.example.com/api/pipelines/10/ \
2233
+ -H "Authorization: ApiKey $KEY" \
2234
+ -H "Content-Type: application/json" \
2235
+ -d '{
2236
+ "lscl": "input { beats { port => 5044 } }\nfilter { mutate { add_field => { \"env\" => \"prod\" } } }\noutput { elasticsearch { hosts => [\"localhost:9200\"] } }",
2237
+ "pipeline_workers": 4
2238
+ }'
2239
+ ```
2240
+
2241
+ ```json
2242
+ {"success": true, "id": 10, "message": "Pipeline saved successfully."}
2243
+ ```
2244
+
2245
+ ---
2246
+
2247
+ ### Delete an agent pipeline
2248
+
2249
+ ```
2250
+ DELETE /api/pipelines/{id}/
2251
+ ```
2252
+
2253
+ **Required role:** admin. Sets `has_undeployed_changes = true` on the parent policy.
2254
+
2255
+ ```bash
2256
+ curl -X DELETE https://logstashui.example.com/api/pipelines/10/ \
2257
+ -H "Authorization: ApiKey $KEY"
2258
+ ```
2259
+
2260
+ ```json
2261
+ {"success": true, "message": "Pipeline 'apache-logs' deleted."}
2262
+ ```
2263
+
2264
+ ---
2265
+
2266
+ ### Deploy a policy
2267
+
2268
+ ```
2269
+ POST /api/pipelines/policies/{policy_id}/deploy/
2270
+ ```
2271
+
2272
+ **Required role:** admin
2273
+
2274
+ Snapshots the current user-authored pipelines and keystore as a new revision.
2275
+ `current_revision_number` is incremented and `last_deployed_at` is set. Agents pick up the
2276
+ change on their next check-in. SNMP-managed pipelines are excluded from the snapshot.
2277
+
2278
+ > [!NOTE]
2279
+ > This endpoint is equivalent to `POST /api/policies/{id}/deploy/`. Both are available;
2280
+ > use whichever fits your workflow.
2281
+
2282
+ ```bash
2283
+ curl -X POST https://logstashui.example.com/api/pipelines/policies/1/deploy/ \
2284
+ -H "Authorization: ApiKey $KEY"
2285
+ ```
2286
+
2287
+ ```json
2288
+ {
2289
+ "success": true,
2290
+ "message": "Policy deployed as revision 4.",
2291
+ "revision_number": 4,
2292
+ "policy_id": 1,
2293
+ "policy_name": "Packaged Policy",
2294
+ "last_deployed_at": "2026-09-09T23:00:00Z"
2295
+ }
2296
+ ```
2297
+
2298
+ ---
2299
+
2300
+ ## Centralized Pipelines
2301
+
2302
+ Manage Logstash pipelines delivered through Centralized Pipeline Management (CPM). LogstashUI
2303
+ stores them with Elasticsearch's Logstash pipeline API (`/_logstash/pipeline`), and Logstash
2304
+ nodes configured for CPM on that connection pull them. They do not go through the agent
2305
+ check-in flow and have no deploy step. These are Logstash pipelines (LSCL), not Elasticsearch
2306
+ ingest pipelines.
2307
+
2308
+ > [!NOTE]
2309
+ > `/api/pipelines/es/...` is a deprecated alias for `/api/pipelines/centralized/...` and will
2310
+ > be removed in a future release.
2311
+
2312
+ ### List centralized pipelines
2313
+
2314
+ ```
2315
+ GET /api/pipelines/centralized/{connection_id}/
2316
+ ```
2317
+
2318
+ Returns all CPM pipelines for the given connection. Add `?include_lscl=false` to leave out
2319
+ each pipeline's `lscl`, which keeps the response small on connections with many pipelines.
2320
+
2321
+ ```bash
2322
+ curl -H "Authorization: ApiKey $KEY" \
2323
+ https://logstashui.example.com/api/pipelines/centralized/17/
2324
+ ```
2325
+
2326
+ ```json
2327
+ {
2328
+ "connection_id": 17,
2329
+ "pipelines": [
2330
+ {
2331
+ "name": "apache-logs",
2332
+ "description": "Parses Apache access logs",
2333
+ "lscl": "input { beats { ... } } filter { ... } output { ... }",
2334
+ "last_modified": "2026-01-01T12:00:00.000Z",
2335
+ "username": "admin",
2336
+ "pipeline_settings": {
2337
+ "pipeline.workers": 2,
2338
+ "pipeline.batch.size": 128,
2339
+ "pipeline.batch.delay": 50,
2340
+ "queue.type": "memory",
2341
+ "queue.max_bytes": "1gb",
2342
+ "queue.checkpoint.writes": 1024
2343
+ }
2344
+ }
2345
+ ],
2346
+ "count": 1
2347
+ }
2348
+ ```
2349
+
2350
+ ---
2351
+
2352
+ ### Get a centralized pipeline
2353
+
2354
+ ```
2355
+ GET /api/pipelines/centralized/{connection_id}/{name}/
2356
+ ```
2357
+
2358
+ ```bash
2359
+ curl -H "Authorization: ApiKey $KEY" \
2360
+ https://logstashui.example.com/api/pipelines/centralized/17/apache-logs/
2361
+ ```
2362
+
2363
+ ```json
2364
+ {
2365
+ "success": true,
2366
+ "pipeline": {
2367
+ "name": "apache-logs",
2368
+ "connection_id": 17,
2369
+ "description": "Parses Apache access logs",
2370
+ "lscl": "input { beats { ... } } filter { ... } output { ... }",
2371
+ "last_modified": "2026-01-01T12:00:00.000Z",
2372
+ "username": "admin",
2373
+ "pipeline_settings": { "pipeline.workers": 2 }
2374
+ }
2375
+ }
2376
+ ```
2377
+
2378
+ `404` if the pipeline does not exist.
2379
+
2380
+ ---
2381
+
2382
+ ### Create a centralized pipeline
2383
+
2384
+ ```
2385
+ POST /api/pipelines/centralized/{connection_id}/
2386
+ ```
2387
+
2388
+ **Required role:** admin. Creates or replaces the CPM pipeline. Logstash nodes pick it up
2389
+ without a deploy step.
2390
+
2391
+ ```bash
2392
+ curl -X POST https://logstashui.example.com/api/pipelines/centralized/17/ \
2393
+ -H "Authorization: ApiKey $KEY" \
2394
+ -H "Content-Type: application/json" \
2395
+ -d '{
2396
+ "name": "apache-logs",
2397
+ "lscl": "input { beats { port => 5044 } }\nfilter { grok { match => { \"message\" => \"%{COMBINEDAPACHELOG}\" } } }\noutput { elasticsearch { hosts => [\"localhost:9200\"] } }",
2398
+ "description": "Parses Apache access logs",
2399
+ "pipeline_workers": 2,
2400
+ "pipeline_batch_size": 128,
2401
+ "queue_type": "memory"
2402
+ }'
2403
+ ```
2404
+
2405
+ ```json
2406
+ {"success": true, "name": "apache-logs", "message": "Pipeline created."}
2407
+ ```
2408
+
2409
+ | Field | Required | Notes |
2410
+ |-------|----------|-------|
2411
+ | `name` | yes | Logstash pipeline ID |
2412
+ | `lscl` | yes | Full Logstash config text |
2413
+ | `description` | no | |
2414
+ | `pipeline_workers` | no | Default `1` |
2415
+ | `pipeline_batch_size` | no | Default `128` |
2416
+ | `pipeline_batch_delay` | no | Default `50` ms |
2417
+ | `queue_type` | no | `memory` (default) or `persisted` |
2418
+ | `queue_max_bytes` | no | Default `"1gb"` |
2419
+ | `queue_checkpoint_writes` | no | Default `1024` |
2420
+
2421
+ ---
2422
+
2423
+ ### Update a centralized pipeline
2424
+
2425
+ ```
2426
+ PUT /api/pipelines/centralized/{connection_id}/{name}/
2427
+ ```
2428
+
2429
+ **Required role:** admin. Fetches the existing pipeline first and merges — unspecified
2430
+ settings retain their current values. Logstash nodes pick up the change without a deploy step.
2431
+
2432
+ ```bash
2433
+ curl -X PUT https://logstashui.example.com/api/pipelines/centralized/17/apache-logs/ \
2434
+ -H "Authorization: ApiKey $KEY" \
2435
+ -H "Content-Type: application/json" \
2436
+ -d '{
2437
+ "lscl": "input { beats { port => 5044 } }\nfilter { mutate { add_field => { \"env\" => \"prod\" } } }\noutput { elasticsearch { ... } }",
2438
+ "pipeline_workers": 4
2439
+ }'
2440
+ ```
2441
+
2442
+ ```json
2443
+ {"success": true, "name": "apache-logs", "message": "Pipeline updated."}
2444
+ ```
2445
+
2446
+ `404` if the pipeline does not exist.
2447
+
2448
+ ---
2449
+
2450
+ ### Delete a centralized pipeline
2451
+
2452
+ ```
2453
+ DELETE /api/pipelines/centralized/{connection_id}/{name}/
2454
+ ```
2455
+
2456
+ **Required role:** admin. Removes the CPM pipeline; Logstash nodes stop running it.
2457
+
2458
+ ```bash
2459
+ curl -X DELETE https://logstashui.example.com/api/pipelines/centralized/17/apache-logs/ \
2460
+ -H "Authorization: ApiKey $KEY"
2461
+ ```
2462
+
2463
+ ```json
2464
+ {"success": true, "message": "Pipeline 'apache-logs' deleted."}
2465
+ ```
2466
+
2467
+ ---
2468
+
2469
+ ## Find a pipeline by name
2470
+
2471
+ Search agent pipelines in every policy (embedded policies excluded) and CPM pipelines on every
2472
+ `CENTRALIZED` connection. `name` can be part of a name or a topic such as `asa`; pipelines whose
2473
+ names contain it come back under `similar`.
2474
+
2475
+ ```
2476
+ GET /api/pipelines/find/?name={name}
2477
+ ```
2478
+
2479
+ **Required role:** any authenticated user
2480
+
2481
+ ```bash
2482
+ curl -H "Authorization: ApiKey $KEY" \
2483
+ "https://logstashui.example.com/api/pipelines/find/?name=asa-new"
2484
+ ```
2485
+
2486
+ ```json
2487
+ {
2488
+ "success": true,
2489
+ "name": "asa-new",
2490
+ "matches": [
2491
+ {"type": "cpm", "name": "asa-new", "connection_id": 2, "connection_name": "Homelab",
2492
+ "last_modified": "2026-10-12T15:03:11.204Z"}
2493
+ ],
2494
+ "similar": [
2495
+ {"type": "cpm", "name": "asa-new-fixed", "connection_id": 2, "connection_name": "Homelab",
2496
+ "last_modified": "2026-10-14T09:41:52.118Z"},
2497
+ {"type": "agent", "name": "asa", "pipeline_id": 14, "policy_id": 1, "policy_name": "Default",
2498
+ "managed_by": "user", "last_modified": "2026-09-30T18:22:05.441000+00:00"}
2499
+ ],
2500
+ "unreachable": []
2501
+ }
2502
+ ```
2503
+
2504
+ | Field | Description |
2505
+ |-------|-------------|
2506
+ | `matches` | Pipelines named exactly `name` |
2507
+ | `similar` | Up to 10 other pipelines with close or overlapping names, closest first |
2508
+ | `unreachable` | `CENTRALIZED` connections whose pipelines couldn't be listed, with `connection_id`, `connection_name`, and `error`. A pipeline may exist there |
2509
+
2510
+ Each pipeline's ID fields are what the other pipeline endpoints take: `connection_id` + `name`
2511
+ for a CPM pipeline, `pipeline_id` for an agent pipeline. Connections are queried in parallel
2512
+ with a 10-second timeout each.
2513
+
2514
+ `400` — `name` is missing.
2515
+
2516
+ ---
2517
+
2518
+ ## Recently modified pipelines
2519
+
2520
+ List agent pipelines in every policy (embedded policies excluded) and CPM pipelines on every
2521
+ `CENTRALIZED` connection, most recently modified first. This reads the `last_modified` each
2522
+ pipeline already has; it doesn't record who changed what.
2523
+
2524
+ ```
2525
+ GET /api/pipelines/recent/?limit={n}&since={timestamp}
2526
+ ```
2527
+
2528
+ **Required role:** any authenticated user
2529
+
2530
+ | Query parameter | Default | Description |
2531
+ |---|---|---|
2532
+ | `limit` | `20` | Maximum pipelines to return, up to 200 |
2533
+ | `since` | none | ISO 8601 date or timestamp; only pipelines modified at or after it |
2534
+
2535
+ ```bash
2536
+ curl -H "Authorization: ApiKey $KEY" \
2537
+ "https://logstashui.example.com/api/pipelines/recent/?since=2026-11-01"
2538
+ ```
2539
+
2540
+ ```json
2541
+ {
2542
+ "success": true,
2543
+ "pipelines": [
2544
+ {"type": "cpm", "name": "asa-new-fixed", "connection_id": 2, "connection_name": "Homelab",
2545
+ "last_modified": "2026-11-03T09:41:52.118Z"},
2546
+ {"type": "agent", "name": "asa", "pipeline_id": 14, "policy_id": 1, "policy_name": "Default",
2547
+ "managed_by": "user", "last_modified": "2026-11-02T18:22:05.441000+00:00"}
2548
+ ],
2549
+ "total": 2,
2550
+ "unreachable": []
2551
+ }
2552
+ ```
2553
+
2554
+ `total` counts every pipeline that matched `since`, before `limit`. Entries use the same form as
2555
+ [Find a pipeline by name](#find-a-pipeline-by-name).
2556
+
2557
+ `400` — `limit` isn't an integer or `since` isn't a valid timestamp.
2558
+
2559
+ ---
2560
+
2561
+ ## Simulate
2562
+
2563
+ Run a pipeline simulation synchronously. The simulation is executed by a running Logstash
2564
+ simulate agent with per-filter Ruby instrumentation — each filter step captures a snapshot
2565
+ of the event at that point in the pipeline.
2566
+
2567
+ ```
2568
+ POST /api/pipelines/simulate/
2569
+ ```
2570
+
2571
+ **Required role:** admin
2572
+
2573
+ The request blocks until results are returned or the timeout is reached. The agent must be
2574
+ reachable and the pipeline filters must be valid Logstash config.
2575
+
2576
+ ```bash
2577
+ curl -X POST https://logstashui.example.com/api/pipelines/simulate/ \
2578
+ -H "Authorization: ApiKey $KEY" \
2579
+ -H "Content-Type: application/json" \
2580
+ -d '{
2581
+ "lscl": "input { beats { port => 5044 } }\nfilter { grok { match => { \"message\" => \"%{COMBINEDAPACHELOG}\" } } mutate { add_field => { \"env\" => \"prod\" } } }\noutput { elasticsearch { ... } }",
2582
+ "event": "192.168.1.1 - frank [10/Oct/2000:13:55:36 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 2326",
2583
+ "timeout": 30
2584
+ }'
2585
+ ```
2586
+
2587
+ **Using a saved pipeline by ID instead of raw LSCL:**
2588
+
2589
+ ```bash
2590
+ curl -X POST https://logstashui.example.com/api/pipelines/simulate/ \
2591
+ -H "Authorization: ApiKey $KEY" \
2592
+ -H "Content-Type: application/json" \
2593
+ -d '{
2594
+ "pipeline_id": 10,
2595
+ "event": "192.168.1.1 - frank [10/Oct/2000:13:55:36 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 2326",
2596
+ "policy_id": 1,
2597
+ "timeout": 60
2598
+ }'
2599
+ ```
2600
+
2601
+ ```json
2602
+ {
2603
+ "success": true,
2604
+ "run_id": "f3a1b2c4-...",
2605
+ "slot_id": 3,
2606
+ "count": 1,
2607
+ "elapsed_ms": 1240,
2608
+ "results": [
2609
+ {
2610
+ "run_id": "f3a1b2c4-...",
2611
+ "message": "192.168.1.1 - frank ...",
2612
+ "snapshots": {
2613
+ "grok_step1": {
2614
+ "clientip": "192.168.1.1",
2615
+ "ident": "frank",
2616
+ "verb": "GET",
2617
+ "request": "/apache_pb.gif",
2618
+ "response": "200"
2619
+ },
2620
+ "mutate_step2": {
2621
+ "clientip": "192.168.1.1",
2622
+ "env": "prod"
2623
+ }
2624
+ }
2625
+ }
2626
+ ]
2627
+ }
2628
+ ```
2629
+
2630
+ | Field | Required | Notes |
2631
+ |-------|----------|-------|
2632
+ | `lscl` | one of | Raw Logstash config |
2633
+ | `pipeline_id` | one of | Load LSCL from a saved agent pipeline |
2634
+ | `connection_id` + `name` | one of | Load LSCL from a CPM pipeline on a CENTRALIZED connection. Send both |
2635
+ | `event` | one of | Sample log line or JSON string to process. Mutually exclusive with `events` |
2636
+ | `events` | one of | Bulk mode: list of up to 100 log lines or JSON events. Mutually exclusive with `event` |
2637
+ | `sim_connection_id` | no | Specific simulate-agent connection ID. Defaults to the session-sticky agent |
2638
+ | `policy_id` | no | Source policy for keystore sync when the pipeline uses `${var}` references |
2639
+ | `timeout` | no | Seconds to wait for all results once the simulation slot is ready (getting a slot on a cold agent can take longer). Default `30`, maximum `180` |
2640
+ | `detail` | no | `full` (default), `steps`, or `final`. See **Detail levels** below |
2641
+
2642
+ Send exactly one config source: `lscl`, `pipeline_id`, or `connection_id` + `name`. Only the
2643
+ filter section is simulated; input and output blocks are ignored.
2644
+
2645
+ **Detail levels:**
2646
+
2647
+ `detail` sets how much comes back for each event. `full` returns the raw `results` shown
2648
+ above, where every snapshot repeats the whole event. The other two levels replace `results`
2649
+ and `count` with smaller fields and strip the fields the simulation harness adds (`run_id`,
2650
+ `slot`, `simulation`, `snapshots`, and the harness's `event.original`):
2651
+
2652
+ | `detail` | Fields per event |
2653
+ |----------|------------------|
2654
+ | `final` | `final` (the event after the last filter, or `null` if it didn't finish), `dropped`, and `dropped_by` when a `drop` filter ended it. When no filter ran (for example, every filter is inside a conditional the event didn't match), the run still completes and `steps` is empty |
2655
+ | `steps` | The `final` fields plus `filter_ms` and `steps`, one entry per filter run, in order |
2656
+
2657
+ Each `steps` entry has `step`, `plugin`, `component` (the parser's ID), `id` (the `id` set in
2658
+ your config, if any), and `ms`. It lists only what that filter did: `added` and `changed`
2659
+ (field reference to new value), and `removed` (field references). Top-level fields keep their
2660
+ name (`message`, or a literal dotted `event.code`), and nested fields use bracket form
2661
+ (`[log][syslog][priority]`). Values longer than 200 characters are cut. `branches` appears
2662
+ when the conditional path changes.
2663
+
2664
+ ```json
2665
+ {
2666
+ "success": true,
2667
+ "run_id": "f3a1b2c4-...",
2668
+ "slot_id": 3,
2669
+ "complete": true,
2670
+ "elapsed_ms": 1240,
2671
+ "detail": "steps",
2672
+ "final": {"message": "192.168.1.1 - frank ...", "clientip": "192.168.1.1", "env": "prod"},
2673
+ "dropped": false,
2674
+ "filter_ms": 1.9,
2675
+ "steps": [
2676
+ {"step": 1, "plugin": "grok", "component": "filter_grok_0", "ms": 1.4,
2677
+ "added": {"clientip": "192.168.1.1", "verb": "GET"}},
2678
+ {"step": 2, "plugin": "mutate", "component": "filter_mutate_1", "ms": 0.5,
2679
+ "added": {"env": "prod"}}
2680
+ ]
2681
+ }
2682
+ ```
2683
+
2684
+ MCP clients get `steps` by default.
2685
+
2686
+ **Simulating a CPM pipeline by name:**
2687
+
2688
+ ```bash
2689
+ curl -X POST https://logstashui.example.com/api/pipelines/simulate/ \
2690
+ -H "Authorization: ApiKey $KEY" \
2691
+ -H "Content-Type: application/json" \
2692
+ -d '{"connection_id": 17, "name": "asa-new", "event": "<164>%ASA-4-106023: Deny tcp ..."}'
2693
+ ```
2694
+
2695
+ **Bulk simulation:**
2696
+
2697
+ Send `events` instead of `event` to run several events in one request. The first event
2698
+ allocates a simulation slot and the rest reuse it, like multi-document simulation in the
2699
+ editor. Items can be log lines (strings) or JSON objects. `timeout` covers the whole batch.
2700
+
2701
+ ```bash
2702
+ curl -X POST https://logstashui.example.com/api/pipelines/simulate/ \
2703
+ -H "Authorization: ApiKey $KEY" \
2704
+ -H "Content-Type: application/json" \
2705
+ -d '{
2706
+ "pipeline_id": 10,
2707
+ "events": [
2708
+ "192.168.1.1 - frank [10/Oct/2000:13:55:36 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 2326",
2709
+ {"message": "10.0.0.5 - - [10/Oct/2000:13:55:40 -0700] \"GET / HTTP/1.1\" 404 0"}
2710
+ ],
2711
+ "timeout": 60
2712
+ }'
2713
+ ```
2714
+
2715
+ ```json
2716
+ {
2717
+ "success": true,
2718
+ "slot_id": 3,
2719
+ "count": 2,
2720
+ "complete_count": 2,
2721
+ "elapsed_ms": 2310,
2722
+ "events": [
2723
+ {"index": 0, "run_id": "f3a1b2c4-...", "complete": true, "results": [{"...": "..."}]},
2724
+ {"index": 1, "run_id": "9c0d7e21-...", "complete": true, "results": [{"...": "..."}]}
2725
+ ]
2726
+ }
2727
+ ```
2728
+
2729
+ `events` is in input order. Each entry carries the same detail fields as a single-event
2730
+ response (`results` for `full`). An entry that didn't finish has `complete: false` and an
2731
+ `error`. The response is
2732
+ `200` if at least one event completed, and `408` if none did.
2733
+
2734
+ **Error responses:**
2735
+
2736
+ `400` — missing required fields, an unknown `detail`, more than one config source, `connection_id` without `name`
2737
+ (or the reverse), both `event` and `events` sent, `events` empty, longer than 100, or
2738
+ containing an item that is not a non-empty string or object, or pipeline has no filter
2739
+ plugins.
2740
+
2741
+ `404` — `pipeline_id`, the connection, or the CPM pipeline `name` not found.
2742
+
2743
+ `408` — no results within `timeout`. The simulate agent may still be loading the pipeline;
2744
+ retry once. Repeated timeouts mean the simulate agent is not returning results.
2745
+
2746
+ `502` — the simulate agent rejected the pipeline or is unreachable, or sending the event to it
2747
+ failed and no results arrived (`error` has the reason).
2748
+
2749
+ ---
2750
+
2751
+ ## Agent guides
2752
+
2753
+ Short Markdown how-tos for AI agents working with LogstashUI. They are the same files as
2754
+ [`agent_guides/`](/docs/docs/logstashui/agent_guides/concepts.md) in these docs, and are also
2755
+ served by the `guides_*` MCP tools.
2756
+
2757
+ **Required role:** any authenticated user
2758
+
2759
+ ### List guides
2760
+
2761
+ ```
2762
+ GET /api/guides/
2763
+ ```
2764
+
2765
+ ```json
2766
+ {
2767
+ "success": true,
2768
+ "count": 6,
2769
+ "guides": [
2770
+ {"topic": "concepts", "description": "Vocabulary and objects: ..."}
2771
+ ]
2772
+ }
2773
+ ```
2774
+
2775
+ ### Get a guide
2776
+
2777
+ ```
2778
+ GET /api/guides/{topic}/
2779
+ ```
2780
+
2781
+ Returns `topic`, `description`, and `content` (Markdown). An unknown topic returns `404` with
2782
+ the list of valid topics; a known topic whose file is missing from the install also returns
2783
+ `404`.