diff --git a/README.md b/README.md index 8cb4f2c..0357f0a 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Create a custom `fluent.conf` or edit the existing one to specify which logs sho @type lm resource_mapping {"": ""} company_name + company_domain access_id access_key @@ -63,6 +64,7 @@ See the [LogicMonitor Helm repository](https://github.com/logicmonitor/k8s-helm- | Property | Description | | --- | --- | | `company_name` | LogicMonitor account name. | +| `company_domain` | LogicMonitor account domain. For eg. for url test.logicmonitor.com, company_domain is logicmonitor.com . Default is `logicmonitor.com`. | | `resource_mapping` | The mapping that defines the source of the log event to the LM resource. In this case, the `` in the incoming event is mapped to the value of ``.| | `access_id` | LM API Token access ID. | | `access_key` | LM API Token access key. | diff --git a/lib/fluent/plugin/out_lm.rb b/lib/fluent/plugin/out_lm.rb index f17b0f1..d5d1115 100644 --- a/lib/fluent/plugin/out_lm.rb +++ b/lib/fluent/plugin/out_lm.rb @@ -49,6 +49,8 @@ class LmOutput < BufferedOutput config_param :http_proxy, :string, :default => nil + config_param :company_domain , :string, :default => "logicmonitor.com" + # Use bearer token for auth. config_param :bearer_token, :string, :default => nil, secret: true @@ -77,7 +79,7 @@ def start @http_client = Net::HTTP::Persistent.new name: "fluent-plugin-lm-logs", proxy: proxy_uri @http_client.override_headers["Content-Type"] = "application/json" @http_client.override_headers["User-Agent"] = log_source + "/" + LmLogsFluentPlugin::VERSION - @url = "https://#{@company_name}.logicmonitor.com/rest/log/ingest" + @url = "https://#{@company_name}.#{@company_domain}/rest/log/ingest" @uri = URI.parse(@url) end diff --git a/lib/fluent/plugin/version.rb b/lib/fluent/plugin/version.rb index 3a28fda..2bd7eb5 100644 --- a/lib/fluent/plugin/version.rb +++ b/lib/fluent/plugin/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module LmLogsFluentPlugin - VERSION = '1.2.2' + VERSION = '1.2.3' end