SPLUNK_HOSTNAME variable doesn't set the hostname
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- docker
- 领域
- devops, infrastructure
调研方向
Reproduce the issue with the supplied compose YAML and .env file using the Splunk Universal Forwarder 9.4.12 image. Start by tracing how SPLUNK_HOSTNAME is handled during container startup and compare it with SPLUNK_BEFORE_START_CMD=set default-hostname REDACTED. Done means the environment variable sets the hostname, or the documented workaround is made explicit.
由索引模型根据 Issue 内容生成。
描述
I tried looking in /etc/hostname, a btool of server and inputs configs, and I can't find the value I set for SPLUNK_HOSTNAME. This is using the version 9.4.12 of the UF image on dockerhub, here's my redacted config file:
splunk:
role: splunk_universal_forwarder
service_name: SplunkForwarder
conf:
- key: inputs
value:
directory: /opt/splunkforwarder/etc/system/local
content:
default:
_meta: "org_id::CHANGEME"
- key: server
value:
directory: /opt/splunkforwarder/etc/system/local
content:
deployment:
pass4SymmKey: REDACTED
And my ENV file:
DEPLOYMENT_SYMM_REPLACE=REDACTED
SPLUNK_BEFORE_START_CMD=add forward-server REDACTED:9997 -client-cert /mnt/certs/cert.pem -ssl-root-ca-path /mnt/certs/cacert.pem -ssl-verify-server-cert true
SPLUNK_PASSWORD=REDACTED
SPLUNK_HOSTNAME=REDACTED
DEBUG=true
And my compose yaml:
version: '3.8'
services:
busybox-app:
image: busybox:latest
container_name: busybox-app
command: >
sh -c '
mkdir -p /var/log/busybox &&
counter=1 &&
while true; do
echo "$$(date +"%Y-%m-%d %H:%M:%S") [ID:$$counter] Test message unique string buffalo" >> /var/log/busybox/busy.log;
counter=$$((counter + 1));
sleep 5;
done
'
volumes:
- shared-logs:/var/log/busybox
restart: unless-stopped
splunk-forwarder:
image: splunk/universalforwarder:9.4.12
container_name: splunk-forwarder
env_file: ./.env
environment:
SPLUNK_ADD: "monitor /var/log/busybox/busy.log -sourcetype generic_single_line -index main"
SPLUNK_START_ARGS: --accept-license
volumes:
- shared-logs:/var/log/busybox
# Only needed if overwriting config
- ./configs.yml:/tmp/defaults/default.yml
- ./certs/:/mnt/certs/
depends_on:
- busybox-app
restart: unless-stopped
volumes:
shared-logs:
For people looking at this in the future, the workaround is to use the splunk set default-hostname command in your env file:
SPLUNK_BEFORE_START_CMD=set default-hostname REDACTED
- 主要语言
- Python
- 星标
- 551
- 派生
- 279
- 平均合并
- 3 天 9 小时
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
splunk/docker-splunk 的其他 Issue
-
难度 2/5 半天 新手友好度 78/100
splunk/docker-splunk#730 ·
-
难度 3/5 1-2 天 新手友好度 58/100
splunk/docker-splunk#737 ·
-
难度 3/5 1-2 天 新手友好度 35/100
splunk/docker-splunk#731 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 38/100
splunk/docker-splunk#724 ·
-
难度 2/5 1-3 小时 新手友好度 55/100
splunk/docker-splunk#717 ·
查看 splunk/docker-splunk 的全部 Issue
相似的 Issue
-
customer-reported question
难度 2/5 1-3 小时 新手友好度 62/100
Azure/azure-sdk-for-python#49548 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
btclib-org/btclib-wallet#409 ·
维护者通常 1 天内回复
-
Phase 2 PSA Capability & Career Profile
难度 2/5 1-3 小时 新手友好度 62/100
bcgov/digital-journeys#2310 ·
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 78/100
fastmachinelearning/hls4ml#1582 ·
维护者通常 3 天内回复
-
Sort models未关闭enhancement good first issue
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复