Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Syslog pump is sending unmarshalled JSON #590

Open
sjakos opened this issue Mar 17, 2023 · 0 comments
Open

Bug: Syslog pump is sending unmarshalled JSON #590

sjakos opened this issue Mar 17, 2023 · 0 comments

Comments

@sjakos
Copy link

sjakos commented Mar 17, 2023

When using the syslog pump the output format is the unmarshalled JSON struct instead of a JSON string

Example: map[alias: api_id:1 ... ] instead of {"alias": "", "api_id": "1", ...}

Example pump.conf:

{
  "analytics_storage_type": "redis",
  "analytics_storage_config": {
    "type": "redis",
    "host": "tyk-redis",
    "port": 6379,
    "hosts": null,
    "username": "",
    "password": "",
    "database": 0,
    "optimisation_max_idle": 100,
    "optimisation_max_active": 0,
    "enable_cluster": false,
    "redis_use_ssl": false,
    "redis_ssl_insecure_skip_verify": true
  },
  "log_format": "json",
  "purge_delay": 2,
  "pumps": {
    "syslog": {
      "name": "syslog",
      "meta": {
        "network_addr": "syslog-ng:1414",
        "transport": "udp",
        "log_level": 6,
        "tag": "gateway"
      }
    }
  },
  "dont_purge_uptime_data": true
}

Output sent to syslog:

<6>2023-03-17T13:20:46Z e49b4ad93c78 gateway[1]: map[alias: api_id:1 api_key:00000000 api_name:Test API api_version:Non Versioned content_length:%!s(int64=0) host:httpbin.org ip_address:192.168.160.1 method:GET oauth_id: org_id:1 path:/get raw_path:/get raw_request: raw_response: request_time_ms:%!s(int64=3274) response_code:%!s(int=200) timestamp:2023-03-17 13:20:46.0235235 +0000 UTC user_agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant