Code Monkey home page Code Monkey logo

Comments (3)

kenhys avatar kenhys commented on September 24, 2024

I've checked with more simple case:

<system>
  <log>
    format json
    time_format %Y-%m-%dT%H:%M:%S%z
  </log>
</system>

<source>
  @type sample
  tag sample
</source>

<match sample>
  @type null
</match>

<label @FLUENT_LOG>
  <filter fluent.*>
    @type record_transformer
    enable_ruby true
    renew_record true
    <record>
      log ${ { message: record["message"]  } }
      type "log"
      time ${record.has_key?("time") ? record["time"]: time.strftime('%Y-%m-%dT%H:%M:%S%z') }
    </record>
  </filter>
  <match fluent.*>
    @type stdout
    <format>
      @type json
    </format>
  </match>
</label>

Here is the outcome:

After emitting USR2 signal

{"time":"2024-07-09T14:05:17+0900","level":"info","message":"Reloading new config"}
{"time":"2024-07-09T14:05:17+0900","level":"warn","message":"both of Plugin @id and path for are not specified. Using on-memory store."}
{"time":"2024-07-09T14:05:17+0900","level":"warn","message":"both of Plugin @id and path for are not specified. Using on-memory store."}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"using configuration file: \n \n \n format json\n time_format %Y-%m-%dT%H:%M:%S%z\n \n \n \n @type sample\n tag "sample"\n \n \n @type null\n \n <label @FLUENT_LOG>\n <filter fluent.>\n @type record_transformer\n enable_ruby true\n renew_record true\n \n log ${ { message: record["message"] } }\n type log\n time ${record.has_key?("time") ? record["time"]: time.strftime('%Y-%m-%dT%H:%M:%S%z') }\n \n \n <match fluent.>\n @type stdout\n \n @type "json"\n \n \n \n"}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"shutting down input plugin type=:sample plugin_id="object:bb8""}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"shutting down filter plugin type=:record_transformer plugin_id="object:b54""}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"shutting down output plugin type=:stdout plugin_id="object:b68""}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"shutting down output plugin type=:null plugin_id="object:b90""}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"adding filter in @FLUENT_LOG pattern="fluent." type="record_transformer""}
{"log":{"message":"adding filter in @FLUENT_LOG pattern="fluent.
" type="record_transformer""},"type":"log","time":"2024-07-09T14:05:17+0900"}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"adding match in @FLUENT_LOG pattern="fluent." type="stdout""}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"adding match pattern="sample" type="null""}
{"log":{"message":"adding match in @FLUENT_LOG pattern="fluent.
" type="stdout""},"type":"log","time":"2024-07-09T14:05:17+0900"}
{"log":{"message":"adding match pattern="sample" type="null""},"type":"log","time":"2024-07-09T14:05:17+0900"}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"adding source type="sample""}
{"time":"2024-07-09T14:05:17+0900","level":"warn","message":"both of Plugin @id and path for are not specified. Using on-memory store.","worker_id":0}
{"log":{"message":"adding source type="sample""},"type":"log","time":"2024-07-09T14:05:17+0900"}
{"time":"2024-07-09T14:05:17+0900","level":"warn","message":"both of Plugin @id and path for are not specified. Using on-memory store.","worker_id":0}
{"log":{"message":"both of Plugin @id and path for are not specified. Using on-memory store."},"type":"log","time":"2024-07-09T14:05:17+0900"}
{"log":{"message":"both of Plugin @id and path for are not specified. Using on-memory store."},"type":"log","time":"2024-07-09T14:05:17+0900"}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"shutting down fluentd worker worker=0","worker_id":0}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"shutting down input plugin type=:sample plugin_id="object:94c"","worker_id":0}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"shutting down filter plugin type=:record_transformer plugin_id="object:8e8"","worker_id":0}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"shutting down output plugin type=:stdout plugin_id="object:8fc"","worker_id":0}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"shutting down output plugin type=:null plugin_id="object:924"","worker_id":0}
{"time":"2024-07-09T14:05:17+0900","level":"info","message":"restart fluentd worker worker=0","worker_id":0}

<label @FLUENT_LOG> seems working as expected. It may depend on environment or timing?

need to try reporter's config.

from fluentd.

github-actions avatar github-actions commented on September 24, 2024

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days

from fluentd.

github-actions avatar github-actions commented on September 24, 2024

This issue was automatically closed because of stale in 7 days

from fluentd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.