You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MuleSoft Flex Gateway日志转发至Splunk失败求助

问题排查与修复方案

1. 修正日志配置文件层级错误

你的log.yaml中,tls、tls.verify、splunk_send_raw属于Splunk输出的专属参数,需嵌套在对应输出的parameters节点下,而非与outputs同级。修正后的配置如下:

apiVersion: gateway.mulesoft.com/v1alpha1
kind: Configuration
metadata:
  name: logging-config
spec:
  logging:
    outputs:
    - name: default
      type: splunk
      parameters:
        host: <instance-name>.splunkcloud.com
        port: 443  # 改为数字格式,无需引号
        splunk_token: xxxxx-xxxxx-xxxx-xxxx
        tls: "on"
        tls.verify: "off"
        splunk_send_raw: "on"
    runtimeLogs:
      logLevel: info
      outputs: 
      - default
    accessLogs:
      outputs:
      - default

2. 验证Podman容器挂载配置

确保启动Flex Gateway容器时,已将/home/username/app/log.yaml正确挂载到容器内的指定配置路径(默认是/usr/share/mulesoft/flex-gateway/conf.d/)。启动命令示例:

podman run -d \
  -v /home/username/app/log.yaml:/usr/share/mulesoft/flex-gateway/conf.d/log.yaml:ro \
  --name flex-gateway \
  mulesoft/flex-gateway:1.2.0

3. 容器系统日志转发配置(若需转发容器自身日志)

如果要转发Podman容器自身的启动/系统日志(而非Flex Gateway的API/runtime日志),需配置Podman的Splunk日志驱动:

podman run -d \
  --log-driver splunk \
  --log-opt splunk-url=https://<instance-name>.splunkcloud.com:443 \
  --log-opt splunk-token=xxxxx-xxxxx-xxxx-xxxx \
  --log-opt splunk-insecureskipverify=true \
  --log-opt tag="flex-gateway-container" \
  -v /home/username/app/log.yaml:/usr/share/mulesoft/flex-gateway/conf.d/log.yaml:ro \
  --name flex-gateway \
  mulesoft/flex-gateway:1.2.0

4. 验证日志转发状态

  • 查看Flex Gateway容器日志,确认配置加载无错误:
podman logs flex-gateway
  • 在Splunk控制台中,搜索对应索引(默认是main)检查日志流入:
index=main source="flex-gateway*"

内容的提问来源于stack exchange,提问作者Triumph Spitfire

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.15 01:20:20