{"id":18811730,"url":"https://github.com/logicmonitor/lm-logs-fluentd","last_synced_at":"2025-04-13T20:31:38.838Z","repository":{"id":40299165,"uuid":"282915679","full_name":"logicmonitor/lm-logs-fluentd","owner":"logicmonitor","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-18T08:59:10.000Z","size":313,"stargazers_count":2,"open_issues_count":0,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-09-18T11:47:37.820Z","etag":null,"topics":[],"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/logicmonitor.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2020-07-27T14:04:41.000Z","updated_at":"2021-11-04T08:30:14.000Z","dependencies_parsed_at":"2024-09-18T11:40:43.020Z","dependency_job_id":"8749f889-6777-4e6f-8322-592b42c13b77","html_url":"https://github.com/logicmonitor/lm-logs-fluentd","commit_stats":{"total_commits":126,"total_committers":12,"mean_commits":10.5,"dds":"0.40476190476190477","last_synced_commit":"6582c870389160a986684514ef9e176c7a12a88e"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicmonitor%2Flm-logs-fluentd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicmonitor%2Flm-logs-fluentd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicmonitor%2Flm-logs-fluentd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicmonitor%2Flm-logs-fluentd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logicmonitor","download_url":"https://codeload.github.com/logicmonitor/lm-logs-fluentd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223604534,"owners_count":17172315,"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","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":[],"created_at":"2024-11-07T23:27:27.828Z","updated_at":"2024-11-07T23:27:28.408Z","avatar_url":"https://github.com/logicmonitor.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Gem Version](https://badge.fury.io/rb/fluent-plugin-lm-logs.svg)](http://badge.fury.io/rb/fluent-plugin-lm-logs)\n# lm-logs-fluentd\nThis output plugin sends Fluentd records to the configured LogicMonitor account.\n\n## Prerequisites\n\nInstall the plugin:\n* With gem (if td-agent/fluentd is installed along with native ruby):       `gem install fluent-plugin-lm-logs`\n* For native td-agent/fluentd plugin handling:       `td-agent-gem install fluent-plugin-lm-logs`\n\nAlternatively, you can add `out_lm.rb` to your Fluentd plugins directory.\n\n## Configure the output plugin\n\nCreate a custom `fluent.conf` or edit the existing one to specify which logs should be forwarded to LogicMonitor.\n\n```\n# Match events tagged with \"lm.**\" and\n# send them to LogicMonitor\n\u003cmatch lm.**\u003e\n    @type lm\n    resource_mapping {\"\u003cevent_key\u003e\": \"\u003clm_property\u003e\"}\n    company_name \u003clm_company_name\u003e\n    company_domain \u003clm_company_domain\u003e\n\taccess_id \u003clm_access_id\u003e\n    access_key \u003clm_access_key\u003e\n      \u003cbuffer\u003e\n        @type memory\n        flush_interval 1s\n        chunk_limit_size 5m\n      \u003c/buffer\u003e \n    debug false\n\u003c/match\u003e\n```\n\n### Request example\n\nSending:\n\n`curl -X POST -d 'json={\"message\":\"hello LogicMonitor from fluentd\", \"event_key\":\"lm_property_value\"}' http://localhost:8888/lm.test`\n\nProduces this event:\n```\n{\n    \"message\": \"hello LogicMonitor from fluentd\"\n}\n```\n\n**Note:** Make sure that logs have a message field. Requests sent without a message will not be accepted. \n\n### Kubernetes\nThe Kubernetes configuration for LM Logs is deployed as a Helm chart.\nSee the [LogicMonitor Helm repository](https://github.com/logicmonitor/k8s-helm-charts/tree/master/lm-logs).\n\n### Resource mapping examples\n\n- `{\"message\":\"Hey!!\", \"event_key\":\"lm_property_value\"}` with mapping `{\"event_key\": \"lm_property\"}`\n- `{\"message\":\"Hey!!\", \"a\":{\"b\":{\"c\":\"lm_property_value\"}} }` with mapping `{\"a.b.c\": \"lm_property\"}`\n- `{\"message\":\"Hey!!\", \"_lm.resourceId\": { \"lm_property_name\" : \"lm_property_value\" } }`  this will override resource mapping.\n\n## LogicMonitor properties\n\n| Property | Description |\n| --- | --- |\n| `company_name` | LogicMonitor account name. |\n| `company_domain` | LogicMonitor account domain. For eg. for url test.logicmonitor.com, company_domain is logicmonitor.com . Default is `logicmonitor.com`. |\n| `resource_mapping` | The mapping that defines the source of the log event to the LM resource. In this case, the `\u003cevent_key\u003e` in the incoming event is mapped to the value of `\u003clm_property\u003e`.|\n| `access_id` | LM API Token access ID. |\n| `access_key` | LM API Token access key. |\n| `bearer_token` | LM API Bearer Token. Either specify `access_id` and `access_key` both or `bearer_token`. If all specified, LMv1 token(`access_id` and `access_key`) will be used for authentication with Logicmonitor.   |\n| `flush_interval` | Defines the time in seconds to wait before sending batches of logs to LogicMonitor. Default is `60s`. |\n| `debug` | When `true`, logs more information to the fluentd console. |\n| `force_encoding` | Specify charset when logs contains invalid utf-8 characters. |\n| `include_metadata` | When `true`, appends additional metadata to the log. default `false`.  |\n| `device_less_logs` | When `true`, do not map log with any resource. record must have `service` when `true`. default `false`. |\n| `http_proxy` | http proxy string eg. `http://user:pass@proxy.server:port`. Default `nil`  |\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogicmonitor%2Flm-logs-fluentd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogicmonitor%2Flm-logs-fluentd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogicmonitor%2Flm-logs-fluentd/lists"}