Skip to content

Commit a1d64a7

Browse files
committed
Support specifying the ingest host
1 parent 9b61a3f commit a1d64a7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/fluent/plugin/out_logtail.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class LogtailOutput < Fluent::BufferedOutput
77

88
VERSION = "0.1.1".freeze
99
CONTENT_TYPE = "application/msgpack".freeze
10-
HOST = "in.logtail.com".freeze
1110
PORT = 443
1211
PATH = "/".freeze
1312
MAX_ATTEMPTS = 3.freeze
@@ -16,9 +15,11 @@ class LogtailOutput < Fluent::BufferedOutput
1615

1716
config_param :source_token, :string, secret: true
1817
config_param :ip, :string, default: nil
18+
config_param :ingesting_host, :string, default: "in.logs.betterstack.com"
1919

2020
def configure(conf)
2121
@source_token = conf["source_token"]
22+
@ingesting_host = conf["ingesting_host"]
2223
super
2324
end
2425

@@ -90,7 +91,7 @@ def force_utf8_string_values(data)
9091
end
9192

9293
def build_http_client
93-
http = Net::HTTP.new(HOST, PORT)
94+
http = Net::HTTP.new(@ingesting_host, PORT)
9495
http.use_ssl = true
9596
# Verification on Windows fails despite having a valid certificate.
9697
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

0 commit comments

Comments
 (0)