fluentd not parsing JSON log file entry

前端 未结 3 1005
别那么骄傲
别那么骄傲 2021-01-20 10:42

I\'ve seen a number of similar questions on Stackoverflow, including this one. But none address my particular issue.

The application is deployed in a Kubernetes (v1.

3条回答
  •  醉话见心
    2021-01-20 10:49

    Im SOLVED from this parse

    check in http first, make sure it was parse, and log your container

    fluentd.conf

    
      @type http
      port 5170
      bind 0.0.0.0
    
    
    
      @type parser
      key_name "$.log"
      hash_value_field "log"
      reserve_data true
      
        @type json
       
    
    
    
      @type stdout
    
    

    and check http in your terminal with curl

    curl -i -X POST -d 'json={"source":"stderr","log":"{\"applicationName\":\"api-producer-go\",\"level\":\"info\",\"msg\":\"Development is Running\",\"time\":\"2020-09-04T14:32:29Z\"}","container_id":"f9975c6a7bc6dcc21dbdacca8ff98152cd04ae28b3bc36707eba5453f6ff9960","container_name":"/api-producer-golang"}' http://localhost:5170/test.cycle
    

提交回复
热议问题