Skip to content

Commit

Permalink
Enable API support and replace placeholder variables with environment…
Browse files Browse the repository at this point in the history
… variables for better configuration management.
  • Loading branch information
nsouto committed Oct 2, 2024
1 parent a6ac3c9 commit 6789c8b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 41 deletions.
63 changes: 32 additions & 31 deletions octane-pdns/etc/vector/vector.toml
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
# API Support
[api]
enabled = true
address = "0.0.0.0:8686"

# TCP source for incoming JSON data
[sources.socket_tcp]
type = "socket"
address = "0.0.0.0:9001"
mode = "tcp"
max_length = 1024000
type = "socket"
address = "0.0.0.0:9001"
mode = "tcp"
max_length = 1024000

# UDP source for incoming JSON data
[sources.socket_udp]
type = "socket"
address = "0.0.0.0:9002"
mode = "udp"
max_length = 1024000
type = "socket"
address = "0.0.0.0:9002"
mode = "udp"
max_length = 1024000

# Transform: Parse incoming JSON and isolate the message field
# Transform: Parse incoming JSON
[transforms.parse_json]
type = "remap"
inputs = ["socket_tcp", "socket_udp"]
source = '''
.kinesis_stream_name = .kinesis_stream_name
.aws_region = .aws_region
.aws_access_key_id = .aws_access_key_id
.aws_secret_access_key = .aws_secret_access_key
. = parse_json!(.message)
type = "remap"
inputs = ["socket_tcp", "socket_udp"]
source = '''
. = parse_json!(.)
'''

# Kinesis sink with dynamically set stream name and region
[sinks.kinesis_dynamic]
type = "aws_kinesis_streams"
inputs = ["parse_json"]
stream_name = "{{kinesis_stream_name}}"
region = "{{aws_region}}"
auth.access_key_id = "{{aws_access_key_id}}"
auth.secret_access_key = "{{aws_secret_access_key}}"
encoding.codec = "json"
type = "aws_kinesis_streams"
inputs = ["parse_json"]
stream_name = "${VECTOR_AWS_KINESIS_STREAM_NAME}"
region = "${VECTOR_AWS_KINESIS_REGION}"
auth.access_key_id = "${VECTOR_AWS_KINESIS_ACCESS_KEY_ID}"
auth.secret_access_key = "${VECTOR_AWS_KINESIS_SECRET_ACCESS_KEY}"
encoding.codec = "json"

# Optional: Configure batching to optimize network usage
batch.max_bytes = 1024000
batch.timeout_secs = 1
# Optional: Configure batching to optimize network usage
batch.max_bytes = 1024000
batch.timeout_secs = 1

# Retry settings
request.in_flight_limit = 5
request.retry_attempts = 10
request.timeout_secs = 30
# Retry settings
request.in_flight_limit = 5
request.retry_attempts = 10
request.timeout_secs = 30
21 changes: 11 additions & 10 deletions octane/etc/vector/vector.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# API Support
[api]
enabled = true
address = "0.0.0.0:8686"

# TCP source for incoming JSON data
[sources.socket_tcp]
type = "socket"
Expand All @@ -12,26 +17,22 @@ address = "0.0.0.0:9002"
mode = "udp"
max_length = 1024000

# Transform: Parse incoming JSON and isolate the message field
# Transform: Parse incoming JSON
[transforms.parse_json]
type = "remap"
inputs = ["socket_tcp", "socket_udp"]
source = '''
.kinesis_stream_name = .kinesis_stream_name
.aws_region = .aws_region
.aws_access_key_id = .aws_access_key_id
.aws_secret_access_key = .aws_secret_access_key
. = parse_json!(.message)
. = parse_json!(.)
'''

# Kinesis sink with dynamically set stream name and region
[sinks.kinesis_dynamic]
type = "aws_kinesis_streams"
inputs = ["parse_json"]
stream_name = "{{kinesis_stream_name}}"
region = "{{aws_region}}"
auth.access_key_id = "{{aws_access_key_id}}"
auth.secret_access_key = "{{aws_secret_access_key}}"
stream_name = "${VECTOR_AWS_KINESIS_STREAM_NAME}"
region = "${VECTOR_AWS_KINESIS_REGION}"
auth.access_key_id = "${VECTOR_AWS_KINESIS_ACCESS_KEY_ID}"
auth.secret_access_key = "${VECTOR_AWS_KINESIS_SECRET_ACCESS_KEY}"
encoding.codec = "json"

# Optional: Configure batching to optimize network usage
Expand Down

0 comments on commit 6789c8b

Please sign in to comment.