{"id":32132216,"url":"https://github.com/voxpupuli/puppet-graylog_api","last_synced_at":"2025-12-11T21:31:41.792Z","repository":{"id":34840420,"uuid":"184337214","full_name":"voxpupuli/puppet-graylog_api","owner":"voxpupuli","description":"Puppet module for managing Graylog configuration via REST API","archived":false,"fork":false,"pushed_at":"2025-10-18T17:27:51.000Z","size":252,"stargazers_count":7,"open_issues_count":7,"forks_count":4,"subscribers_count":39,"default_branch":"main","last_synced_at":"2025-10-21T02:50:08.785Z","etag":null,"topics":["graylog","graylog2","logging","puppet","puppet-module"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voxpupuli.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"open_collective":"vox-pupuli","github":"voxpupuli"}},"created_at":"2019-04-30T21:59:50.000Z","updated_at":"2025-10-18T17:27:54.000Z","dependencies_parsed_at":"2023-12-19T08:06:30.685Z","dependency_job_id":"d15109bd-1b44-4925-a089-19adc7e49528","html_url":"https://github.com/voxpupuli/puppet-graylog_api","commit_stats":{"total_commits":125,"total_committers":7,"mean_commits":"17.857142857142858","dds":0.272,"last_synced_commit":"661fb48232015a5003b880bfd1a75b0b53fea390"},"previous_names":["voxpupuli/puppet-graylog_api","magicmemories/puppet-graylog_api"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/voxpupuli/puppet-graylog_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-graylog_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-graylog_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-graylog_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-graylog_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voxpupuli","download_url":"https://codeload.github.com/voxpupuli/puppet-graylog_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-graylog_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27670460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-11T02:00:11.302Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graylog","graylog2","logging","puppet","puppet-module"],"created_at":"2025-10-21T02:34:13.158Z","updated_at":"2025-12-11T21:31:41.786Z","avatar_url":"https://github.com/voxpupuli.png","language":"Ruby","funding_links":["https://opencollective.com/vox-pupuli","https://github.com/sponsors/voxpupuli"],"categories":[],"sub_categories":[],"readme":"# graylog_api\n\n#### Table of Contents\n\n1. [Description](#description)\n2. [Setup - The basics of getting started with graylog_api](#setup)\n    * [What graylog_api affects](#what-graylog_api-affects)\n    * [Setup requirements](#setup-requirements)\n    * [Beginning with graylog_api](#beginning-with-graylog_api)\n3. [Usage - Configuration options and additional functionality](#usage)\n4. [Limitations - OS compatibility, etc.](#limitations)\n5. [Development - Guide for contributing to the module](#development)\n\n## Description\n\nThis module allows you to use Graylog's REST API to adjust its configuration.\nIt picks up where the official graylog module leaves off.\n\n## Setup\n\n### What graylog_api affects\n\nThis module manages configuration aspects of Graylog that can only be adjusted\nvia the REST API. This includes:\n\n* LDAP Authentication\n* SSO Authentication\n* Static users\n* User roles\n* Inputs\n* Streams\n* Pipelines and Pipeline rules\n* Extractors\n* Lookup Tables, Data Adapters and Caches\n* Grok Patterns\n* Dashboards\n* Index Sets\n\nMore components of Graylog configuration are in scope for this module, but they\nhave not been implemented yet.\n\n### Setup Requirements\n\nThe Ruby installation used by the Puppet agent on the Graylog server will need\nto have the `httparty` and `retries` gems installed. The easiest way to manage\nthis is to use a `package` resource with the `puppet_gem` provider:\n\n```puppet\npackage { ['httparty','retries']:\n  ensure   =\u003e present,\n  provider =\u003e 'puppet_gem',\n}\n```\n\nThe server will also need to have Graylog installed, of course. For this we\nrecommend the official graylog-graylog module.\n\n### Beginning with graylog_api\n\nIn order to use any of the resources contained in this module, you first need\nto supply the credentials the module should use to access the REST API. In\ngeneral, this should be the root credentials. Provide these through the\n`graylog_api` resource.\n\n```puppet\ngraylog_api { 'api':\n  username =\u003e 'admin',\n  password =\u003e $password,\n  port     =\u003e 9000,\n  tls      =\u003e false,\n  server   =\u003e 'localhost'\n}\n```\n\nThe resource title here _must_ be `'api'`.\n\n#### Supplying the password\nThis module requires the graylog root password in cleartext in order to be able\nto authenticate to the API. The official graylog module, on the other hand,\nonly needs the password hash. Rather than storing both the password and the\nhash, we recommend storing the password in Hiera using EYAML, and computing the\nhash using Puppet's built-in `sha256` function.\n\n## Usage\n\n### Configure the default index set\n\n```puppet\ngraylog_index_set { 'graylog':\n  description                =\u003e 'The Graylog default index set',\n  display_name               =\u003e 'Default index set',\n  shards                     =\u003e 1,\n  replicas                   =\u003e 0,\n  rotation_strategy          =\u003e 'size',\n  rotation_strategy_details  =\u003e {\n    max_size =\u003e '10 GB'.to_bytes,\n  },\n  retention_strategy         =\u003e 'delete',\n  retention_strategy_details =\u003e {\n    max_number_of_indices =\u003e 10,\n  },\n}\n```\n\n### Configure inputs\n\n```puppet\n# Default properties are often acceptable\ngraylog_api::input::gelf_tcp { 'A GELF TCP Input': }\n\n# But you can customize if you want\ngraylog_api::input::gelf_tcp { 'A GELF TCP Input with TLS':\n  port          =\u003e 12202,\n  tls_cert_file =\u003e '/etc/graylog/server/tls/cert.pem',\n  tls_enable    =\u003e true,\n  tls_key_file  =\u003e '/etc/graylog/server/tls/key.pem',\n}\n```\n\n### Load Grok Patterns\n\n```puppet\n# Load a single pattern\ngraylog_grok_pattern { 'SOMEFORMAT':\n  pattern =\u003e '%{WORD:username} %{IP:ipaddress} %{GREEDYDATA:message}',\n}\n\n# Or load a bunch of patterns from a pattern file\ngraylog_api::grok::pattern_file { 'common patterns':\n  content =\u003e file('profile/graylog/patterns/common),\n}\n```\n\n### Set up processing pipelines\n\n```puppet\n# First set up some rules\ngraylog_api::pipeline::rule { 'copy message to full_message':\n  description =\u003e 'Copy the message field to the full_message field before performing extraction',\n  condition   =\u003e 'has_field(\"message\") \u0026\u0026 has_field(\"log_format\") \u0026\u0026 !has_field(\"full_message\")',\n  action      =\u003e 'set_field(\"full_message\",$message.message);',\n}\n\ngraylog_api::pipeline::rule { 'parse log format':\n  description =\u003e 'Parse log via GROK if log_format field is provided',\n  condition   =\u003e 'has_field(\"log_format\")',\n  action      =\u003e @(END_OF_ACTION),\n                 let format_name = uppercase(to_string($message.log_format));\n                 let pattern = concat(concat(\"%{\",format_name),\"}\");\n                 let map = grok(pattern: pattern, value: to_string($message.message), only_named_captures: true);\n                 remove_field(\"log_format\");\n                 set_fields(map);\n                 |-END_OF_ACTION\n}\n\n# Then put those rules in a pipeline\ngraylog_api::pipeline { 'custom log formats':\n  description       =\u003e \"Parse custom log formats\",\n  stages            =\u003e [\n    'copy message to full_message',\n    'parse log format'\n  ],\n  connected_streams =\u003e ['All messages'],\n}\n```\n\n## Limitations\n\nThere are a lot of different settings in Graylog that this module cannot yet\nmanage. Essentially it only manages those settings that we've needed so far\nourselves.\n\nThis module aims for compatibility with Graylog 3.x, and specifically has been\ntested with Graylog 3.1.x. It probably works on later versions of Graylog 3.x\nbut may not work with 4.x or 2.x.\n\nIf you discover any issues, please report them at\nhttps://github.com/magicmemories/puppet-graylog_api/issues\n\n## License and Authorship\n\nThis module was authored by Adam Gardner, and is Copyright (c) 2019 Magic Memories (USA) LLC.\n\nIt is distributed under the terms of the Apache-2.0 license; see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoxpupuli%2Fpuppet-graylog_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoxpupuli%2Fpuppet-graylog_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoxpupuli%2Fpuppet-graylog_api/lists"}