diff --git a/main/404.html b/main/404.html index 70005170..653e2121 100644 --- a/main/404.html +++ b/main/404.html @@ -573,7 +573,7 @@
  • - + 2023
  • diff --git a/main/blog/index.html b/main/blog/index.html index d8630c83..2d7e1752 100644 --- a/main/blog/index.html +++ b/main/blog/index.html @@ -582,7 +582,7 @@
  • - + 2023
  • diff --git a/main/blog/victorialogs/loggie_victorialogs/index.html b/main/blog/victorialogs/loggie_victorialogs/index.html index a5403727..91c541ee 100644 --- a/main/blog/victorialogs/loggie_victorialogs/index.html +++ b/main/blog/victorialogs/loggie_victorialogs/index.html @@ -578,7 +578,7 @@
  • - + 2023
  • diff --git a/main/developer-guide/build/index.html b/main/developer-guide/build/index.html index c4d64208..3583ae3b 100644 --- a/main/developer-guide/build/index.html +++ b/main/developer-guide/build/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/developer-guide/code/coding-guide/index.html b/main/developer-guide/code/coding-guide/index.html index 44853ef6..6839a570 100644 --- a/main/developer-guide/code/coding-guide/index.html +++ b/main/developer-guide/code/coding-guide/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/developer-guide/component/component-guide/index.html b/main/developer-guide/component/component-guide/index.html index dbca1951..105057aa 100644 --- a/main/developer-guide/component/component-guide/index.html +++ b/main/developer-guide/component/component-guide/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/developer-guide/contributing/index.html b/main/developer-guide/contributing/index.html index 04a4d60f..391daf7b 100644 --- a/main/developer-guide/contributing/index.html +++ b/main/developer-guide/contributing/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/developer-guide/development/index.html b/main/developer-guide/development/index.html index 9beb6ea7..796ede8d 100644 --- a/main/developer-guide/development/index.html +++ b/main/developer-guide/development/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/developer-guide/release/index.html b/main/developer-guide/release/index.html index 5f0f7a56..c525cb04 100644 --- a/main/developer-guide/release/index.html +++ b/main/developer-guide/release/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/getting-started/install/kubernetes/index.html b/main/getting-started/install/kubernetes/index.html index ab09a892..71acf6ff 100644 --- a/main/getting-started/install/kubernetes/index.html +++ b/main/getting-started/install/kubernetes/index.html @@ -732,7 +732,7 @@
  • - + 2023
  • diff --git a/main/getting-started/install/node/index.html b/main/getting-started/install/node/index.html index 47cf759d..50aef452 100644 --- a/main/getting-started/install/node/index.html +++ b/main/getting-started/install/node/index.html @@ -14,7 +14,7 @@ - + @@ -677,7 +677,7 @@
  • - + 2023
  • diff --git a/main/getting-started/intro/core-concept/index.html b/main/getting-started/intro/core-concept/index.html index 4f9bc9ca..38843da6 100644 --- a/main/getting-started/intro/core-concept/index.html +++ b/main/getting-started/intro/core-concept/index.html @@ -654,7 +654,7 @@
  • - + 2023
  • diff --git a/main/getting-started/overview/index.html b/main/getting-started/overview/index.html index a1eb44cc..cafdb6b3 100644 --- a/main/getting-started/overview/index.html +++ b/main/getting-started/overview/index.html @@ -648,7 +648,7 @@
  • - + 2023
  • diff --git a/main/getting-started/quick-start/kubernetes/index.html b/main/getting-started/quick-start/kubernetes/index.html index e70d7f90..38a5f213 100644 --- a/main/getting-started/quick-start/kubernetes/index.html +++ b/main/getting-started/quick-start/kubernetes/index.html @@ -704,7 +704,7 @@
  • - + 2023
  • diff --git a/main/getting-started/quick-start/node/index.html b/main/getting-started/quick-start/node/index.html index 3d19a382..9981cdb7 100644 --- a/main/getting-started/quick-start/node/index.html +++ b/main/getting-started/quick-start/node/index.html @@ -643,7 +643,7 @@
  • - + 2023
  • diff --git a/main/getting-started/quick-start/quick-start/index.html b/main/getting-started/quick-start/quick-start/index.html index c68fcead..96fad88d 100644 --- a/main/getting-started/quick-start/quick-start/index.html +++ b/main/getting-started/quick-start/quick-start/index.html @@ -636,7 +636,7 @@
  • - + 2023
  • diff --git a/main/getting-started/roadmap/roadmap-2023/index.html b/main/getting-started/roadmap/roadmap-2023/index.html deleted file mode 100644 index e174fa94..00000000 --- a/main/getting-started/roadmap/roadmap-2023/index.html +++ /dev/null @@ -1,2769 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - 2023 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - 跳转至 - - -
    -
    - -
    - - - - - - - - -
    - - - - - - - -
    - -
    - - - - -
    -
    - - - -
    -
    -
    - - - - - - -
    -
    -
    - - - -
    -
    -
    - - - -
    -
    -
    - - - -
    -
    - - - - - - - - - - - - -

    2023 Loggie RoadMap

    -

    更多组件与功能扩展

    -
      -
    • 持久化queue
    • -
    • 流处理能力:聚合、计算、log to metrics
    • -
    • 同一个pipeline多sink支持
    • -
    • 多pipeline间通信
    • -
    • source: http
    • -
    • sink: clickhouse,prometheus exporter/remoteWrite,s3,hdfs等
    • -
    -

    服务发现与配置中心

    -
      -
    • Loggie dashboard:提供配置管理的前端页面
    • -
    -

    云原生与Kubernetes

    -
      -
    • 自动注入Loggie sidecar形态支持
    • -
    • opentelemetry兼容与支持
    • -
    - - - - - - -
    -
    - - - - -
    - - - -
    - - - -
    -
    -
    -
    - - - - - - - - - \ No newline at end of file diff --git a/main/index.html b/main/index.html index 17488032..14893b96 100644 --- a/main/index.html +++ b/main/index.html @@ -585,7 +585,7 @@
  • - + 2023
  • diff --git a/main/reference/apis/config/index.html b/main/reference/apis/config/index.html index 5d73d688..47223a6a 100644 --- a/main/reference/apis/config/index.html +++ b/main/reference/apis/config/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/apis/help/index.html b/main/reference/apis/help/index.html index b16b8414..5ece1d3d 100644 --- a/main/reference/apis/help/index.html +++ b/main/reference/apis/help/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/apis/registry/index.html b/main/reference/apis/registry/index.html index 0fb33374..3db605a1 100644 --- a/main/reference/apis/registry/index.html +++ b/main/reference/apis/registry/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/apis/version/index.html b/main/reference/apis/version/index.html index 41df3670..c4caa5ea 100644 --- a/main/reference/apis/version/index.html +++ b/main/reference/apis/version/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/discovery/kubernetes/clusterlogconfig/index.html b/main/reference/discovery/kubernetes/clusterlogconfig/index.html index 7a15301c..f84b38fe 100644 --- a/main/reference/discovery/kubernetes/clusterlogconfig/index.html +++ b/main/reference/discovery/kubernetes/clusterlogconfig/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/discovery/kubernetes/interceptors/index.html b/main/reference/discovery/kubernetes/interceptors/index.html index 91ba0297..a3c22619 100644 --- a/main/reference/discovery/kubernetes/interceptors/index.html +++ b/main/reference/discovery/kubernetes/interceptors/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/discovery/kubernetes/logconfig/index.html b/main/reference/discovery/kubernetes/logconfig/index.html index 8ceabbb4..f9e112b9 100644 --- a/main/reference/discovery/kubernetes/logconfig/index.html +++ b/main/reference/discovery/kubernetes/logconfig/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/discovery/kubernetes/sink/index.html b/main/reference/discovery/kubernetes/sink/index.html index 40fc73bb..f13c165a 100644 --- a/main/reference/discovery/kubernetes/sink/index.html +++ b/main/reference/discovery/kubernetes/sink/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/global/args/index.html b/main/reference/global/args/index.html index fa05dcd6..945d8c30 100644 --- a/main/reference/global/args/index.html +++ b/main/reference/global/args/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/global/db/index.html b/main/reference/global/db/index.html index 039ad919..9207fa6e 100644 --- a/main/reference/global/db/index.html +++ b/main/reference/global/db/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/global/defaults/index.html b/main/reference/global/defaults/index.html index 7e32721f..36e04b9c 100644 --- a/main/reference/global/defaults/index.html +++ b/main/reference/global/defaults/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/global/discovery/index.html b/main/reference/global/discovery/index.html index 9d079554..faba481c 100644 --- a/main/reference/global/discovery/index.html +++ b/main/reference/global/discovery/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/global/http/index.html b/main/reference/global/http/index.html index dcdad5d5..b9789632 100644 --- a/main/reference/global/http/index.html +++ b/main/reference/global/http/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/global/monitor/index.html b/main/reference/global/monitor/index.html index 960e8ea9..aaff2f3e 100644 --- a/main/reference/global/monitor/index.html +++ b/main/reference/global/monitor/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/global/reload/index.html b/main/reference/global/reload/index.html index a19c463b..1a40cc78 100644 --- a/main/reference/global/reload/index.html +++ b/main/reference/global/reload/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/global/subcmd/index.html b/main/reference/global/subcmd/index.html index 18889da0..4e950c99 100644 --- a/main/reference/global/subcmd/index.html +++ b/main/reference/global/subcmd/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/global/var/index.html b/main/reference/global/var/index.html index 03e7d1ee..ef530d60 100644 --- a/main/reference/global/var/index.html +++ b/main/reference/global/var/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/index.html b/main/reference/index.html index 0611ea9f..e3822f59 100644 --- a/main/reference/index.html +++ b/main/reference/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/monitor/filesource/index.html b/main/reference/monitor/filesource/index.html index 24090a0d..47cdb6fa 100644 --- a/main/reference/monitor/filesource/index.html +++ b/main/reference/monitor/filesource/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/monitor/filewatcher/index.html b/main/reference/monitor/filewatcher/index.html index 3363ae48..7d45148b 100644 --- a/main/reference/monitor/filewatcher/index.html +++ b/main/reference/monitor/filewatcher/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/monitor/info/index.html b/main/reference/monitor/info/index.html index b765a517..86025c2f 100644 --- a/main/reference/monitor/info/index.html +++ b/main/reference/monitor/info/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/monitor/logalert/index.html b/main/reference/monitor/logalert/index.html index 7b9e29a3..3572d6fe 100644 --- a/main/reference/monitor/logalert/index.html +++ b/main/reference/monitor/logalert/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/monitor/overview/index.html b/main/reference/monitor/overview/index.html index e3a32165..ac45d603 100644 --- a/main/reference/monitor/overview/index.html +++ b/main/reference/monitor/overview/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/monitor/queue/index.html b/main/reference/monitor/queue/index.html index 634d97a3..af3e5681 100644 --- a/main/reference/monitor/queue/index.html +++ b/main/reference/monitor/queue/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/monitor/reload/index.html b/main/reference/monitor/reload/index.html index 6a9fcb97..95f7eae9 100644 --- a/main/reference/monitor/reload/index.html +++ b/main/reference/monitor/reload/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/monitor/sink/index.html b/main/reference/monitor/sink/index.html index 3dd454a5..fe9e01fb 100644 --- a/main/reference/monitor/sink/index.html +++ b/main/reference/monitor/sink/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/monitor/sys/index.html b/main/reference/monitor/sys/index.html index fa51ee0a..e68fdbaf 100644 --- a/main/reference/monitor/sys/index.html +++ b/main/reference/monitor/sys/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/interceptor/addhostmeta/index.html b/main/reference/pipelines/interceptor/addhostmeta/index.html index 01927eb5..b9b5035d 100644 --- a/main/reference/pipelines/interceptor/addhostmeta/index.html +++ b/main/reference/pipelines/interceptor/addhostmeta/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/interceptor/addk8smeta/index.html b/main/reference/pipelines/interceptor/addk8smeta/index.html index d6485e34..4f06ebaf 100644 --- a/main/reference/pipelines/interceptor/addk8smeta/index.html +++ b/main/reference/pipelines/interceptor/addk8smeta/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/interceptor/limit/index.html b/main/reference/pipelines/interceptor/limit/index.html index d6cea5c9..f8846b4e 100644 --- a/main/reference/pipelines/interceptor/limit/index.html +++ b/main/reference/pipelines/interceptor/limit/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/interceptor/logalert/index.html b/main/reference/pipelines/interceptor/logalert/index.html index 3b30bb04..98a511ea 100644 --- a/main/reference/pipelines/interceptor/logalert/index.html +++ b/main/reference/pipelines/interceptor/logalert/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/interceptor/maxbytes/index.html b/main/reference/pipelines/interceptor/maxbytes/index.html index 1171f6fa..933b1d04 100644 --- a/main/reference/pipelines/interceptor/maxbytes/index.html +++ b/main/reference/pipelines/interceptor/maxbytes/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/interceptor/metrics/index.html b/main/reference/pipelines/interceptor/metrics/index.html index 53c72b8c..7e665667 100644 --- a/main/reference/pipelines/interceptor/metrics/index.html +++ b/main/reference/pipelines/interceptor/metrics/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/interceptor/normalize/index.html b/main/reference/pipelines/interceptor/normalize/index.html index 150706a3..43b40770 100644 --- a/main/reference/pipelines/interceptor/normalize/index.html +++ b/main/reference/pipelines/interceptor/normalize/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/interceptor/overview/index.html b/main/reference/pipelines/interceptor/overview/index.html index e986a846..99d7642a 100644 --- a/main/reference/pipelines/interceptor/overview/index.html +++ b/main/reference/pipelines/interceptor/overview/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/interceptor/retry/index.html b/main/reference/pipelines/interceptor/retry/index.html index b3e50056..edc67384 100644 --- a/main/reference/pipelines/interceptor/retry/index.html +++ b/main/reference/pipelines/interceptor/retry/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/interceptor/schema/index.html b/main/reference/pipelines/interceptor/schema/index.html index 1ab28d17..c292bb9f 100644 --- a/main/reference/pipelines/interceptor/schema/index.html +++ b/main/reference/pipelines/interceptor/schema/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/interceptor/transformer/index.html b/main/reference/pipelines/interceptor/transformer/index.html index 9297f1bd..562b2021 100644 --- a/main/reference/pipelines/interceptor/transformer/index.html +++ b/main/reference/pipelines/interceptor/transformer/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/queue/channel/index.html b/main/reference/pipelines/queue/channel/index.html index 5a1ff876..3a77d126 100644 --- a/main/reference/pipelines/queue/channel/index.html +++ b/main/reference/pipelines/queue/channel/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/queue/memory/index.html b/main/reference/pipelines/queue/memory/index.html index 553f495f..c840e4f6 100644 --- a/main/reference/pipelines/queue/memory/index.html +++ b/main/reference/pipelines/queue/memory/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/dev/index.html b/main/reference/pipelines/sink/dev/index.html index 085358e8..971dd16a 100644 --- a/main/reference/pipelines/sink/dev/index.html +++ b/main/reference/pipelines/sink/dev/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/elasticsearch/index.html b/main/reference/pipelines/sink/elasticsearch/index.html index 1221a610..50e97fe3 100644 --- a/main/reference/pipelines/sink/elasticsearch/index.html +++ b/main/reference/pipelines/sink/elasticsearch/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/file/index.html b/main/reference/pipelines/sink/file/index.html index dca6cf0a..e003bc5e 100644 --- a/main/reference/pipelines/sink/file/index.html +++ b/main/reference/pipelines/sink/file/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/franzkafka/index.html b/main/reference/pipelines/sink/franzkafka/index.html index a1413a00..6d184aa6 100644 --- a/main/reference/pipelines/sink/franzkafka/index.html +++ b/main/reference/pipelines/sink/franzkafka/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/grpc/index.html b/main/reference/pipelines/sink/grpc/index.html index 901f563c..c4b8e679 100644 --- a/main/reference/pipelines/sink/grpc/index.html +++ b/main/reference/pipelines/sink/grpc/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/kafka/index.html b/main/reference/pipelines/sink/kafka/index.html index 6fa7d210..c4883005 100644 --- a/main/reference/pipelines/sink/kafka/index.html +++ b/main/reference/pipelines/sink/kafka/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/loki/index.html b/main/reference/pipelines/sink/loki/index.html index 02447d92..41eb6bed 100644 --- a/main/reference/pipelines/sink/loki/index.html +++ b/main/reference/pipelines/sink/loki/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/overview/index.html b/main/reference/pipelines/sink/overview/index.html index 93d14d1f..e48c4e8d 100644 --- a/main/reference/pipelines/sink/overview/index.html +++ b/main/reference/pipelines/sink/overview/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/pulsar/index.html b/main/reference/pipelines/sink/pulsar/index.html index 5ad603d6..d3ef7e4b 100644 --- a/main/reference/pipelines/sink/pulsar/index.html +++ b/main/reference/pipelines/sink/pulsar/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/rocketmq/index.html b/main/reference/pipelines/sink/rocketmq/index.html index 61c2e2ad..ebea02c0 100644 --- a/main/reference/pipelines/sink/rocketmq/index.html +++ b/main/reference/pipelines/sink/rocketmq/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/sls/index.html b/main/reference/pipelines/sink/sls/index.html index 2382e779..1340a131 100644 --- a/main/reference/pipelines/sink/sls/index.html +++ b/main/reference/pipelines/sink/sls/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/webhook/index.html b/main/reference/pipelines/sink/webhook/index.html index 92a47a54..624e038e 100644 --- a/main/reference/pipelines/sink/webhook/index.html +++ b/main/reference/pipelines/sink/webhook/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/sink/zinc/index.html b/main/reference/pipelines/sink/zinc/index.html index 535ffde1..a36a9b82 100644 --- a/main/reference/pipelines/sink/zinc/index.html +++ b/main/reference/pipelines/sink/zinc/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/source/dev/index.html b/main/reference/pipelines/source/dev/index.html index 983ff7f2..455d8ec4 100644 --- a/main/reference/pipelines/source/dev/index.html +++ b/main/reference/pipelines/source/dev/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/source/elasticsearch/index.html b/main/reference/pipelines/source/elasticsearch/index.html index 6f81d929..865102d2 100644 --- a/main/reference/pipelines/source/elasticsearch/index.html +++ b/main/reference/pipelines/source/elasticsearch/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/source/file/index.html b/main/reference/pipelines/source/file/index.html index 29a5b68b..4702e815 100644 --- a/main/reference/pipelines/source/file/index.html +++ b/main/reference/pipelines/source/file/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/source/franzkafka/index.html b/main/reference/pipelines/source/franzkafka/index.html index 1464101a..db240712 100644 --- a/main/reference/pipelines/source/franzkafka/index.html +++ b/main/reference/pipelines/source/franzkafka/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/source/grpc/index.html b/main/reference/pipelines/source/grpc/index.html index ded38563..145d30f6 100644 --- a/main/reference/pipelines/source/grpc/index.html +++ b/main/reference/pipelines/source/grpc/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/source/kafka/index.html b/main/reference/pipelines/source/kafka/index.html index d7bfa7ff..b4d07e87 100644 --- a/main/reference/pipelines/source/kafka/index.html +++ b/main/reference/pipelines/source/kafka/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/source/kube-event/index.html b/main/reference/pipelines/source/kube-event/index.html index d42f1743..448b6c03 100644 --- a/main/reference/pipelines/source/kube-event/index.html +++ b/main/reference/pipelines/source/kube-event/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/source/overview/index.html b/main/reference/pipelines/source/overview/index.html index 256c771c..2c72c21a 100644 --- a/main/reference/pipelines/source/overview/index.html +++ b/main/reference/pipelines/source/overview/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/source/prometheus-exporter/index.html b/main/reference/pipelines/source/prometheus-exporter/index.html index 64261d61..60b78de0 100644 --- a/main/reference/pipelines/source/prometheus-exporter/index.html +++ b/main/reference/pipelines/source/prometheus-exporter/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/reference/pipelines/source/unix/index.html b/main/reference/pipelines/source/unix/index.html index 2d41d79f..f4b6f0be 100644 --- a/main/reference/pipelines/source/unix/index.html +++ b/main/reference/pipelines/source/unix/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/search/search_index.json b/main/search/search_index.json index f66f52ef..91fff48b 100644 --- a/main/search/search_index.json +++ b/main/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["ja"],"separator":"[\\s\\-\uff0c\u3002]+","pipeline":["stemmer"]},"docs":[{"location":"blog/","title":"Posts","text":""},{"location":"blog/#blog","title":"Blog","text":""},{"location":"blog/#loggievictorialogs","title":"\u5c1d\u9c9c\u521d\u4f53\u9a8c\uff1a\u4f7f\u7528Loggie\u548cVictoriaLogs\u5feb\u901f\u6784\u5efa\u65b0\u4e00\u4ee3\u7684\u65e5\u5fd7\u7cfb\u7edf","text":"

    ethfoo 2023-6-28 \u00a0 20 min read

    \u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a

    Continue reading

    "},{"location":"blog/#loggie","title":"\u7f51\u6613\u57fa\u4e8eLoggie\u7684\u4e91\u539f\u751f\u5927\u89c4\u6a21\u65e5\u5fd7\u67b6\u6784\u6f14\u8fdb","text":"

    ethfoo 2022-12-17 \u00a0 15 min read

    \u6765\u81ea2022 Top 100\u5168\u7403\u8f6f\u4ef6\u6848\u4f8b\u7814\u7a76\u5cf0\u4f1a\u7684\u5206\u4eab\u3002

    \u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a

    Continue reading

    "},{"location":"blog/#loggie_1","title":"\u4f7f\u7528Loggie\u5feb\u901f\u6784\u5efa\u53ef\u6269\u5c55\u7684\u4e91\u539f\u751f\u65e5\u5fd7\u67b6\u6784","text":"

    ethfoo 2022-10-26 \u00a0 10 min read

    \u6765\u81ea\u4e91\u539f\u751f\u793e\u533a\u53ef\u89c2\u6d4b\u6027\u76f4\u64ad\u5206\u4eab\u3002

    \u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a

    Continue reading

    "},{"location":"blog/#_1","title":"\u7f51\u6613\u6570\u5e06\u4e91\u539f\u751f\u65e5\u5fd7\u5e73\u53f0\u67b6\u6784\u5b9e\u8df5","text":"

    ethfoo 2022-03-11 \u00a0 8 min read

    \u6765\u81eadatafun talk\u7684\u5206\u4eab\u3002

    \u7f51\u6613\u4ece2015\u5e74\u5c31\u5f00\u59cb\u4e86\u4e91\u539f\u751f\u7684\u63a2\u7d22\u4e0e\u5b9e\u8df5\uff0c\u4f5c\u4e3a\u53ef\u89c2\u6d4b\u6027\u7684\u91cd\u8981\u4e00\u73af\uff0c\u65e5\u5fd7\u5e73\u53f0\u4e5f\u7ecf\u5386\u4e86\u4ece\u4e3b\u673a\u5230\u5bb9\u5668\u7684\u6f14\u8fdb\uff0c\u652f\u6491\u4e86\u96c6\u56e2\u5185\u5404\u4e1a\u52a1\u90e8\u95e8\u7684\u5927\u89c4\u6a21\u4e91\u539f\u751f\u5316\u6539\u9020\u3002 \u672c\u6587\u4f1a\u8bb2\u8ff0\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u6211\u4eec\u9047\u5230\u7684\u95ee\u9898\uff0c\u5982\u4f55\u6f14\u8fdb\u548c\u6539\u9020\uff0c\u5e76\u4ece\u4e2d\u6c89\u6dc0\u4e86\u54ea\u4e9b\u7ecf\u9a8c\u4e0e\u6700\u4f73\u5b9e\u8df5\u3002

    \u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a

    Continue reading

    PPT

    "},{"location":"blog/victorialogs/loggie_victorialogs/","title":"\u5c1d\u9c9c\u521d\u4f53\u9a8c\uff1a\u4f7f\u7528Loggie\u548cVictoriaLogs\u5feb\u901f\u6784\u5efa\u65b0\u4e00\u4ee3\u7684\u65e5\u5fd7\u7cfb\u7edf","text":"

    \u5982\u679c\u4f60\u719f\u6089Prometheus\uff0c\u60f3\u5fc5\u4f60\u80af\u5b9a\u4e5f\u77e5\u9053VictoriaMetrics\uff0c\u8fd9\u6b3e\u8d8a\u6765\u8d8a\u6d41\u884c\u7684\u76d1\u63a7\u9879\u76ee\uff0c\u53ef\u4f5c\u4e3aPrometheus\u7684\u589e\u5f3a\u6216\u8005\u5e73\u66ff\u3002VictoriaMetrics\u4e00\u4e2a\u91cd\u8981\u7684\u4eae\u70b9\u5c31\u662f\u89e3\u51b3Prometheus\u5728\u5927\u89c4\u6a21Metrics\u6307\u6807\u6570\u636e\u91cf\u7ea7\u4e0b\u7684\u5b58\u50a8\u95ee\u9898\u3002

    \u540c\u5c5e\u4e8e\u53ef\u89c2\u6d4b\u6027\uff0c\u5f53\u6211\u4eec\u628a\u773c\u5149\u805a\u7126\u5230\u65e5\u5fd7\u9886\u57df\uff0c\u5176\u5b9e\u5f88\u4e45\u4ee5\u6765\u65e5\u5fd7\u7684\u4e00\u4e2a\u75db\u70b9\u662f\u4e5f\u662f\u5b58\u50a8\u3002

    "},{"location":"blog/victorialogs/loggie_victorialogs/#_1","title":"\u5f53\u524d\u65e5\u5fd7\u5b58\u50a8\u7684\u75db\u70b9","text":"

    \u65f6\u4e0b\u6bd4\u8f83\u5e38\u89c1\u7684\u4e00\u4e9b\u5f00\u6e90\u65e5\u5fd7\u5b58\u50a8\u9879\u76ee\u6709\uff1aElasticsearch\u3001Clickhouse\u3001Loki\u7b49\u3002\u5f53\u7136\uff0cElasticsearch\u548cClickhouse\u5e76\u975e\u5929\u751f\u9488\u5bf9\u65e5\u5fd7\u5b58\u50a8\u800c\u8bbe\u8ba1\uff0c\u6211\u4eec\u53ea\u662f\u53ef\u4ee5\u62ff\u6765\u5b58\u50a8\u65e5\u5fd7\u6570\u636e\u800c\u5df2\u3002

    \u6bd4\u5982Elasticsearch\u7684\u6838\u5fc3\u662f\u4e00\u4e2a\u641c\u7d22\u5f15\u64ce\u3002\u9488\u5bf9\u65e5\u5fd7\u5b58\u50a8\u7684\u573a\u666f\uff0c\u53ef\u4ee5\u5168\u6587\u68c0\u7d22\u662f\u4e00\u5927\u4f18\u52bf\uff0c\u4f46\u540c\u65f6\u5b58\u5728\u4ee5\u4e0b\u4e00\u4e9b\u4e0d\u8db3\uff1a

    \u603b\u4f53\u6765\u8bf4\uff0cElasticsearch\u662f\u4e00\u6b3e\u5386\u53f2\u60a0\u4e45\u3001\u88ab\u5e7f\u6cdb\u4f7f\u7528\u7684\u65e5\u5fd7\u5b58\u50a8\u6570\u636e\u5e93\uff0c\u6bd5\u7adf\u5f53\u5e74ELK\u7684\u6982\u5ff5\u6df1\u5165\u4eba\u5fc3\u3002\u4f46\u662f\uff0c\u5728\u5f53\u524d\u964d\u672c\u589e\u6548\u7684\u5927\u80cc\u666f\u4e0b\uff0c\u5f88\u591a\u4f01\u4e1a\u8fd8\u662f\u4f1a\u5bf9Elasticsearch\u5360\u7528\u7684\u673a\u5668\u8d44\u6e90\u6bd4\u8f83\u654f\u611f\uff0c\u5982\u679c\u53ea\u7528\u4e8e\u5b58\u50a8\u5927\u91cf\u7684\u8fd0\u7ef4\u7c7b\u65e5\u5fd7\uff0c\u6027\u4ef7\u6bd4\u8fd8\u662f\u504f\u4f4e\u3002

    \u6240\u4ee5\u524d\u4e24\u5e74Grafana\u5bb6\u7684Loki\u6a2a\u7a7a\u51fa\u4e16\uff0c\u8fd8\u662f\u6380\u8d77\u4e86\u4e00\u70b9\u6c34\u82b1\u7684\uff0c\u6bd5\u7adf\u65e5\u5fd7\u9886\u57df\u65e9\u5c31\u82e6Elasticsearch\u4e45\u77e3\u3002

    \u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0bLoki\u7684\u4f18\u70b9\uff1a

    \u5927\u534a\u5e74\u524d\uff0c\u6211\u4eec\u516c\u53f8\u5185\u90e8\u6709\u90e8\u95e8\u5f00\u59cb\u5c1d\u8bd5\u4f7f\u7528Loki\u5b58\u50a8\u4e00\u4e9b\u7cfb\u7edf\u65e5\u5fd7\u3002\u4f46\u603b\u4f1a\u9047\u5230\u4e00\u4e9b\u5c0f\u95ee\u9898\uff0c\u5e76\u4e0d\u662f\u5f88\u8ba9\u4eba\u653e\u5fc3\u3002\u9664\u6b64\u4e4b\u5916\uff0cLoki\u7684\u4e0d\u8db3\u4e4b\u5904\u8fd8\u6709\uff1a

    \u5f53\u7136\uff0cLoki\u8fd8\u662f\u4e00\u4e2a\u76f8\u5bf9\u5e74\u8f7b\u7684\u9879\u76ee\uff0c\u6211\u4eec\u53ef\u4ee5\u7406\u89e3\u8fd9\u4e9b\u7a33\u5b9a\u6027\u3001\u6027\u80fd\u3001\u8bbe\u8ba1\u4e0a\u7684\u95ee\u9898\u53ef\u80fd\u662f\u53d1\u5c55\u65e9\u671f\u7684\u9635\u75db\u3002

    \u4f46\u662f\uff0c\u8c8c\u4f3c\u5f88\u591a\u4eba\u5df2\u7ecf\u7b49\u4e0d\u53ca\u4e86\u3002

    "},{"location":"blog/victorialogs/loggie_victorialogs/#victorialogs","title":"\u59d7\u59d7\u6765\u8fdf\uff1aVictoriaLogs\u7684\u4f18\u52bf","text":"

    \u6700\u8fd1VictoriaMetrics\u53d1\u5e03\u4e86\u9884\u89c8\u7248\u7684VictoriaLogs\uff0c\u7c7b\u4f3cLoki\u4e13\u95e8\u7528\u4e8e\u5b58\u50a8\u65e5\u5fd7\u3002\u9274\u4e8eVictoriaMetrics\u7684\u826f\u597d\u540d\u58f0\uff0c\u8fd8\u662f\u8ba9\u5927\u5bb6\u5bf9\u8fd9\u6761\u6405\u5c40\u7684\u300c\u9cb6\u9c7c\u300d\u5145\u6ee1\u4e86\u4e00\u5b9a\u7684\u671f\u5f85\u3002

    VictoriaMetrics\u4e3a\u4ec0\u4e48\u8981\u5165\u5c40\u641eVictoriaLogs\u5462\uff1f

    \u5176\u5b9e\u4ece2020\u5e74\u7684\u8fd9\u4e2aIssues\u5f00\u59cb\uff1ahttps://github.com/VictoriaMetrics/VictoriaMetrics/issues/816

    VictoriaMetrics\u5c31\u6709\u4e86\u7814\u53d1VictoriaLogs\u7684\u60f3\u6cd5\u3002\u4ece\u8be5issues\u7684\u8ba8\u8bba\u4e2d\u6211\u4eec\u53ef\u4ee5\u770b\u51fa\uff0c\u5927\u5bb6\u5bf9Loki\u8fd8\u662f\u6709\u70b9\u5fae\u8f9e\u7684\uff0c\u6bd4\u5982\u8bf4\u5b58\u50a8\u4f9d\u8d56S3\uff08\u672c\u5730\u5b58\u50a8\u4e0d\u652f\u6301\u5206\u5e03\u5f0f\uff09\uff0c\u6bd4\u5982\u8bf4\u6027\u80fd\u3002

    \u8fd9\u91cc\u8282\u9009\u4e00\u4e0bissues\u91cc\u7684\u5410\u69fd\uff1a

    almost 2 years passed and Loki is still unusable for scenarios with real logging data. Trying to query anything hitting more than 50k logs is exploding servers :)

    \u4e0d\u7528\u7ffb\u8bd1\u4e86\uff0c\u9694\u7740\u5c4f\u5e55\u6211\u4eec\u90fd\u80fd\u611f\u53d7\u5230\u8fd9\u4e2a\u7528\u6237\u7684\u5f3a\u70c8\u4e0d\u6ee1\u3002

    \u65f6\u9694\u4e24\u5e74\u591a\uff0cVictoriaLogs\u7ec8\u4e8e\u6b63\u5f0f\u6765\u5230\u4e86\u6211\u4eec\u9762\u524d\uff0c\u90a3VictoriaLogs\u5230\u5e95\u6709\u54ea\u4e9b\u4f18\u52bf\uff0c\u53c8\u80fd\u89e3\u51b3\u65e5\u5fd7\u5b58\u50a8\u9886\u57df\u7684\u54ea\u4e9b\u95ee\u9898\u5462\uff1f

    \u8fd9\u91cc\u6211\u7b80\u7565\u603b\u7ed3\u51e0\u70b9\uff0c\u611f\u5174\u8da3\u7684\u540c\u5b66\u53ef\u4ee5\u5728\u5b98\u65b9\u6587\u6863\u4e2d\u5bfb\u627e\u66f4\u591a\u7b54\u6848\u3002

    \u5148\u8bf4VictoriaMetrics\u5bb6\u7684\u4e00\u5927\u7279\u8272\uff1a\u517c\u5bb9\u6027\u3002 VictoriaLogs\u76f4\u63a5\u652f\u6301\u4e86Elasticsearch bulk API\uff0c\u7531\u4e8e\u5e02\u9762\u4e0a\u51e0\u4e4e\u6240\u6709\u7684\u65e5\u5fd7\u91c7\u96c6Agent\u90fd\u652f\u6301\u53d1\u9001\u81f3Elasticsearch\uff0c\u6240\u4ee5\u53ef\u4ee5\u57fa\u672c\u505a\u5230\u65e0\u7f1d\u5bf9\u63a5\u548c\u8fc1\u79fb\uff0c\u65e0\u9700\u8ba9\u8fd9\u4e9bAgent\u90fd\u53bb\u7814\u53d1\u589e\u52a0\u65b0\u7684\u8f93\u51fa\u6e90\u3002\uff08\u8fd9\u91cc\u786e\u5b9e\u8981\u5410\u69fd\u4e00\u4e0bLoki\uff0c\u8fde\u4e2a\u516c\u5f00\u7684\u5ba2\u6237\u7aefClient SDK\u5305\u90fd\u6ca1\u6709\u63d0\u4f9b\uff0c\u8fd9\u8ba9\u4eba\u600e\u4e48\u5bf9\u63a5\u5462\uff09

    \u4f46\u662f\u652f\u6301\u6a2a\u5411\u548c\u7eb5\u5411\u6269\u5bb9\uff0c\u8fd9\u70b9\u7531\u4e8e\u73b0\u5728VictoriaLogs\u9884\u89c8\u7248\u53ea\u63d0\u4f9b\u4e86\u5355\u8282\u70b9\u7684\uff0c\u6682\u65f6\u8fd8\u65e0\u6cd5\u786e\u8ba4\u3002

    \u53e6\u5916\u5728 \u8d44\u6e90\u5360\u7528 \u65b9\u9762\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u770bVictoriaLogs\u63d0\u4f9b\u7684benchmark\u7ed3\u679c\u3002\u5bf9\u6bd4Elasticsearch\uff0c\u4ece\u4e0b\u56fe\u53ef\u4ee5\u770b\u51fa\uff1a

    \u5185\u5b58\u548c\u78c1\u76d8\u5360\u7528\u786e\u5b9e\u8981\u4f4e\u592a\u591a\uff0c\u57fa\u672c\u4e0a\u662f\u5dee\u4e86\u4e00\u4e2a\u6570\u91cf\u7ea7\uff0c\u5982\u679c\u5b58\u50a8\u91cf\u5927\u7684\u8bdd\uff0c\u80fd\u7701\u4e0b\u4e0d\u5c11\u53f0\u670d\u52a1\u5668\u7684\u94b1\uff0c\u65e0\u7591\u662f\u73b0\u5728\u964d\u672c\u589e\u6548\u60a3\u8005\u7684\u4e00\u5927\u798f\u97f3\u3002

    VictoriaLogs\u540c\u6837\u5f15\u5165\u4e86 log stream \u7684\u6982\u5ff5\uff0c\u7ed3\u5408\u591a\u79df\u6237\u7684\u80fd\u529b\uff0c\u4f3c\u4e4e\u53ef\u4ee5\u505a\u5230\u65e5\u5fd7\u5b58\u50a8\u573a\u666f\u4e0b\u7684\u6027\u80fd\u3001\u8d44\u6e90\u5360\u7528\u6743\u8861\u4e0b\u7684\u6700\u4f18\u89e3\uff0c\u8fd9\u4e5f\u662fVictoriaLogs\u533a\u522b\u4e8eElasticsearch\u7b49\u975e\u4e13\u95e8\u4e3a\u65e5\u5fd7\u5b58\u50a8\u8bbe\u8ba1\u6570\u636e\u5e93\u7684\u6838\u5fc3\u56e0\u7d20\u3002

    \u6240\u4ee5\u5728\u4f7f\u7528VictoriaLogs\u4e4b\u524d\uff0c\u8bf7\u52a1\u5fc5\u5148\u597d\u597d\u4e86\u89e3\u4e00\u4e0blog stream\u3002

    log stream\u662f\u4ec0\u4e48\u5462\uff1f

    \u7b80\u5355\u6765\u8bf4\uff0c\u8868\u793a\u5e94\u7528\uff08\u670d\u52a1\uff09\u7684\u4e00\u4e2a\u65e5\u5fd7\u5b9e\u4f8b\u3002\u81f3\u4e8e\u8fd9\u4e2a\u65e5\u5fd7\u5b9e\u4f8b\u7684\u5177\u4f53\u7c92\u5ea6\uff0c\u53ef\u4ee5\u7531\u6211\u4eec\u81ea\u884c\u8bbe\u8ba1\u548c\u638c\u63a7\uff0c\u4f46\u662f\u4e0d\u5efa\u8bae\u6574\u4f53\u6570\u91cf\u7279\u522b\u5927\u3002

    \u4e3e\u4f8b\u8bf4\u660e\uff0c\u4e00\u4e2a\u65e5\u5fd7\u5b9e\u4f8b\u53ef\u4ee5\u4e3a\uff1a

    log stream\u8bbe\u8ba1\u7684\u5173\u952e\u662f\u53ef\u4ee5\u88ab\u552f\u4e00\u6807\u8bc6\uff0c\u8fd9\u6837\u53ef\u4ee5\u786e\u5b9a\u65e5\u5fd7\u5728\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u4ea7\u751f\u7684\u4f4d\u7f6e\uff0c\u6bd4\u5982\u5728\u54ea\u4e2a\u8282\u70b9\u7684\u54ea\u4e2a\u5bb9\u5668\u7684\u54ea\u4e2a\u65e5\u5fd7\u6587\u4ef6\u4e2d\u3002

    \u4e00\u4e2alog stream\u7531\u591a\u4e2alabel\u6765\u6807\u8bc6\uff0c\u6240\u4ee5\u5176\u5b9e\u8fd9\u91cc\u548cPrometheus metrics\u7684label\u7c7b\u4f3c\uff0c\u6211\u4eec\u53ef\u4ee5\u62ffPrometheus\u4e2d\u7684\u4e00\u4e9b\u6982\u5ff5\u7c7b\u6bd4\uff1a

    \u5728VictoriaLogs\u4e2d\u4e5f\u53ef\u4ee5\u81ea\u5df1\u8bbe\u8ba1\u4e00\u4e9b\u7c7b\u4f3c\u7684label\uff0c\u52a0\u5728\u65e5\u5fd7\u91c7\u96c6\u7684\u5143\u4fe1\u606f\u4e2d\uff0c\u8fd9\u6837\u8fd8\u80fd\u7528\u4e8e\u540e\u7eed\u7684\u65e5\u5fd7\u548c\u6307\u6807\u7684\u5173\u8054\u548c\u68c0\u7d22\u3002\u5f53\u7136\u5728\u5b9e\u9645\u7684\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u589e\u52a0\u8bf8\u5982\uff1a\u73af\u5883\u3001\u6570\u636e\u4e2d\u5fc3\u3001namespace\u7b49\u7684label\u3002

    \u5982\u679c\u4f60\u4e4b\u524d\u4e86\u89e3Loki\uff0c\u80af\u5b9a\u4f1a\u60f3\u8bf4\uff0cLoki\u4e0d\u4e5f\u662f\u8fd9\u6837\u8bbe\u8ba1label\u7684\u5417\uff1f

    \u5bf9\uff0c\u4f46\u662f\u7b49\u4f60\u6df1\u5165\u7528\u8fc7Loki\u540e\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u8fd9\u6837\u7684\u5751\uff1a\u5f53\u53d1\u9001\u7684\u65e5\u5fd7labels\u91cc\u643a\u5e26\u4e86\u4e00\u4e9b\u9891\u7e41\u4fee\u6539\u7684\u5b57\u6bb5\uff0c\u6bd4\u5982\u8bf4\u4e00\u6761\u65e5\u5fd7\uff0c\u5c06\u5176\u4e2d\u7684\u504f\u79fb\u91cfoffset\u5b57\u6bb5\u4f5c\u4e3a\u4e00\u4e2alabel\uff0c\u5927\u6982\u5982\u4e0b\u6240\u793a\uff1a

    {\n\"message\": \"xxx\",\n\"timestamp\": \"\",\n\"logconfig\": \"foo\",\n\"podname\": \"bar\",\n\"offset\": 20,\n...\n}\n

    Loki\u4f1a\u5c06\u6240\u6709labels\u7684\u503c\u4f5c\u4e3a\u4e00\u4e2a\u552f\u4e00\u7684log stream\u6807\u8bc6\uff0c\u6bd4\u5982\u4e0a\u9762\u7684\u5185\u5bb9\u5c31\u4f1a\u5c06{logconfig: \"foo\", \"podname\":\"bar\", \"offset\": 20}\u4f5c\u4e3a\u4e00\u4e2alog stream\u3002\u7531\u4e8e\u5728\u540c\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0coffset\u4f1a\u968f\u7740\u91c7\u96c6\u7684\u6bcf\u884c\u65e5\u5fd7\u90fd\u5728\u589e\u52a0\uff0c\u56e0\u6b64\u4f1a\u5bfc\u81f4log stream\u4e2a\u6570\u65e0\u9650\u589e\u957f\uff0c\u5bf9Loki\u9020\u6210\u5de8\u5927\u7684\u538b\u529b\u3002

    \u4e3a\u4e86\u89c4\u907f\u8fd9\u7c7b\u95ee\u9898\uff0cVictoriaLogs\u8bbe\u8ba1\u4e0a\u5c31\u5c06stream label\u548c\u666e\u901alabel\u505a\u4e86\u533a\u5206\uff0c\u6bd4\u5982\u4ee5\u4e0a\u8fd9\u79cd\u573a\u666f\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5c06logconfig\u548cpodname\u4f5c\u4e3astream label\u5373\u53ef\uff0coffset\u5219\u4f5c\u4e3a\u666e\u901a\u7684label\u3002

    \u4e86\u89e3\u4e86stream label\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u66f4\u597d\u7684\u7406\u89e3\u4ee5\u4e0bVictoriaLogs\u4e2d\u7684\u6570\u636e\u683c\u5f0f\uff1a

    "},{"location":"blog/victorialogs/loggie_victorialogs/#loggievictorialogs_1","title":"\u771f\u5b9e\u4e16\u754c\uff1a\u4f7f\u7528Loggie\u91c7\u96c6\u65e5\u5fd7\u81f3VictoriaLogs\u4e2d","text":"

    \u4e0b\u9762\u6211\u4eec\u5f00\u59cb\u771f\u5b9e\u7684\u4f53\u9a8c\u4e00\u4e0b\u5982\u4f55\u4f7f\u7528Loggie\u548cVictoriaLogs\u5feb\u901f\u6784\u5efa\u4e00\u5957\u65e5\u5fd7\u7cfb\u7edf\u3002

    "},{"location":"blog/victorialogs/loggie_victorialogs/#1-victorialogs","title":"1. \u90e8\u7f72VictoriaLogs","text":"

    \u53ef\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a

    helm repo add vm https://victoriametrics.github.io/helm-charts/\nhelm repo update\n\nhelm install vlsingle vm/victoria-logs-single -nvictoria-logs --create-namespace\n

    \u66f4\u591a\u7684\u8be6\u60c5\u53ef\u53c2\u8003helm chart\u90e8\u7f72\u3002

    \u8fd9\u91cc\u6211\u4eec\u8bbe\u7f6e\u90e8\u7f72\u7684namespace\u4e3avictoria-logs\uff0c\u5982\u679c\u4fee\u6539\u4e86\u8be5namespace\u540d\u79f0\uff0c\u4e0b\u9762\u7684\u4e00\u4e9b\u914d\u7f6e\u4e5f\u8bf7\u540c\u6b65\u4fee\u6539\u3002

    "},{"location":"blog/victorialogs/loggie_victorialogs/#2-loggie","title":"2. \u90e8\u7f72Loggie","text":"

    \u5982\u679c\u4f60\u8fd8\u4e0d\u77e5\u9053Loggie\uff0c\u8bf7\u8fdb\u8fd9\u91cc\u3002

    \u4e3a\u4e86\u65b9\u4fbf\u8d77\u89c1\uff0c\u6211\u4eec\u5728Loggie catalog\u4e2d\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9002\u914dVictoriaLogs\u7684\u90e8\u7f72\u914d\u7f6e\u3002

    VERSION=v1.4.0\nhelm pull https://github.com/loggie-io/installation/releases/download/$VERSION/loggie-$VERSION.tgz && tar xvzf loggie-$VERSION.tgz\n# \u4ececatalog\u4e2d\u4e0b\u8f7d\u9002\u914dvictoriaLogs\u6240\u7528\u7684\u90e8\u7f72\u914d\u7f6evalues\u6587\u4ef6\nwget https://raw.githubusercontent.com/loggie-io/catalog/main/scenarios/victoriaLogs/values.yml\n# \u6307\u5b9a\u8be5values\u6587\u4ef6\u90e8\u7f72Loggie\nhelm install loggie ./loggie -nloggie --create-namespace -f values.yml\n
    "},{"location":"blog/victorialogs/loggie_victorialogs/#3","title":"3. \u751f\u6210\u548c\u91c7\u96c6\u65e5\u5fd7","text":"

    \u90e8\u7f72\u5b8c\u4e86VictoriaLogs\u548cLoggie\u540e\uff0c\u521b\u5efa\u4e00\u4e2a\u6d4b\u8bd5\u7528\u7684Deployment genfiles\u7528\u4e8e\u4ea7\u751f\u65e5\u5fd7\u3002

    wget https://raw.githubusercontent.com/loggie-io/catalog/main/common/genfiles/deployment.yml\nkubectl apply -f deployment.yml\n

    \u7136\u540e\u521b\u5efa\u4e00\u4e2a\u76f8\u5339\u914d\u7684\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\uff0c\u544a\u8bc9Loggie\u8981\u53bb\u91c7\u96c6\u8fd9\u4e2aDeployment\u5bb9\u5668\u4e2d\u7684\u65e5\u5fd7\u6587\u4ef6\uff1a

    wget https://raw.githubusercontent.com/loggie-io/catalog/main/scenarios/victoriaLogs/genfiles_logconfig.yml\nkubectl apply -f genfiles_logconfig.yml\n

    \u8fd9\u91cc\u6211\u4eec\u91cd\u70b9\u5173\u6ce8\u4e0bgenfiles_logconfig.yml\u4e2d\u7684sink\u90e8\u5206\u914d\u7f6e\uff1a

    sink: |\ntype: elasticsearch\nhosts: [ \"vlsingle-victoria-logs-single-server.victoria-logs.svc:9428/insert/elasticsearch/\" ]\nparameters:\n_msg_field: \"body\"\n_time_field: \"@timestamp\"\n_stream_fields: \"logconfig,namespace,podname,containername\"\n

    \u5728\u672c\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u5728sink\u7aef\u53d1\u9001\u7684\u65e5\u5fd7\u683c\u5f0f\u5927\u6982\u5982\u4e0b\u6240\u793a\uff1a

    {\n\"body\": \"2023-07-04 02:58:18.014 INF cmd/subcmd/genfiles/genfiles.go:57 > 1000 TqrccSCPzRUYRP PJ MlvgdAluEpIoRIRyzjZoNk\",\n\"containername\": \"genfiles\",\n\"namespace\": \"default\",\n\"podname\": \"genfiles-66f5c86fdb-tjpzr\",\n\"@timestamp\": \"2023-07-04T02:58:21.905Z\",\n\"offset\": 1092798,\n\"cluster\": \"test\",\n\"logconfig\": \"genfiles\",\n\"nodename\": \"kind-control-plane\",\n\"filename\": \"/var/lib/kubelet/pods/c7b2da94-b152-414e-a7d8-1951e9d4f09a/volumes/kubernetes.io~empty-dir/logs/loggie.log\"\n}\n

    \u53ef\u4ee5\u770b\u5230\uff0c\u8fd9\u91cc\u5c06log stream\u7684\u7c92\u5ea6\u5b9a\u4e3a\u4e86Pod\u5bb9\u5668\u7ea7\u522b\uff0c\u6240\u4ee5_stream_fields\u8bbe\u7f6e\u4e3a\u4e86cluster,logconfig,namespace,podname,containername\u3002

    \u73b0\u5728\u6211\u4eec\u6a21\u62df\u4ea7\u751f\u4e00\u70b9\u65e5\u5fd7\uff1a

    # \u8fdb\u5165\u5230genfiles\u5bb9\u5668\u4e2d\nkubectl exec -it $(kubectl get po -l app=genfiles -o jsonpath=\"{.items[0].metadata.name}\") bash\n\n# \u4ea7\u751f\u4e00\u70b9\u65e5\u5fd7\n./loggie genfiles -totalCount=1000 -lineBytes=1024 -qps=0 \\\n-log.maxBackups=1 -log.maxSize=1000 -log.directory=/tmp/log -log.noColor=true \\\n-log.enableStdout=false -log.enableFile=true -log.timeFormat=\"2006-01-02 15:04:05.000\"\n

    \u5173\u4e8eloggie\u751f\u6210\u65e5\u5fd7\u7684genfiles\u5b50\u547d\u4ee4\uff0c\u66f4\u591a\u7684\u4f7f\u7528\u65b9\u5f0f\u53ef\u4ee5\u53c2\u8003\u8fd9\u91cc\u3002

    \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0cLoggie\u4f1a\u5f88\u5feb\u91c7\u96c6\u8fd9\u4e9b\u65e5\u5fd7\uff0c\u7136\u540e\u53d1\u9001\u81f3VictoriaLogs\u3002

    \u5f53\u7136\u6211\u4eec\u4e5f\u53ef\u4ee5\u8fdb\u5165Loggie terminal\u63a7\u5236\u53f0\u786e\u8ba4\u4e00\u4e0b\u91c7\u96c6\u8fdb\u5ea6\uff1a

    kubectl -nloggie -it exec $(kubectl -nloggie get po -l app=loggie -o jsonpath=\"{.items[0].metadata.name}\") -- ./loggie inspect\n

    \u5982\u4e0a\u56fe\u6240\u793a\uff0c\u6587\u4ef6\u91c7\u96c6\u8fdb\u5ea6\u4e3a100%\uff0c\u8868\u793a\u5df2\u7ecf\u91c7\u96c6\u5b8c\u6bd5\uff0c\u5e76\u4e14\u53d1\u9001\u65e5\u5fd7\u5230\u4e86VictoriaLogs\u4e2d\u3002

    Loggie terminal\u5177\u4f53\u7684\u64cd\u4f5c\u65b9\u5f0f\uff0c\u4e5f\u53ef\u4ee5\u53c2\u8003\u6211\u4eec\u7684\u65e5\u5fd7\u91c7\u96c6\u5feb\u901f\u6392\u969c\u6307\u5357\u3002

    \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528VictoriaLogs\u5185\u7f6e\u7684UI\u67e5\u770b\u91c7\u96c6\u7684\u65e5\u5fd7\u4e86\u3002

    "},{"location":"blog/victorialogs/loggie_victorialogs/#logsql","title":"LogsQL\u548c\u65e5\u5fd7\u67e5\u8be2","text":"

    \u7531\u4e8e\u672c\u5730\u548cKubernetes\u96c6\u7fa4\u5185\u90e8\u7f51\u7edc\u4e0d\u901a\uff0c\u7b80\u5355\u8d77\u89c1\uff0c\u6211\u4eec\u76f4\u63a5port-forward\u4e00\u4e0b\uff1a

    export POD_NAME=$(kubectl get pods --namespace victoria-logs -l \"app=server\" -o jsonpath=\"{.items[0].metadata.name}\")\nkubectl --namespace victoria-logs port-forward $POD_NAME 9428\n

    \u7136\u540e\u672c\u5730\u8bbf\u95ee\u4ee5\u4e0b\u9875\u9762\uff1a[http://localhost:9428/select/vmui/](http://localhost:9428/select/vmui/)

    VictoriaLogs\u5f53\u524d\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u5355\u7684UI\u9875\u9762\uff0c\u53ef\u7528\u4e8e\u67e5\u8be2\u65e5\u5fd7\u3002\u4e3a\u4e86\u6f14\u793a\u5982\u4f55\u67e5\u8be2\u521a\u624d\u91c7\u96c6\u7684\u65e5\u5fd7\uff0c\u6211\u4eec\u5148\u5feb\u901f\u4e86\u89e3\u4e00\u4e0b\u67e5\u8be2\u8bed\u6cd5\u3002

    \u8003\u8651\u5230\u6700\u5927\u5316\u67e5\u8be2\u7684\u6027\u80fd\uff0c\u5efa\u8bae\u4e00\u822c\u5199LogsQL\u89c4\u8303\u6027\u5957\u8def\u4e3a\uff1a

    1. \u786e\u5b9alog stream

    _stream\u8fd9\u91cc\u7684\u8fc7\u6ee4\u5b57\u6bb5\uff0c\u5c31\u662f\u521a\u624d\u5728sink\u4e0aparameters._stream_fields\u914d\u7f6e\u7684\uff0c\u6bd4\u5982\u67e5\u8be2\u54ea\u4e2a\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\uff0c\u54ea\u4e2aPod\u7b49\u3002\u793a\u4f8b\u4e2d\u6211\u4eec\u6839\u636elog stream\u4e2d\u7684logconfig label\u67e5\u8be2\u4e86\u521a\u624d\u521b\u5efa\u7684\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\u4e0b\u7684\u6240\u6709\u65e5\u5fd7\uff0cLogsQL\u5982\u4e0b\uff1a

    _stream:{logconfig=genfiles}

    \u5982\u679clogconfig\u5339\u914d\u4e86\u5f88\u591a\u7684Pod\uff0c\u8fd9\u91cc\u8fd8\u53ef\u4ee5\u52a0\u4e0a\u5bf9\u5e94\u7684podname\u7b49\u5b57\u6bb5\u6765\u8fdb\u4e00\u6b65\u8fc7\u6ee4\u3002\u6bd4\u5982\uff1a_stream:{logconfig=genfiles, podname=\"genfiles-66f5c86fdb-mrfzc\"}\u3002

    2. \u52a0\u4e0a\u65f6\u95f4\u533a\u95f4

    \u63a5\u7740\u6211\u4eec\u8fd8\u53ef\u4ee5\u589e\u52a0\u65f6\u95f4\u533a\u95f4\uff0c\u8fdb\u4e00\u6b65\u7f29\u51cf\u8fd4\u56de\u7684\u65e5\u5fd7\u6761\u6570\u3002

    LogsQL: _stream:{logconfig=genfiles} _time:[now-1h,now]

    \u8bf7\u6ce8\u610f\uff0c\u8fd9\u91cc\u901a\u8fc7\u7a7a\u683c\u6765\u95f4\u9694\uff0c\u53e6\u5916_stream\u548c_time\u4e3a\u5185\u7f6e\u7684\u5b57\u6bb5\uff0c\u65e0\u5148\u540e\u987a\u5e8f\u533a\u5206\u3002

    3. \u8fdb\u4e00\u6b65\u7684\u8fc7\u6ee4

    \u4e0a\u9762\u6211\u4eec\u8ba9Victoria\u5148\u5feb\u901f\u786e\u5b9a\u4e00\u4e2alog stream\u7684\u65e5\u5fd7\u8303\u56f4\uff0c\u7136\u540e\u5728\u6b64\u57fa\u7840\u4e0a\uff0c\u8fdb\u884c\u5173\u952e\u5b57\u5339\u914d\uff0c\u5b57\u6bb5\u8fc7\u6ee4\u7b49\u5176\u4ed6\u590d\u6742\u7684\u65e5\u5fd7\u68c0\u7d22\u3002

    \u6bd4\u5982\uff1a

    \u2026

    LogsQL\u7684\u529f\u80fd\u8fd8\u662f\u6bd4\u8f83\u591a\u7684\uff0c\u66f4\u8be6\u7ec6\u7684LogsQL\u4f7f\u7528\u59ff\u52bf\uff0c\u53ef\u4ee5\u53c2\u8003\u5b98\u65b9\u6587\u6863\u3002

    "},{"location":"blog/victorialogs/loggie_victorialogs/#_2","title":"\u603b\u7ed3","text":"

    \u867d\u7136VictoriaLogs\u53ea\u53d1\u5e03\u4e86\u4e00\u4e2a\u9884\u89c8\u7248\uff0c\u4f46\u662f\u4ece\u5f53\u524d\u7684\u8bbe\u8ba1\u548c\u4f53\u9a8c\u6765\u770b\uff0c\u8fd8\u662f\u8981\u4f18\u4e8eLoki\u7684\uff0c\u6bd5\u7adf\u7ad9\u5728\u4e86Loki\u7684\u80a9\u8180\u4e0a\uff0c\u6709\u540e\u53d1\u4f18\u52bf\u3002

    \u4f46\u662f\u8f6f\u4ef6\u8bbe\u8ba1\u6ca1\u6709\u94f6\u5f39\uff0c\u771f\u5b9e\u7684\u4e16\u754c\u91cc\uff0c\u662f\u5426\u9009\u62e9\u4f7f\u7528\u67d0\u4e2a\u9879\u76ee\uff0c\u6700\u91cd\u8981\u7684\u8fd8\u662f\u9002\u4e0d\u9002\u5408\uff0c\u800c\u4e0d\u5728\u4e0e\u9879\u76ee\u672c\u8eab\u529f\u80fd\u662f\u5426\u5f3a\u5927\u3002

    \u53ef\u4ee5\u9884\u6599\u5230\u7684\u662f\uff0c\u5728\u5f88\u957f\u7684\u4e00\u6bb5\u65f6\u95f4\u5185\uff0cElasticsearch\u8fd9\u4e9b\u8001\u724c\u4eec\u8fd8\u662f\u4f1a\u5360\u636e\u5927\u90e8\u5206\u7684\u5e02\u573a\uff0c\u56e0\u4e3a\u5728\u4f01\u4e1a\u4e2d\uff0c\u5f88\u591a\u90fd\u6709\u5df2\u7ecf\u957f\u671f\u7a33\u5b9a\u8fd0\u884c\u7684Elasticsearch\u6216\u8005Clickhouse\uff0c\u540c\u65f6\u8fd8\u6709\u76f8\u5e94\u7684\u8fd0\u7ef4\u4eba\u5458\u548c\u914d\u5957\u652f\u6491\u3002

    \u90a3\u4ec0\u4e48\u60c5\u51b5\u9002\u5408VictoriaLogs\u5462\uff1f

    \u5982\u679c\u4f60\u4eec\u6b63\u5728\u4ece\u5934\u5f00\u59cb\u642d\u5efa\u81ea\u5df1\u7684\u65e5\u5fd7\u7cfb\u7edf\uff0c\u613f\u610f\u63a5\u53d7\u65b0\u4e8b\u7269\u7684\u6f5c\u5728\u98ce\u9669\uff0c\u5bf9VictoriaLogs\u7684\u672a\u6765\u5145\u6ee1\u4fe1\u5fc3\uff0c\u90a3\u4e48\u8fd8\u662f\u503c\u5f97\u4e00\u8bd5\u7684\u3002

    \u6b63\u662f\u7531\u4e8eVictoriaLogs\u8fd9\u4e9b\u65b0\u661f\u4eec\u8fdb\u573a\uff0c\u8ba9\u65e5\u5fd7\u9886\u57df\u66f4\u52a0\u5185\u5377\u7684\u540c\u65f6\uff0c\u4e5f\u8ba9\u5e7f\u5927\u7684\u4eba\u6c11\u7fa4\u4f17\u53d7\u76ca\u3002\u6bd5\u7adf\u6211\u4eec\u591a\u4e86\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\uff0c\u56fd\u5185\u7684\u300c\u5f00\u6e90\u5b9a\u5236\u5316\u5f00\u53d1\u300d\u5e02\u573a\u53c8\u6709\u66f4\u591a\u7684\u6d3b\u53ef\u4ee5\u5e72\u4e86\u3002

    \u5982\u679c\u4f60\u6709\u66f4\u591a\u5173\u4e8eVictoriaLogs\u7684\u60f3\u6cd5\u53ef\u4ee5\u4ea4\u6d41\uff0c\u6b22\u8fce\u626b\u7801\uff0c\u52a0\u5165Loggie\u4ea4\u6d41\u7fa4\uff0c\u8ba8\u8bba\u6240\u6709\u548c\u65e5\u5fd7\u76f8\u5173\u7684\u6280\u672f\u3002

    "},{"location":"developer-guide/build/","title":"\u7f16\u8bd1\u6784\u5efa","text":""},{"location":"developer-guide/build/#_2","title":"\u6301\u4e45\u5316\u5f15\u64ce\u9009\u62e9","text":"

    Loggie\u5728v1.5\u53ca\u4e4b\u540e\u7248\u672c\uff0c\u63d0\u4f9b\u4e86\u9664sqlite\u5916\u7684badger\u5f15\u64ce\u3002

    sqlite\u548cbadger\u4e24\u79cd\u6301\u4e45\u5316\u5f15\u64ce\u914d\u7f6e\uff0c\u8bf7\u53c2\u8003\u8fd9\u91cc\u3002

    \u4e3a\u4ec0\u4e48\u5f15\u5165badger\u5f15\u64ce\uff1f\u4f7f\u7528sqlite\u548cCGO\u7684\u95ee\u9898\u6709\uff1a

    "},{"location":"developer-guide/build/#_3","title":"\u5bb9\u5668\u955c\u50cf\u6784\u5efa","text":"

    \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cLoggie\u7684\u4f1a\u7ed9\u6240\u6709\u7684release\u5206\u652f\u548cmain\u5206\u652f\u6784\u5efa\u955c\u50cf\uff0c\u5e76\u63a8\u9001\u5230dockerhub\u4e0a\u3002\u4f46\u662f\u4ecedockerhub\u4e0a\u62c9\u955c\u50cf\u53ef\u80fd\u5b58\u5728\u88ab\u9650\u6d41\u7b49\u95ee\u9898\uff0c\u6240\u4ee5\u63a8\u8350\u5927\u5bb6\u81ea\u884c\u6784\u5efa\u955c\u50cf\uff0c\u6216\u8005\u91cd\u65b0\u63a8\u9001\u5230\u81ea\u5df1\u7684\u955c\u50cf\u4ed3\u5e93\u4e2d\u3002

    Loggie\u9879\u76ee\u4e0b\u63d0\u4f9b\u4e86\u4e24\u4e2aDockerfile:

    \u9664\u4e86\u4f7f\u7528docker build\u5916\uff0c\u8fd8\u53ef\u4f7f\u7528make\u6765\u6784\u5efa\uff1a

    make docker-build REPO=<YourRepoHost>/loggie TAG=v1.x.x\nmake docker-push REPO=<YourRepoHost>/loggie TAG=v1.x.x\n
    \u6216\u8005\u76f4\u63a5\u6784\u5efa\u548c\u63a8\u9001\u591a\u67b6\u6784\u955c\u50cf\uff1a
    make docker-multi-arch REPO=<YourRepoHost>/loggie TAG=v1.x.x\n

    \u6ce8\uff1a

    \u591a\u67b6\u6784

    Loggie\u9879\u76ee\u4e2d\u7684Dockerfile\u5747\u652f\u6301\u591a\u67b6\u6784\u7684\u6784\u5efa\u3002dockerhub\u4e0a\u7684Loggie\u955c\u50cf\u4e3aamd64\u548carm64\u7684\u591a\u67b6\u6784\uff0c\u62c9\u53d6\u65f6\u4f1a\u81ea\u52a8\u8bc6\u522b\u672c\u5730\u67b6\u6784\u3002

    \u4e0d\u8fc7\u5982\u679c\u4f60\u5e0c\u671b\u4fee\u6539tag\u5e76\u91cd\u65b0\u63a8\u5230\u81ea\u5df1\u7684\u4ed3\u5e93\uff0c\u8bf7\u52ff\u76f4\u63a5docker pull & docker tag & docker push\uff0c\u8fd9\u4f1a\u53eapush\u4f60\u672c\u5730\u67b6\u6784\u7684\u955c\u50cf\uff0c\u5bfc\u81f4\u4ed3\u5e93\u4e2d\u7684\u955c\u50cf\u591a\u67b6\u6784\u5931\u6548\u3002 \u5982\u679c\u5e0c\u671b\u63a8\u9001\u591a\u67b6\u6784\u955c\u50cf\u5230\u81ea\u5df1\u7684\u4ed3\u5e93\uff0c\u53ef\u4f7f\u7528\u5176\u4ed6\u7684\u4e00\u4e9b\u5f00\u6e90\u5de5\u5177\uff0c\u6bd4\u5982regctl\uff0c\u53ef\u5728\u672c\u5730\u4f7f\u7528\u7c7b\u4f3cregctl image copy loggieio/loggie:xxx <YourRepoImage>\u7684\u547d\u4ee4\u6765\u63a8\u9001\u3002

    \u5982\u679c\u63a5\u5165\u81ea\u5df1\u7684\u6784\u5efa\u6d41\u7a0b\u6216\u8005\u5de5\u5177\uff0c\u591a\u67b6\u6784\u955c\u50cf\u8bf7\u4f7f\u7528make docker-multi-arch\u6216\u8005docker buildx\u6784\u5efa\u3002

    "},{"location":"developer-guide/build/#_4","title":"\u4e8c\u8fdb\u5236\u6784\u5efa","text":"

    \u4e8c\u8fdb\u5236\u53ef\u7528\u4e8e\u5728\u4e3b\u673a\u90e8\u7f72\u7684\u573a\u666f\u3002

    \u5982\u679c\u9700\u8981\u4ea4\u53c9\u7f16\u8bd1\uff0c\u8bf7\u52a0\u4e0aGOOS\u548cGOARCH\u3002

    \u5982\u679c\u672c\u5730\u4f7f\u7528make build\u6784\u5efa\u5931\u8d25\uff0c\u53ef\u4fee\u6539makefile\u4e2d\u7684extra_flags\u989d\u5916\u6784\u5efa\u53c2\u6570\uff0c\u8bf7\u5c1d\u8bd5\u5c06\u5176\u4e2d\u7684-extldflags \"-static\"\u53bb\u9664\u3002

    "},{"location":"developer-guide/contributing/","title":"\u4ee3\u7801\u8d21\u732e","text":"

    Note

    \u5982\u679c\u4f60\uff1a

    \u5efa\u8bae\u5148\u63d0Issues\uff0c\u63cf\u8ff0\u4f60\u7684\u76ee\u7684\u6216\u8005\u95ee\u9898\u3002

    "},{"location":"developer-guide/contributing/#_2","title":"\u4ee3\u7801/\u6587\u6863\u8d21\u732e\u6d41\u7a0b","text":""},{"location":"developer-guide/contributing/#1","title":"1. \u521b\u5efa\u672c\u5730\u5de5\u7a0b","text":""},{"location":"developer-guide/contributing/#fork","title":"fork\u4ee3\u7801","text":"

    \u8bbf\u95eehttps://github.com/loggie-io/loggie\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684Fork\uff0cfork\u5230\u81ea\u5df1\u7684github\u4ed3\u5e93\u4e2d\u3002

    "},{"location":"developer-guide/contributing/#clone","title":"clone\u5230\u672c\u5730","text":"

    \u5c06fork\u540e\u7684\u5de5\u7a0bclone\u5230\u672c\u5730\uff1a

    cd ${go-workspace}\n\ngit clone git@github.com:${yourAccountId}/loggie.git\n

    "},{"location":"developer-guide/contributing/#2","title":"2. \u672c\u5730\u5f00\u53d1","text":""},{"location":"developer-guide/contributing/#add-upstream","title":"add upstream","text":"

    \u5728\u672c\u5730\u5de5\u7a0b\u4e2d\uff0c\u6dfb\u52a0upstream remote\uff1a

    git remote add upstream https://github.com/loggie-io/loggie.git\ngit remote set-url --push upstream no_push\n

    \u53ef\u4ee5\u4f7f\u7528git remote -v\u67e5\u770b\uff0corigin\u4e3a\u4f60\u4e2a\u4eba\u8d26\u53f7fork\u7684git\u5730\u5740\uff0cupstream\u4e3aLoggie\u5b98\u65b9\u4ed3\u5e93\u5730\u5740\uff0cuptream\u4ec5\u4e3a\u672c\u5730\u540c\u6b65\u4ee3\u7801\u4f7f\u7528\uff0c\u6b63\u5e38\u65e0push\u6743\u9650\u3002

    "},{"location":"developer-guide/contributing/#create-branch","title":"create branch","text":"

    \u57fa\u4e8e\u6700\u65b0\u7684main\u5206\u652f\uff0c\u521b\u5efa\u51fa\u4f60\u7684\u5206\u652f\uff0c\u901a\u5e38\u4ee5feat/fix/chore\u7b49\u5f00\u5934\u3002

    git checkout -b feat-mywork\n

    \u5728\u8be5\u5206\u652f\u5f00\u53d1\u5b8c\u540e\uff0c\u5f85\u63d0\u4ea4\u524d\uff0c\u5efa\u8bae\u4fdd\u6301\u4ee3\u7801\u548c\u4e0a\u6e38\u4e00\u81f4\uff1a

    git pull upstream -r\n
    "},{"location":"developer-guide/contributing/#_3","title":"\u63d0\u4ea4\u4ee3\u7801","text":"
    git commit\n\ngit push origin feat-mywork\n

    Commit\u89c4\u8303

    \u901a\u5e38\u6211\u4eec\u4f7f\u7528<type>(<scope>): <subject>\u7684\u5f62\u5f0f\uff1a

    <type>:\uff08\u5fc5\u987b\uff09

    <scope>:\uff08\u53ef\u9009\uff09

    <subject>: \uff08\u5fc5\u987b\uff09\u5373commit\u7684\u5185\u5bb9\u63cf\u8ff0

    "},{"location":"developer-guide/contributing/#3-pr","title":"3. \u521b\u5efaPR","text":""},{"location":"developer-guide/contributing/#github","title":"\u63d0\u4ea4\u81f3Github","text":"

    \u8bbf\u95ee\u4f60\u7684\u4e2a\u4ebagithub\u8d26\u53f7\u91ccfork\u7684Loggie\u9879\u76ee\uff0c\u5e76Open pull request\u3002 \u5c3d\u91cf\u63cf\u8ff0\u6e05\u695aPR\u7684\u80cc\u666f\u3001\u76ee\u7684\u548c\u6539\u52a8\u70b9\u3002 \u5982\u679c\u6709\u76f8\u5173Issues\uff0c\u9700\u5173\u8054\u3002

    \u63d0\u4ea4\u524d\u8bf7\u68c0\u67e5\uff1a

    "},{"location":"developer-guide/contributing/#merge","title":"\u5bfb\u6c42Merge","text":"

    \u4f60\u53ef\u4ee5\u5728OWNERS\u627e\u4eba\uff0c\u6216\u8005\u9ed8\u8ba4\u6dfb\u52a0loggie-robot\u8d26\u53f7\u4f5c\u4e3a\u4f60PR\u7684Reviewers\u6216Assigneees\u3002

    "},{"location":"developer-guide/development/","title":"\u672c\u5730\u5f00\u53d1","text":"

    \u672c\u6587\u4ecb\u7ecd\u5982\u4f55\u5728\u672c\u5730\u5f00\u53d1\u548c\u8c03\u8bd5Loggie\u5de5\u7a0b\u3002

    "},{"location":"developer-guide/development/#_2","title":"\u672c\u5730\u5de5\u7a0b","text":""},{"location":"developer-guide/development/#golang","title":"golang\u5f00\u53d1\u73af\u5883","text":"

    Loggie\u4f7f\u7528Golang\u7f16\u5199\uff0c\u8bf7\u786e\u4fdd\u672c\u5730\u6709Golang\u5f00\u53d1\u73af\u5883\u3002

    go version\n
    "},{"location":"developer-guide/development/#_3","title":"\u4ee3\u7801\u5de5\u7a0b","text":"

    \u8bf7\u4f7f\u7528\u81ea\u5df1\u7684github\u8d26\u53f7fork Loggie\u5de5\u7a0b\u3002\u7136\u540egit clone\u5230\u672c\u5730\u3002

    git clone git@github.com:<Account>/loggie.git\n
    "},{"location":"developer-guide/development/#_4","title":"\u672c\u5730\u73af\u5883","text":"

    \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u672c\u5730\u65e0\u7279\u6b8a\u4f9d\u8d56\u3002

    \u9488\u5bf9\u4e0d\u540c\u7684\u529f\u80fd\u573a\u666f\uff0c\u9700\u8981\u6839\u636e\u5177\u4f53\u60c5\u51b5\u5b89\u88c5\u6216\u8005\u4f7f\u7528\u5916\u90e8\u7684\u4f9d\u8d56\u3002

    \u5efa\u8bae\u672c\u5730\u8fd0\u884cKubernetes\u8fdb\u884c\u90e8\u7f72\u548c\u7ba1\u7406\u3002

    "},{"location":"developer-guide/development/#kubernetes","title":"Kubernetes","text":"

    \u642d\u5efaKubernetes

    \u63a8\u8350\u4f7f\u7528Kind\u3002

    \u90e8\u7f72\u4f9d\u8d56\u7ec4\u4ef6

    \u63a8\u8350\u4f7f\u7528Helm\u6765\u90e8\u7f72\u3002\u76f8\u5173\u7684\u7ec4\u4ef6\u53ef\u4f7f\u7528\u516c\u5f00\u7684Helm\u4ed3\u5e93\u6765\u6dfb\u52a0\u548c\u90e8\u7f72\u3002

    \u672c\u5730Loggie\u8fde\u63a5Kubernetes

    \u5982\u679c\u9700\u8981\u4f7f\u7528LogConfig\u7b49CRD\uff0c\u6216\u8005\u8c03\u8bd5Kubernetes\u4e0b\u7684\u4f7f\u7528\u65b9\u5f0f\uff0c\u9700\u8981\u5728\u7cfb\u7edf\u914d\u7f6e\u4e2d\uff0cenable Kubernetes Discovery\u3002

    loggie.yml

      discovery:\nenabled: true\nkubernetes:\nkubeconfig: ${home}/.kube/config\n

    \u6307\u5b9akubeconfig\u8fde\u63a5\u672c\u5730\u7684Kubernetes APIServer\u3002

    \u53e6\u5916\uff0cAgent\u5f62\u6001\u7684Loggie\uff0c\u4f1a\u53ea\u76d1\u542c\u672c\u8282\u70b9\u7684Kubernetes Pod\u4e8b\u4ef6\uff0c\u9700\u8981\u5728Loggie\u542f\u52a8\u53c2\u6570\u4e2d\u6dfb\u52a0-meta.nodeName\u6765\u6a21\u62df\u6240\u5728\u7684\u8282\u70b9\u3002

    \u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528kubectl get node\u67e5\u770b\u6240\u6709\u8282\u70b9\u540d\u79f0\uff1a

    NAME                 STATUS   ROLES    AGE     VERSION\nkind-control-plane   Ready    master   2y50d   v1.21.0\n
    \u7136\u540e\u542f\u52a8\u53c2\u6570\u589e\u52a0-meta.nodeName=kind-control-plane\uff0c\u53ef\u4ee5\u4f7fLoggie\u542f\u52a8\u540e\u88ab\u8ba4\u4e3a\u90e8\u7f72\u5728\u8be5\u8282\u70b9\u3002

    "},{"location":"developer-guide/development/#_5","title":"\u9a8c\u8bc1\u4e0e\u8c03\u8bd5","text":"

    Loggie\u9ed8\u8ba4\u542f\u52a8\u540e\uff0c\u8f93\u51fa\u7684\u65e5\u5fd7\u683c\u5f0f\u4e3aJSON\uff0c\u5982\u679c\u4f60\u4e0d\u4e60\u60ef\uff0c\u53ef\u5728\u542f\u52a8\u53c2\u6570\u4e2d\u6dfb\u52a0-log.jsonFormat=false\u6765\u5173\u95ed\u3002

    \u672c\u5730\u5c3d\u91cf\u4f7f\u7528\u6a21\u62df\u7684\u65b9\u5f0f\uff0c\u5408\u7406\u5229\u7528dev source\u548cdev sink\u3002\u6bd4\u5982\uff1a

    \u793a\u4f8b\uff1a\u5728pipelines\u4e2d\uff0c\u4f7f\u7528dev sink\uff0c\u67e5\u770b\u6700\u7ec8\u8f93\u51fa\u53d1\u9001\u81f3\u4e0b\u6e38\u7684\u6570\u636e\u3002

    pipelines.yml

        sink:\ntype: \"dev\"\nprintEvents: true\ncodec:\npretty: true\n
    "},{"location":"developer-guide/release/","title":"\u7248\u672c\u548cRelease\u53d1\u5e03\u6d41\u7a0b","text":""},{"location":"developer-guide/release/#_1","title":"\u7248\u672c\u53d1\u5e03\u6d89\u53ca\u5de5\u7a0b","text":""},{"location":"developer-guide/release/#_2","title":"\u4ee3\u7801\u5206\u652f\u7b56\u7565","text":""},{"location":"developer-guide/release/#_3","title":"\u53d1\u5e03\u65b0\u7248\u672c\u6b65\u9aa4","text":""},{"location":"developer-guide/release/#1-release","title":"1. \u521b\u5efa\u65b0\u7684release\u5206\u652f","text":"

    \u786e\u8ba4\u7248\u672c\u9700\u8981\u7684\u6240\u6709\u529f\u80fd\u5df2\u7ecf\u5408\u5165\uff0cmain\u5206\u652f\u4e3a\u6700\u65b0\u63d0\u4ea4\uff1a

    git checkout main\ngit pull upstream main -r\n

    \u57fa\u4e8emain\u5206\u652f\u521b\u5efa\u65b0\u7684release\u5206\u652f\uff0c\u4f8b\u5982release-v1.1\uff1a

    git checkout -b release-v${A.B}\n

    "},{"location":"developer-guide/release/#2-changelog","title":"2. \u586b\u5199CHANGELOG","text":"

    \u57fa\u4e8e\u8be5\u5206\u652f\u586b\u5199CHANGELOG\uff0c\u63d0\u4ea4\u81f3\u5de5\u7a0b\u4e2d\u5408\u5165

    git add .\ngit commit -m'Release: add v${A.B.C} changelog'\ngit push upstream release-v${A.B.C}\n
    "},{"location":"developer-guide/release/#3-release-loggie-installation","title":"3. release Loggie-installation","text":"

    release Loggie-installationation\u90e8\u7f72\u811a\u672c\u5de5\u7a0b\uff0c\u548c\u4e0a\u8ff01\uff0c2\u6b65\u9aa4\u76f8\u540c

    \u8bf7\u6ce8\u610f\uff1a

    "},{"location":"developer-guide/release/#4","title":"4. \u56de\u5f52\u6d4b\u8bd5","text":"

    \u57fa\u4e8erelease\u5206\u652f\u8fdb\u884c\u56de\u5f52\u6d4b\u8bd5\u3002 release\u5206\u652fpush\u81f3Github\u540e\uff0c\u4f1a\u89e6\u53d1action\u8fdb\u884c\u955c\u50cf\u6784\u5efa\uff0c\u4f7f\u7528\u8be5\u955c\u50cf\u8fdb\u884c\u56de\u5f52\u6d4b\u8bd5\u3002 \u8fd9\u91cc\u7684\u6d4b\u8bd5\u4f1a\u4f7f\u7528loggie-installationation\u90e8\u7f72\u811a\u672c\u91cc\u76f8\u5e94\u7684release\u5206\u652f\uff0c\u540c\u65f6\u56de\u5f52\u9a8c\u8bc1\u90e8\u7f72\u811a\u672c\u6b63\u786e\u6027\u3002 \u5982\u679c\u6d4b\u8bd5\u53d1\u73b0Bug\uff0c\u63d0\u4ea4PR\u5408\u5165release\u5206\u652f\uff0c\u91cd\u65b0\u8fdb\u884c\u56de\u5f52\u3002

    "},{"location":"developer-guide/release/#5-tag","title":"5. \u6253\u4e0a\u7248\u672ctag","text":"

    \u6d4b\u8bd5\u901a\u8fc7\u540e\uff0c\u57fa\u4e8e\u8be5release\u5206\u652f\u6253\u4e0a\u76f8\u5e94\u7684\u7248\u672ctag\uff0c\u6bd4\u5982v1.1.0

    git pull upstream release-v${A.B.C}\ngit tag v${A.B.C}\ngit push v${A.B.C}\n
    \u6ce8\u610fLoggie\u5de5\u7a0b\u548cLoggie-installationation\u90e8\u7f72\u811a\u672c\u5747\u9700\u8981\u3002

    "},{"location":"developer-guide/release/#6-githubrelease","title":"6. \u5728Github\u4e0a\u53d1\u5e03release","text":""},{"location":"developer-guide/release/#7-loggie-docs","title":"7. \u66f4\u65b0Loggie docs\u6587\u6863","text":""},{"location":"developer-guide/release/#8-releasemain","title":"8. \u5c06release\u5206\u652f\u5408\u5165main","text":"

    \u63d0PR\u5c06release\u5206\u652f\u5408\u5165main\uff0c\u53ef\u7b49\u7a33\u5b9a\u4e00\u6bb5\u65f6\u95f4\u540e\u518d\u5408\u5165\uff0c\u6ce8\u610fLoggie\u5de5\u7a0b\u548cLoggie-installation\u90e8\u7f72\u811a\u672c\u5747\u9700\u8981\u3002

    "},{"location":"developer-guide/release/#bugfix","title":"\u6709BugFix","text":""},{"location":"developer-guide/code/coding-guide/","title":"\u4ee3\u7801\u89c4\u8303","text":""},{"location":"developer-guide/code/coding-guide/#_2","title":"\u5f00\u53d1\u89c4\u5219","text":""},{"location":"developer-guide/code/coding-guide/#golang","title":"\u901a\u7528Golang\u89c4\u8303","text":"

    \u53c2\u8003\uff1a

    "},{"location":"developer-guide/code/coding-guide/#loggie","title":"Loggie\u7684\u89c4\u8303","text":"
    1. \u804c\u8d23\u5355\u4e00\u539f\u5219\uff0c\u4e00\u4e2acomponent\u53ea\u505a\u4e00\u4ef6\u4e8b\uff0c\u4e14\u505a\u597d\u4e00\u4ef6\u4e8b
    2. \u542f\u52a8\u4efb\u4f55\u4e00\u4e2agoroutine\u90fd\u8981\u5148\u60f3\u597d\u5982\u4f55\u9000\u51fa\uff0c\u4ee5\u53ca\u7f16\u7801\u9000\u51fa\u903b\u8f91
    3. return err\u7684\u65f6\u5019\u60f3\u60f3\u662f\u5426\u9700\u8981\u6e05\u7406\u672c\u65e0\u9700\u542f\u52a8\u7684goroutine
    4. \u6c38\u8fdc\u8bb0\u4f4fgo\u4e2d\u7684\u64cd\u4f5c\u90fd\u4e0d\u4fdd\u8bc1\u539f\u5b50\u6027\uff08\u4f8b\u5982\u5b57\u7b26\u4e32\u62fc\u63a5\uff09\uff0c\u9664\u4e86chan\u3001sync\u5305\u7b49
    5. for\uff08for each\uff09\u5faa\u73af\u7684\u65f6\u5019\uff0c\u6ce8\u610f\u51fd\u6570\u53d8\u91cf\u662f\u5171\u4eab\u76f8\u540c\u7684\u5730\u5740
    6. \u51cf\u5c11\u4f7f\u7528\u5168\u5c40\u7684done chan\uff08\u5927\u91cfgoroutine\u8f6e\u8be2\u540c\u4e00\u4e2adone chan\u6027\u80fd\u4f1a\u6025\u5267\u4e0b\u964d\uff09\u3002 \u66f4\u5efa\u8bae\u4f7f\u7528\u7ec4\u4ef6struct\u72ec\u7acb\u7684done chan\u548c\u63d0\u4f9bStop()\u65b9\u6cd5\u6765\u4f9b\u4e0a\u5c42\u8c03\u7528\u6765\u5173\u95ed\u4ee5\u907f\u514dgoroutine\u6cc4\u9732
    7. Component\u60f3\u597d\u5982\u4f55\u5408\u7406\u4f18\u96c5Stop\uff08\u7279\u522b\u662f\u4e0d\u8981\u53d1\u751fpanic\u5bfc\u81f4\u6574\u4e2a\u8fdb\u7a0b\u6302\u6389\uff09
    8. \u4e0d\u8981\u5173\u95ed(close)\u4e00\u4e2a\u7528\u4e8e\u8bfb\u5199\u7684chan\u6765\u8fbe\u5230\u9000\u51fagoroutine\u6216\u8005\u505c\u6b62Component\u7684\u76ee\u6807\uff0c\u53ef\u80fd\u5728close chan\u540e\u8fd8\u6709\u5199\u64cd\u4f5c\u4f1a\u9020\u6210panic\u3002 \u4f7f\u7528\u4e00\u4e2a\u5355\u72ec\u7684done chan\u6765\u6807\u793a\u662f\u5426\u9000\u51fa
    9. \u5173\u95ed(Stop)Component\u7684\u65f6\u5019\u6ce8\u610f\u5173\u95ed\u7684\u987a\u5e8f\u548c\u8d44\u6e90\u91ca\u653e\uff0c \u4e0d\u8981\u9020\u6210\u5176\u4ed6goroutine\u592f\u4f4f(\u4f8b\u5982\u4f9b\u5916\u90e8\u5199\u76840\u5bb9\u91cf\u7684chan\u6ca1\u6709\u5904\u7406\uff0c\u4f46\u662f\u8bfb\u7684goroutine\u9000\u51fa\u4e86\uff0c\u5bfc\u81f4\u5916\u90e8\u5199\u7684goroutine\u4e00\u76f4\u963b\u585e)
    10. \u5c06chan\u7684\u751f\u547d\u5468\u671f\u5c01\u88c5\u5728chan\u6240\u6709\u8005\u5185\u90e8
    11. \u4f7f\u7528done chan\u9000\u51fagoroutine\u7684\u65f6\u5019\uff0c\u4e0d\u8981\u505a\u4efb\u4f55\u6e05\u7406\u8d44\u6e90\u7684\u64cd\u4f5c\u3002\u6e05\u7406\u8d44\u6e90\u4f18\u5148\u4f7f\u7528defer\uff0c\u56e0\u4e3a\u5f53goroutine panic\u7684\u65f6\u5019\uff0c defer\u8fd8\u80fd\u591f\u6e05\u7406\u8d44\u6e90\uff0c\u800cdone chan\u4e2d\u7684\u6e05\u7406\u903b\u8f91\u53ef\u80fd\u6c38\u8fdc\u4e0d\u4f1a\u88ab\u6267\u884c
    12. \u4e0d\u5141\u8bb8\u4f7f\u7528time.after()\u3002\u4f7f\u7528time.NewTicker()\u4ee3\u66ff\uff0c\u5e76\u53ca\u65f6\u6e05\u7406ticker
    "},{"location":"developer-guide/code/coding-guide/#_3","title":"\u65e5\u5fd7","text":""},{"location":"developer-guide/code/coding-guide/#_4","title":"\u65e5\u5fd7\u7ea7\u522b","text":"

    PANIC\u548cFATAL\u533a\u522b

    PANIC\u6700\u7ec8\u8c03\u7528\u7684\u662fpanic(msg)

    FATAL\u6700\u7ec8\u8c03\u7528\u7684\u662fos.Exit(1)

    "},{"location":"developer-guide/code/coding-guide/#_5","title":"\u76d1\u63a7","text":""},{"location":"developer-guide/code/coding-guide/#_6","title":"\u5355\u5143\u6d4b\u8bd5","text":""},{"location":"developer-guide/code/coding-guide/#_7","title":"\u4ee3\u7801\u98ce\u683c","text":""},{"location":"developer-guide/code/coding-guide/#_8","title":"\u5411\u540e\u517c\u5bb9","text":""},{"location":"developer-guide/code/coding-guide/#copyright-profile","title":"Copyright profile","text":"

    Copyright-text

    /*\nCopyright 2022 Loggie Authors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n
    "},{"location":"developer-guide/component/component-guide/","title":"\u7ec4\u4ef6\u5f00\u53d1","text":"

    \u63a8\u8350\u53c2\u8003\u5df2\u6709\u7684\u7ec4\u4ef6\u5f00\u53d1\u4e00\u4e2a\u65b0\u7684\u7ec4\u4ef6

    "},{"location":"developer-guide/component/component-guide/#_1","title":"\u516c\u5171\u63a5\u53e3","text":"
    // \u751f\u547d\u5468\u671f\u63a5\u53e3\ntype Lifecycle interface {\n// \u521d\u59cb\u5316\uff0c\u4f8b\u5982\u521d\u59cb\u5316Kafka\u8fde\u63a5\nInit(context Context)\n// \u542f\u52a8\u8fd0\u884c\uff0c\u4f8b\u5982\u5f00\u59cb\u6d88\u8d39Kafka\nStart()\n// \u505c\u6b62\nStop()\n}\n\n// \u63cf\u8ff0\u63a5\u53e3\ntype Describable interface {\n// \u7c7b\u522b\uff0c\u4f8b\u5982source\nCategory() Category\n// \u7c7b\u578b\uff0c\u4f8b\u5982kafka\nType() Type\n// \u81ea\u5b9a\u4e49\u63cf\u8ff0\nString() string\n}\n\n// \u914d\u7f6e\u83b7\u53d6\u63a5\u53e3\ntype Config interface {\n// \u83b7\u53d6\u914d\u7f6e\nConfig() interface{}\n}\n\n// \u7ec4\u4ef6\u63a5\u53e3\ntype Component interface {\n// \u751f\u547d\u5468\u671f\u7ba1\u7406\nLifecycle\n// \u63cf\u8ff0\u7ba1\u7406\nDescribable\n// \u914d\u7f6e\u7ba1\u7406\nConfig\n}\n
    "},{"location":"developer-guide/component/component-guide/#source","title":"source\u7ec4\u4ef6","text":"

    source\u7ec4\u4ef6\u5bf9\u63a5\u6570\u636e\u6e90\u8f93\u5165\uff0c\u5f00\u53d1\u4e00\u4e2a\u65b0\u7684source\u63d2\u4ef6\u9700\u8981\u5b9e\u73b0\u5982\u4e0b\u63a5\u53e3

    // source\u7ec4\u4ef6\u63a5\u53e3\ntype Source interface {\nComponent\nProducer\n// \u63d0\u4ea4\u63a5\u53e3\uff0c\u786e\u8ba4sink\u7aef\u6210\u529f\u7136\u540e\u63d0\u4ea4\nCommit(events []Event)\n}\n\n// \u751f\u4ea7\u63a5\u53e3\uff0csource\u7ec4\u4ef6\u9700\u8981\u5b9e\u73b0\ntype Producer interface {\n// \u5bf9\u63a5\u6570\u636e\u6e90\nProductLoop(productFunc ProductFunc)\n}\n

    "},{"location":"developer-guide/component/component-guide/#sink","title":"sink\u7ec4\u4ef6","text":"

    sink\u7ec4\u4ef6\u5bf9\u63a5\u8f93\u51fa\u7aef\uff0c\u5f00\u53d1\u4e00\u4e2a\u65b0\u7684sink\u63d2\u4ef6\u9700\u8981\u5b9e\u73b0\u5982\u4e0b\u63a5\u53e3

     // sink\u7ec4\u4ef6\u63a5\u53e3\ntype Sink interface {\nComponent\nConsumer\n}\n\n// \u6d88\u8d39\u63a5\u53e3\uff0csink\u7ec4\u4ef6\u9700\u8981\u5b9e\u73b0\ntype Consumer interface {\n// \u5bf9\u63a5\u8f93\u51fa\u7aef\nConsume(batch Batch) Result\n}\n

    "},{"location":"developer-guide/component/component-guide/#interceptor","title":"interceptor\u7ec4\u4ef6","text":"

    interceptor\u7ec4\u4ef6\u5bf9\u4e8b\u4ef6\u8fdb\u884c\u62e6\u622a\u5904\u7406\uff0c\u5f00\u53d1\u4e00\u4e2a\u65b0\u7684interceptor\u63d2\u4ef6\u9700\u8981\u5b9e\u73b0\u5982\u4e0b\u63a5\u53e3

    // interceptor\u7ec4\u4ef6\u63a5\u53e3\ntype Interceptor interface {\nComponent\n// \u62e6\u622a\u5904\u7406\nIntercept(invoker Invoker, invocation Invocation) api.Result\n}\n

    Note

    \u8bf7\u6ce8\u610f\u65b0\u589e\u7684\u7ec4\u4ef6\u9700\u8981\u653e\u5230pkg/include/include.go\u7684import\u5f53\u4e2d\u6ce8\u518c

    "},{"location":"getting-started/overview/","title":"Loggie\u6f2b\u6e38\u6307\u5357","text":"

    \u6b22\u8fce\u6765\u5230Loggie\u7684\u4e16\u754c\u3002

    "},{"location":"getting-started/overview/#_1","title":"\u4e86\u89e3","text":"

    \u60f3\u77e5\u9053\u4ec0\u4e48\u662fLoggie\uff1f\u4e86\u89e3\u4e00\u4e0b\u300c\u6838\u5fc3\u6982\u5ff5\u300d\u3002

    \u5982\u679c\u4f60\u5e0c\u671b\u5feb\u901f\u4f53\u9a8cLoggie\uff0c\u8bf7\u53c2\u8003\u300c\u5feb\u901f\u4e0a\u624b\u300d\u3002

    \u6709\u66f4\u591a\u5174\u8da3\uff1f\u60f3\u77e5\u9053\u6211\u4eec\u4e3a\u4ec0\u4e48\u7814\u53d1Loggie\u3001Loggie\u6709\u4ec0\u4e48\u4f18\u52bf\u3001\u548c\u540c\u7c7b\u9879\u76ee\u7684\u5bf9\u6bd4\uff1f\u8bf7\u6233\u8fd9\u91cc\u3002

    "},{"location":"getting-started/overview/#_2","title":"\u4f7f\u7528","text":"

    \u5982\u679c\u4f60\u5e0c\u671b\u5c1d\u8bd5\u4e00\u4e0bLoggie\uff0c\u4f46\u4e0d\u77e5\u9053\u5982\u4f55\u5f00\u59cb\uff1f

    \u53ef\u4ee5\u5148\u4ece\u6574\u4f53\u601d\u8003\u4e00\u4e0b\uff1a\u5982\u4f55\u91c7\u96c6\u4e1a\u52a1\u7684\u65e5\u5fd7\uff0c\u5982\u4f55\u5f62\u6210\u4e00\u4e2a\u5b8c\u5584\u5e76\u9002\u5408\u5b9e\u9645\u9700\u6c42\u7684\u65e5\u5fd7\u67b6\u6784\uff1f \u8fd9\u91cc\u6709\u4e00\u4e2a\u53c2\u8003\u3002

    \u63a5\u7740\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u9002\u5408\u7684\u4e1a\u52a1\u300c\u573a\u666f\u300d\uff0c\u67e5\u770bLoggie\u5728Kubernetes\u4e0b\u7684\u6700\u4f73\u5b9e\u8df5\u3002

    \u8fd9\u91cc\u8fd8\u6d89\u53ca\u5230\u5982\u4f55\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u300c\u90e8\u7f72\u300dLoggie\u3002

    \u53e6\u5916\uff0c\u60f3\u67e5\u770b\u5177\u4f53\u7ec4\u4ef6\u7684\u4f7f\u7528\u65b9\u5f0f\uff0c\u8bf7\u53c2\u8003\u300c\u914d\u7f6e\u300d\u3002

    "},{"location":"getting-started/overview/#_3","title":"\u89e3\u7b54","text":"

    \u5728\u4f7f\u7528Loggie\u7684\u65f6\u5019\u9047\u5230\u95ee\u9898\uff1f \u8bf7\u63d0issues\u6216\u8005\u8054\u7cfb\u6211\u4eec\u3002

    \u5fae\u4fe1\u626b\u7801\u52a0\u5165Loggie\u8ba8\u8bba\u7fa4\uff1a\uff08\u8001\u7684\u5fae\u4fe1\u5df2\u6ee1\uff0c\u672a\u901a\u8fc7\u7684\u8bf7\u91cd\u65b0\u626b\u7801\uff09

    "},{"location":"getting-started/overview/#_4","title":"\u53c2\u4e0e","text":"

    \u5982\u679c\u4f60\u5bf9Loggie\u7684\u5177\u4f53\u5b9e\u73b0\u611f\u5174\u8da3\uff0c\u60f3\u53c2\u4e0eLoggie\u5f00\u6e90\u7684\u7814\u53d1\uff1f\u60f3\u81ea\u7814\u63d2\u4ef6\uff1f\u8bf7\u770b\u300c\u5f00\u53d1\u624b\u518c\u300d\u3002

    "},{"location":"getting-started/install/kubernetes/","title":"Kubernetes\u90e8\u7f72","text":""},{"location":"getting-started/install/kubernetes/#loggie-daemonset","title":"\u90e8\u7f72Loggie DaemonSet","text":"

    \u8bf7\u786e\u4fdd\u672c\u5730\u6709kubectl\u548chelm\u53ef\u6267\u884c\u547d\u4ee4\u3002

    "},{"location":"getting-started/install/kubernetes/#helm-chart","title":"\u4e0b\u8f7dhelm-chart\u5305","text":"

    VERSION=v1.4.0\nhelm pull https://github.com/loggie-io/installation/releases/download/$VERSION/loggie-$VERSION.tgz && tar xvzf loggie-$VERSION.tgz\n
    \u8bf7\u5c06\u4ee5\u4e0a\u7684<VERSION>\u66ff\u6362\u6210\u5177\u4f53\u7684\u7248\u672c\u53f7\u3002\u6bd4\u5982v1.4.0\u3002 \u53ef\u4ecerelease tag\u91cc\u627e\u3002

    "},{"location":"getting-started/install/kubernetes/#_1","title":"\u4fee\u6539\u914d\u7f6e","text":"

    \u8fdb\u5165chart\u76ee\u5f55\uff1a

    cd installation/helm-chart\n

    \u67e5\u770bvalues.yml\uff0c\u5e76\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u4fee\u6539\u3002

    \u76ee\u524d\u53ef\u914d\u7f6e\u7684\u53c2\u6570\u5982\u4e0b\u6240\u793a\uff1a

    "},{"location":"getting-started/install/kubernetes/#_2","title":"\u955c\u50cf","text":"

    image: loggieio/loggie:main\n
    loggie\u7684\u955c\u50cf\u3002\u53ef\u4ecedocker hub\u4e2d\u67e5\u770b\u6240\u6709\u955c\u50cf\u3002

    "},{"location":"getting-started/install/kubernetes/#_3","title":"\u8d44\u6e90","text":"

    resources:\nlimits:\ncpu: 2\nmemory: 2Gi\nrequests:\ncpu: 100m\nmemory: 100Mi\n
    Loggie Agent\u7684limit/request\u8d44\u6e90\uff0c\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\u3002

    "},{"location":"getting-started/install/kubernetes/#_4","title":"\u989d\u5916\u542f\u52a8\u53c2\u6570","text":"

    extraArgs: {}\n
    Loggie\u7684\u989d\u5916\u542f\u52a8\u53c2\u6570\uff0c\u6bd4\u5982\u5e0c\u671b\u4fee\u6539\u914d\u7f6e\u4f7f\u7528debug\u7684\u65e5\u5fd7\u7ea7\u522b\uff0c\u4e0d\u4f7f\u7528json\u683c\u5f0f\u7684\u65e5\u5fd7\u6253\u5370\u5f62\u5f0f\uff0c\u53ef\u4ee5\u4fee\u6539\u4e3a:
    extraArgs:\nlog.level: debug\nlog.jsonFormat: false\n

    "},{"location":"getting-started/install/kubernetes/#_5","title":"\u989d\u5916\u6302\u8f7d","text":"

    extraVolumeMounts:\n- mountPath: /var/log/pods\nname: podlogs\n- mountPath: /var/lib/kubelet/pods\nname: kubelet\n- mountPath: /var/lib/docker\nname: docker\n\n\nextraVolumes:\n- hostPath:\npath: /var/log/pods\ntype: DirectoryOrCreate\nname: podlogs\n- hostPath:\npath: /var/lib/kubelet/pods\ntype: DirectoryOrCreate\nname: kubelet\n- hostPath:\npath: /var/lib/docker\ntype: DirectoryOrCreate\nname: docker\n
    \u5efa\u8bae\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u9ed8\u8ba4\u6302\u8f7d\u4ee5\u4e0a\u76ee\u5f55\u3002 \u7279\u522b\u5f3a\u8c03\u7684\u662f\uff1a\u7531\u4e8eLoggie\u672c\u8eab\u4e5f\u662f\u5bb9\u5668\u5316\u90e8\u7f72\uff0c\u6240\u4ee5Loggie\u4e5f\u9700\u8981\u6302\u8f7d\u8282\u70b9\u7684\u4e00\u4e9bvolume\u6765\u91c7\u96c6\u65e5\u5fd7\uff0c\u5426\u5219Loggie\u5bb9\u5668\u5185\u90e8\u770b\u4e0d\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u66f4\u6ca1\u529e\u6cd5\u53bb\u91c7\u96c6\u3002

    \u8fd9\u91cc\u7b80\u5355\u5217\u4e3e\u4e00\u4e0b\u91c7\u96c6\u4ec0\u4e48\u6837\u7684\u65e5\u5fd7\u9700\u8981\u6302\u8f7d\u4ec0\u4e48\u8def\u5f84\uff1a

    volumeMounts:\n- mountPath: /data/logs\nname: logs\n\nvolumes:\n- hostPath:\npath: /data/logs\ntype: DirectoryOrCreate\nname: logs\n
    volumeMounts:\n- mountPath: /var/lib/kubelet/pods\nname: kubelet\n\nvolumes:\n- hostPath:\npath: /var/lib/kubelet/pods\ntype: DirectoryOrCreate\nname: kubelet\n

    \u5176\u4ed6\uff1a

    "},{"location":"getting-started/install/kubernetes/#_6","title":"\u8c03\u5ea6","text":"

    nodeSelector: {}\n\naffinity: {}\n# podAntiAffinity:\n#   requiredDuringSchedulingIgnoredDuringExecution:\n#   - labelSelector:\n#       matchExpressions:\n#       - key: app\n#         operator: In\n#         values:\n#         - loggie\n#     topologyKey: \"kubernetes.io/hostname\"\n
    \u53ef\u4f7f\u7528nodeSelector\u548caffinity\u6765\u63a7\u5236Loggie Pod\u7684\u8c03\u5ea6\uff0c\u5177\u4f53\u8bf7\u53c2\u8003Kubernetes\u6587\u6863\u3002

    tolerations: []\n# - effect: NoExecute\n#   operator: Exists\n# - effect: NoSchedule\n#   operator: Exists\n
    \u5982\u679c\u8282\u70b9\u6709\u81ea\u5df1\u7684taints\uff0c\u4f1a\u5bfc\u81f4Loggie Pod\u65e0\u6cd5\u8c03\u5ea6\u5230\u8be5\u8282\u70b9\uff0c\u5982\u679c\u9700\u8981\u5ffd\u7565taints\uff0c\u53ef\u4ee5\u52a0\u4e0a\u5bf9\u5e94\u7684tolerations\u3002

    "},{"location":"getting-started/install/kubernetes/#_7","title":"\u66f4\u65b0\u7b56\u7565","text":"

    updateStrategy:\ntype: RollingUpdate\n
    \u53ef\u4e3aRollingUpdate\u6216\u8005OnDelete\u3002

    "},{"location":"getting-started/install/kubernetes/#_8","title":"\u5168\u5c40\u914d\u7f6e","text":"

    config:\nloggie:\nreload:\nenabled: true\nperiod: 10s\nmonitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nsink: ~\ndiscovery:\nenabled: true\nkubernetes:\ncontainerRuntime: containerd\nfields:\ncontainer.name: containername\nlogConfig: logconfig\nnamespace: namespace\nnode.name: nodename\npod.name: podname\nhttp:\nenabled: true\nport: 9196\n
    \u5177\u4f53\u53c2\u6570\u8bf4\u660e\u53ef\u53c2\u8003\u7ec4\u4ef6\u914d\u7f6e\u3002 \u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u4f60\u5728\u672c\u5730\u4f7f\u7528Kind\u7b49\u5de5\u5177\u90e8\u7f72Kubernetes\uff0cKind\u9ed8\u8ba4\u4f1a\u4f7f\u7528containerd runtime\uff0c\u6b64\u65f6\u9700\u8981\u5728discovery.kubernetes\u4e2d\u589e\u52a0 containerRuntime: containerd\uff0c\u6307\u5b9a\u5bb9\u5668\u8fd0\u884c\u65f6\u3002

    "},{"location":"getting-started/install/kubernetes/#service","title":"service","text":"

    \u5982\u679cLoggie\u5e0c\u671b\u63a5\u6536\u5176\u4ed6\u670d\u52a1\u53d1\u9001\u7684\u6570\u636e\uff0c\u9700\u8981\u5c06\u81ea\u8eab\u7684\u670d\u52a1\u901a\u8fc7service\u66b4\u9732\u51fa\u6765\u3002

    \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528Agent\u6a21\u5f0f\u7684Loggie\u53ea\u9700\u8981\u66b4\u9732\u81ea\u8eab\u7ba1\u7406\u7aef\u53e3\u3002

    servicePorts:\n- name: monitor\nport: 9196\ntargetPort: 9196\n
    "},{"location":"getting-started/install/kubernetes/#_9","title":"\u90e8\u7f72","text":"

    \u521d\u6b21\u90e8\u7f72\uff0c\u6211\u4eec\u6307\u5b9a\u90e8\u7f72\u5728loggie namespace\u4e0b\uff0c\u5e76\u8ba9helm\u81ea\u52a8\u521b\u5efa\u8be5namespace\u3002

    helm install loggie ./ -nloggie --create-namespace\n

    \u5982\u679c\u4f60\u7684\u73af\u5883\u4e2d\u5df2\u7ecf\u521b\u5efa\u4e86loggie namespace\uff0c\u53ef\u4ee5\u5ffd\u7565\u5176\u4e2d\u7684-nloggie\u548c--create-namespace\u53c2\u6570\u3002\u5f53\u7136\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u81ea\u5df1\u7684namespace\uff0c\u5c06\u5176\u4e2dloggie\u66ff\u6362\u5373\u53ef\u3002

    Kubernetes\u7248\u672c\u95ee\u9898

    failed to install CRD crds/crds.yaml: unable to recognize \"\": no matches for kind \"CustomResourceDefinition\" in version \"apiextensions.k8s.io/v1\"\n
    \u5982\u679c\u4f60\u5728helm install\u7684\u65f6\u5019\u51fa\u73b0\u7c7b\u4f3c\u7684\u95ee\u9898\uff0c\u8bf4\u660e\u4f60\u7684Kubernetes\u7248\u672c\u8f83\u4f4e\uff0c\u4e0d\u652f\u6301apiextensions.k8s.io/v1\u7248\u672cCRD\u3002Loggie\u6682\u65f6\u4fdd\u7559\u4e86v1beta1\u7248\u672c\u7684CRD\uff0c\u8bf7\u5220\u9664charts\u4e2dv1beta1\u7248\u672c\uff0crm loggie/crds/crds.yaml\uff0c\u91cd\u65b0install\u3002

    "},{"location":"getting-started/install/kubernetes/#_10","title":"\u67e5\u770b\u90e8\u7f72\u72b6\u6001","text":"

    \u6267\u884c\u5b8c\u540e\uff0c\u901a\u8fc7\u4f7f\u7528helm\u547d\u4ee4\u6765\u67e5\u770b\u90e8\u7f72\u72b6\u6001\uff1a

    helm list -nloggie\n
    \u7c7b\u4f3c\u5982\u4e0b\u6240\u793a\uff1a
    NAME    NAMESPACE   REVISION    UPDATED                                 STATUS      CHART           APP VERSION\nloggie  loggie      1           2021-11-30 18:06:16.976334232 +0800 CST deployed    loggie-v0.1.0   v0.1.0\n

    \u540c\u65f6\u4e5f\u53ef\u4ee5\u901a\u8fc7kubectl\u547d\u4ee4\u67e5\u770bPod\u662f\u5426\u5df2\u7ecf\u88ab\u521b\u5efa\u3002

    kubectl -nloggie get po\n
    \u7c7b\u4f3c\u5982\u4e0b\u6240\u793a\uff1a
    loggie-sxxwh   1/1     Running   0          5m21s   10.244.0.5   kind-control-plane   <none>           <none>\n

    "},{"location":"getting-started/install/kubernetes/#loggie-aggregator","title":"\u90e8\u7f72Loggie Aggregator","text":"

    \u90e8\u7f72Aggregator\u57fa\u672c\u548cAgent\u4e00\u81f4\uff0c\u5728helm chart\u4e2d\u6211\u4eec\u63d0\u4f9b\u4e86aggregator config\u90e8\u5206\uff0c\u53ea\u9700\u6539\u6210enabled: true\u5373\u53ef\u3002

    helm chart\u4e2d\u63d0\u4f9b\u4e86statefulSet\u7684\u90e8\u7f72\u65b9\u5f0f\uff0c\u4f60\u4e5f\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u4fee\u6539\u6210deployment\u7b49\u65b9\u5f0f\u3002

    \u540c\u65f6\uff0c\u8bf7\u6ce8\u610f\u5728values.yaml\u4e2d\u6839\u636e\u60c5\u51b5\u589e\u52a0\uff1a

    \u6267\u884c\u90e8\u7f72\u547d\u4ee4\u53c2\u8003\uff1a

    helm install loggie-aggregator ./ -nloggie-aggregator --create-namespace\n

    Note

    Loggie\u4e2d\u8f6c\u673a\u540c\u6837\u53ef\u4ee5\u4f7f\u7528Deployment\u6216\u8005StatefulSet\u6765\u90e8\u7f72\uff0c\u8bf7\u53c2\u8003DaemonSet\u81ea\u884c\u4fee\u6539helm chart\u3002

    "},{"location":"getting-started/install/node/","title":"\u4e3b\u673a\u90e8\u7f72","text":"

    Loggie\u4f7f\u7528Golang\u7f16\u8bd1\u6210\u4e8c\u8fdb\u5236\uff0c\u53ef\u6839\u636e\u81ea\u8eab\u9700\u6c42\u5bf9\u63a5\u5404\u7c7b\u90e8\u7f72\u7cfb\u7edf\u3002 \u8fd9\u91cc\u6211\u4eec\u63d0\u4f9b\u4e00\u4e2a\u4f7f\u7528systemd\u90e8\u7f72Loggie\u7684\u53c2\u8003\u3002

    "},{"location":"getting-started/install/node/#_2","title":"\u524d\u7f6e\u68c0\u67e5","text":"

    \u76ee\u524drelease\u4ec5\u5305\u542bGOOS=linux GOARCH=amd64\u751f\u6210\u7684\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6\u3002\u5176\u4ed6\u7cfb\u7edf\u548c\u67b6\u6784\uff0c\u8bf7\u81ea\u884c\u57fa\u4e8e\u6e90\u7801\u4ea4\u53c9\u7f16\u8bd1\u3002

    "},{"location":"getting-started/install/node/#_3","title":"\u4e0b\u8f7d\u4e8c\u8fdb\u5236","text":"
    VERSION=v1.4.0\nmkdir /opt/loggie && curl https://github.com/loggie-io/loggie/releases/download/$VERSION/loggie -o /opt/loggie/loggie && chmod +x /opt/loggie/loggie\n

    \u8bf7\u5c06\u4ee5\u4e0a\u7684<VERSION>\u66ff\u6362\u6210\u5177\u4f53\u7684\u7248\u672c\u53f7\u3002

    "},{"location":"getting-started/install/node/#_4","title":"\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6","text":"

    \u8bf7\u6839\u636e\u5b9e\u9645\u9700\u6c42\u521b\u5efa\u914d\u7f6e\uff0c\u4ee5\u4e0b\u4e3a\u53c2\u8003\uff1a

    "},{"location":"getting-started/install/node/#loggieyml","title":"\u521b\u5efaloggie.yml","text":"

    loggie.yml

    cat << EOF > /opt/loggie/loggie.yml\nloggie:\nmonitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nsink: ~\n\nreload:\nenabled: true\nperiod: 10s\n\nhttp:\nenabled: true\nport: 9196\nEOF\n
    "},{"location":"getting-started/install/node/#pipelinesyml","title":"\u521b\u5efapipelines.yml","text":"

    pipelines.yml

    cat << EOF > /opt/loggie/pipelines.yml\npipelines:\n- name: local\nsources:\n- type: file\nname: demo\npaths:\n- /tmp/log/*.log\nsink:\ntype: dev\nprintEvents: true\ncodec:\npretty: true\nEOF\n
    "},{"location":"getting-started/install/node/#systemd","title":"\u6dfb\u52a0systemd\u914d\u7f6e","text":"
    cat << EOF > /lib/systemd/system/loggie.service\n[Unit]\nDescription=Loggie\nDocumentation=https://loggie-io.github.io/docs/getting-started/install/node/\n\n[Service]\nMemoryMax=200M\nExecStart=/opt/loggie/loggie -config.system=/opt/loggie/loggie.yml -config.pipeline=/opt/loggie/pipelines.yml\nRestart=always\n\n[Install]\nWantedBy=multi-user.target\nEOF\n
    "},{"location":"getting-started/install/node/#_5","title":"\u542f\u52a8","text":"

    \u9996\u5148\u751f\u6548\u914d\u7f6e\uff1a

    systemctl daemon-reload\n

    \u7136\u540e\u8bbe\u7f6e\u4e3a\u5f00\u673a\u542f\u52a8\uff1a

    systemctl enable loggie\n

    \u63a5\u7740\u5c31\u53ef\u4ee5\u6b63\u5f0f\u542f\u52a8Loggie\u4e86\uff1a

    systemctl start loggie\n

    \u542f\u52a8\u540e\uff0c\u4f60\u53ef\u4ee5\u968f\u65f6\u67e5\u770b\u8fdb\u7a0b\u72b6\u6001\uff1a

    systemctl status loggie\n

    "},{"location":"getting-started/intro/core-concept/","title":"\u6838\u5fc3\u6982\u5ff5","text":"

    Loggie\u662f\u4e00\u4e2a\u57fa\u4e8eGolang\u7684\u8f7b\u91cf\u7ea7\u3001\u9ad8\u6027\u80fd\u3001\u4e91\u539f\u751f\u65e5\u5fd7\u91c7\u96c6Agent\u548c\u4e2d\u8f6c\u5904\u7406Aggregator\uff0c\u652f\u6301\u591aPipeline\u548c\u7ec4\u4ef6\u70ed\u63d2\u62d4\uff0c\u63d0\u4f9b\u4e86\uff1a

    "},{"location":"getting-started/intro/core-concept/#_2","title":"\u67b6\u6784","text":""},{"location":"getting-started/intro/core-concept/#_3","title":"\u6982\u5ff5","text":""},{"location":"getting-started/intro/core-concept/#_4","title":"\u6838\u5fc3\u6570\u636e\u6d41","text":""},{"location":"getting-started/intro/core-concept/#_5","title":"\u7ba1\u7406\u4e0e\u63a7\u5236","text":""},{"location":"getting-started/quick-start/kubernetes/","title":"\u5feb\u901f\u4e0a\u624b\uff1a\u91c7\u96c6Kubernetes Pod\u65e5\u5fd7","text":"

    \u4e0b\u9762\u5c06\u5e26\u4f60\u6f14\u793a\u5728\u4e00\u4e2aKubernetes\u96c6\u7fa4\u4e2d\uff0c\u901a\u8fc7\u521b\u5efaLogConfig CRD\u5feb\u901f\u91c7\u96c6Pod\u7684\u65e5\u5fd7\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#1-kubernetes","title":"1. \u51c6\u5907Kubernetes\u73af\u5883","text":"

    \u53ef\u4ee5\u4f7f\u7528\u73b0\u6709Kubernetes\u96c6\u7fa4\uff0c\u6216\u8005\u90e8\u7f72Kubernetes\u3002\u672c\u5730\u63a8\u8350\u4f7f\u7528Kind\u642d\u5efaKubernetes\u96c6\u7fa4\u3002

    \u672c\u6587\u7684\u64cd\u4f5c\u9700\u8981\u5728\u672c\u5730\u4f7f\u7528:

    \u8bf7\u786e\u4fdd\u672c\u5730\u6709kubectl\u548chelm\u53ef\u6267\u884c\u547d\u4ee4\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#2-loggie-daemonset","title":"2. \u90e8\u7f72Loggie DaemonSet","text":"

    \u4f60\u53ef\u4ee5\u5728 installation \u9875\u9762\u67e5\u770b\u6240\u6709\u53d1\u5e03\u7684\u90e8\u7f72chart\u3002

    \u53ef\u4ee5\u9009\u62e9\uff1a

    "},{"location":"getting-started/quick-start/kubernetes/#chart","title":"\u4e0b\u8f7dchart\u518d\u90e8\u7f72","text":"

    VERSION=v1.4.0\nhelm pull https://github.com/loggie-io/installation/releases/download/$VERSION/loggie-$VERSION.tgz && tar xvzf loggie-$VERSION.tgz\n
    \u5c1d\u8bd5\u4fee\u6539\u4e00\u4e0b\u5176\u4e2d\u7684values.yaml\u3002 \u8bf7\u5c06\u4ee5\u4e0a\u7684<VERSION>\u66ff\u6362\u6210\u5177\u4f53\u7684\u7248\u672c\u53f7\u3002

    \u7136\u540e\u90e8\u7f72\u5b89\u88c5\uff1a

    helm install loggie ./loggie -nloggie --create-namespace\n

    \u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\uff1a

    "},{"location":"getting-started/quick-start/kubernetes/#_1","title":"\u76f4\u63a5\u90e8\u7f72\uff1a","text":"

    helm install loggie -nloggie --create-namespace https://github.com/loggie-io/installation/releases/download/$VERSION/loggie-$VERSION.tgz\n
    \u8bf7\u5c06\u4ee5\u4e0a\u7684<VERSION>\u66ff\u6362\u6210\u5177\u4f53\u7684\u7248\u672c\u53f7\u3002

    \u60f3\u4f7f\u7528\u5176\u4ed6\u7248\u672c\u955c\u50cf\uff1f

    \u4e3a\u4e86\u65b9\u4fbf\u4f53\u9a8c\u6700\u65b0\u7684Fix\u548c\u7279\u6027\uff0c\u6211\u4eec\u63d0\u4f9b\u4e86main\u5206\u652f\u6bcf\u6b21\u5408\u5e76\u540e\u7684\u955c\u50cf\u7248\u672c\uff0c\u53ef\u901a\u8fc7 \u8fd9\u91cc \u8fdb\u884c\u9009\u62e9\u3002 \u540c\u65f6\u4f60\u53ef\u4ee5\u5728helm install\u547d\u4ee4\u4e2d\u589e\u52a0--set image=loggieio/loggie:vX.Y.Z\u6765\u6307\u5b9a\u5177\u4f53\u7684Loggie\u955c\u50cf\u3002

    \u90e8\u7f72\u6709\u95ee\u9898\uff1f

    \u5982\u679c\u5c1d\u8bd5\u90e8\u7f72\u540e\u51fa\u73b0\u95ee\u9898\uff0c\u6216\u8005\u5728\u4f60\u7684\u73af\u5883\u4e2d\u4ee5\u4e0b\u6f14\u793a\u64cd\u4f5c\u672a\u6210\u529f\uff0c\u8bf7\u53c2\u8003Kubernetes\u4e0b\u90e8\u7f72Loggie\uff0c\u4fee\u6539\u76f8\u5173\u914d\u7f6e\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#3","title":"3. \u91c7\u96c6\u65e5\u5fd7","text":"

    Loggie\u5b9a\u4e49\u4e86Kubernetes CRD LogConfig\uff0c\u4e00\u4e2aLogConfig\u8868\u793a\u91c7\u96c6\u4e00\u7c7bPods\u7684\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#31-pods","title":"3.1 \u521b\u5efa\u88ab\u91c7\u96c6\u7684Pods","text":"

    \u6211\u4eec\u5148\u521b\u5efa\u4e00\u4e2aPod\u7528\u4e8e\u88ab\u91c7\u96c6\u65e5\u5fd7\u7684\u5bf9\u8c61\u3002

    kubectl create deploy nginx --image=nginx\n
    \u63a5\u4e0b\u6765\u5c06\u91c7\u96c6\u8fd9\u4e2aNginx Pod\u7684\u6807\u51c6\u8f93\u51fastdout\u65e5\u5fd7\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#32-sink","title":"3.2 \u5b9a\u4e49\u8f93\u51fa\u6e90Sink","text":"

    \u63a5\u7740\uff0c\u6211\u4eec\u521b\u5efa\u4e00\u4e2aLoggie\u5b9a\u4e49\u7684CRD Sink\u5b9e\u4f8b\uff0c\u8868\u660e\u65e5\u5fd7\u53d1\u9001\u7684\u540e\u7aef\u3002 \u4e3a\u4e86\u65b9\u4fbf\u6f14\u793a\uff0c\u8fd9\u91cc\u6211\u4eec\u5c06\u65e5\u5fd7\u53d1\u9001\u81f3Loggie Agent\u81ea\u8eab\u7684\u65e5\u5fd7\u4e2d\u5e76\u6253\u5370\u3002

    cat << EOF | kubectl apply -f -\napiVersion: loggie.io/v1beta1\nkind: Sink\nmetadata:\nname: default\nspec:\nsink: |\ntype: dev\nprintEvents: true\nEOF\n

    \u53ef\u4ee5\u901a\u8fc7kubectl get sink\u67e5\u770b\u5230\u5df2\u521b\u5efa\u7684Sink\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#33","title":"3.3 \u5b9a\u4e49\u91c7\u96c6\u4efb\u52a1","text":"

    Loggie\u5b9a\u4e49CRD LogConfig\uff0c\u8868\u793a\u4e00\u4e2a\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\u3002\u6211\u4eec\u521b\u5efa\u4e00\u4e2aLogConfig\u793a\u4f8b\u5982\u4e0b\u6240\u793a\uff1a

    cat << EOF | kubectl apply -f -\napiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: nginx\nnamespace: default\nspec:\nselector:\ntype: pod\nlabelSelector:\napp: nginx\npipeline:\nsources: |\n- type: file\nname: mylog\npaths:\n- stdout\nsinkRef: default\nEOF\n

    \u53ef\u4ee5\u770b\u5230\uff0c\u4e0a\u9762\u4f7f\u7528\u4e86sinkRef\u5f15\u7528\u4e86\u521a\u624d\u521b\u5efa\u7684sink default CR\u3002\u5f53\u7136\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u76f4\u63a5\u5728Logconfig\u4e2d\u4f7f\u7528sink\u5b57\u6bb5\uff0c\u793a\u4f8b\u5982\u4e0b\uff1a

    cat << EOF | kubectl apply -f -\napiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: nginx\nnamespace: default\nspec:\nselector:\ntype: pod\nlabelSelector:\napp: nginx\npipeline:\nsources: |\n- type: file\nname: mylog\npaths:\n- stdout\nsink: |\ntype: dev\nprintEvents: true\ncodec:\ntype: json\npretty: true\nEOF\n

    \u521b\u5efa\u5b8c\u4e4b\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528kubectl get lgc\u67e5\u770b\u5230\u521b\u5efa\u7684CRD\u5b9e\u4f8b\u3002

    \u540c\u65f6\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u901a\u8fc7kubectl describe lgc nginx\u67e5\u770bLogConfig\u7684\u4e8b\u4ef6\uff0c\u4ee5\u83b7\u53d6\u6700\u65b0\u7684\u72b6\u6001\u3002

    Events:\n  Type    Reason       Age   From                       Message\n  ----    ------       ----  ----                       -------\n  Normal  syncSuccess  52s   loggie/kind-control-plane  Sync type pod [nginx-6799fc88d8-5cb67] success\n

    \u4e0a\u9762\u7684nginx LogConfig\u901a\u8fc7\u5176\u4e2d\u7684spec.selector\u6765\u5339\u914d\u91c7\u96c6\u54ea\u4e9bPod\u7684\u65e5\u5fd7\uff0c\u8fd9\u91cc\u6211\u4eec\u4f7f\u7528app: nginx\u9009\u62e9\u4e86\u521a\u624d\u521b\u5efa\u7684nginx Pod\u3002 spec.pipeline\u5219\u8868\u793aLoggie\u7684Pipeline\u914d\u7f6e\uff0c\u6211\u4eec\u53ea\u91c7\u96c6\u5bb9\u5668\u6807\u51c6\u8f93\u51fa\u7684\u65e5\u5fd7\uff0c\u6240\u4ee5\u5728paths\u4e2d\u586b\u5199stdout\u5373\u53ef\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#4","title":"4. \u67e5\u770b\u65e5\u5fd7","text":"

    \u9996\u5148\u627e\u5230\u6240\u5728\u7684nginx pod\u8282\u70b9\uff1a

    kubectl get po -owide -l app=nginx\n

    \u7136\u540e\u6211\u4eec\u627e\u5230\u8be5\u8282\u70b9\u7684Loggie\uff1a

    kubectl -nloggie get po -owide |grep ${node}\n
    \u53ef\u4ee5\u901a\u8fc7\uff1a
    kubectl -nloggie logs -f ${logge-pod}\n
    \u67e5\u770bLoggie\u6253\u5370\u51fa\u7684\u65e5\u5fd7\uff0c\u91cc\u9762\u5c55\u793a\u4e86\u91c7\u96c6\u5230\u7684nginx\u6807\u51c6\u8f93\u51fa\u65e5\u5fd7\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#_2","title":"\u66f4\u591a","text":"

    \u4e0a\u6587\u53ea\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u5feb\u901f\u6f14\u793a\uff0c\u90e8\u7f72\u51fa\u73b0\u95ee\u9898\u6216\u8005\u60f3\u4e86\u89e3\u66f4\u591aKubernetes\u4e0bLoggie\u5982\u4f55\u4f7f\u7528\uff1f

    "},{"location":"getting-started/quick-start/node/","title":"\u5feb\u901f\u4e0a\u624b\uff1a\u8282\u70b9\u65e5\u5fd7\u91c7\u96c6","text":"

    \u4e0b\u9762\u6211\u4eec\u5c06\u6f14\u793a\u4e00\u4e2a\u6700\u7b80\u5355\u7684\u91c7\u96c6\u8282\u70b9\u65e5\u5fd7\u6587\u4ef6\u7684\u573a\u666f\u3002

    "},{"location":"getting-started/quick-start/node/#1","title":"1. \u4e0b\u8f7d\u53ef\u6267\u884c\u6587\u4ef6","text":"

    \u8bf7\u627e\u4e00\u53f0Linux\u670d\u52a1\u5668\u8282\u70b9\uff0c\u4e0b\u8f7dLoggie\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6

    VERSION=v1.4.0\ncurl -LJ https://github.com/loggie-io/loggie/releases/download/$VERSION/loggie -o loggie\n

    \u8bf7\u5c06\u4ee5\u4e0a\u7684<VERSION>\u66ff\u6362\u6210\u5177\u4f53\u7684\u7248\u672c\u53f7\u3002

    "},{"location":"getting-started/quick-start/node/#2","title":"2. \u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6","text":"

    \u6211\u4eec\u5148\u4f7f\u7528dev sink\u5c06file source\u91c7\u96c6\u7684\u65e5\u5fd7\u6587\u4ef6\u6253\u5370\u5230\u6807\u51c6\u8f93\u51fa\uff0c\u590d\u5236\u4ee5\u4e0b\u5185\u5bb9\u4e3apipelines.yml\u6587\u4ef6\uff1a

    pipelines.yml

    cat << EOF > pipelines.yml\npipelines:\n- name: demo\nsources:\n- type: file\nname: mylog\npaths:\n- \"/var/log/*.log\"\nsink:\ntype: dev\nprintEvents: true\nEOF\n
    \u8fd9\u91cc\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u79f0\u4e3ademo\u7684pipeline\uff0c\u7136\u540e\u5b9a\u4e49\u4e86\u4e00\u4e2a\u7c7b\u578b\u4e3afile\u7684source\u8f93\u5165\u6e90\u7ec4\u4ef6\uff0c\u8868\u793a\u9700\u8981\u91c7\u96c6\u5728/var/log\u76ee\u5f55\u4e0b\u6ee1\u8db3*.log\u5339\u914d\u89c4\u5219\u7684\u65e5\u5fd7\u6587\u4ef6\u3002\u6587\u4ef6\u91c7\u96c6\u540e\uff0c\u6587\u4ef6\u4f1a\u88ab\u53d1\u9001\u81f3dev sink\u8f93\u51fa\u6e90\uff0c\u8be5sink\u4ec5\u4ec5\u5c06\u91c7\u96c6\u7684\u6587\u4ef6\u6253\u5370\u5230\u6807\u51c6\u8f93\u51fa\u3002

    pipeline\u6587\u4ef6\u8868\u793a\u6211\u4eec\u60f3\u8981\u7684\u8f93\u5165\u3001\u8f93\u51fa\u7b49\u4e1a\u52a1\u76f8\u5173\u7684\u914d\u7f6e\uff0c\u9664\u4e86pipeline\u914d\u7f6e\u6587\u4ef6\u5916\uff0cLoggie\u8fd8\u9700\u8981\u6709\u4e00\u4e2a\u5168\u5c40\u7684\u914d\u7f6e\u6587\u4ef6\u3002

    // loggie.yml\ncat << EOF > loggie.yml\nloggie:\nreload:\nenabled: true\nperiod: 10s\nEOF\n

    \u8fd9\u91cc\u6211\u4eec\u53ea\u5c55\u793a\u4e86\u4e00\u4e2a\u6bd4\u8f83\u7b80\u5355\u7684\u914d\u7f6e\uff0c\u8868\u793a\u6253\u5f00loggie\u7684\u52a8\u6001\u914d\u7f6ereload\u529f\u80fd\uff0c\u540c\u65f6\u95f4\u9694\u68c0\u67e5\u65f6\u95f4\u4e3a10s\u3002

    \u5728\u8282\u70b9\u4e0a\u589e\u52a0\u4ee5\u4e0a\u4e24\u4e2a\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f00\u59cb\u542f\u52a8Loggie\u4e86\u3002

    "},{"location":"getting-started/quick-start/node/#3","title":"3. \u8fd0\u884c","text":"
    ./loggie -config.system=./loggie.yml -config.pipeline=./pipelines.yml -log.jsonFormat=false\n

    \u542f\u52a8\u53c2\u6570\u91cc\uff0c\u586b\u5165\u4e0a\u9762\u7684loggie.yml\u548cpipelines.yml\u7684\u6587\u4ef6\u8def\u5f84\u3002

    \u770b\u5230\u6b63\u5e38\u7684\u542f\u52a8\u65e5\u5fd7\u540e\uff0c\u8868\u660eLoggie\u5c31\u5f00\u59cb\u6b63\u5e38\u7684\u5de5\u4f5c\u4e86\u3002\u540c\u65f6\u8282\u70b9/var/log/*.log\u4e0b\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u90fd\u4f1a\u88ab\u6253\u5370\u5230\u6807\u51c6\u8f93\u51fa\u3002

    "},{"location":"getting-started/quick-start/quick-start/","title":"\u5feb\u901f\u4e0a\u624b","text":"

    Loggie\u662f\u4e00\u4e2a\u65e5\u5fd7\u91c7\u96c6Agent\u548c\u4e2d\u8f6c\u5904\u7406\u7684Aggregator\uff0c\u5305\u542b\u591a\u4e2aPipeline\u7ba1\u9053\uff0c\u6bcf\u4e2aPipeline\u53c8\u7531Source\u8f93\u5165\u3001Interceptor\u62e6\u622a\u5904\u7406\u548cSink\u8f93\u51fa\u7ec4\u6210\u3002

    \u57fa\u4e8e\u8fd9\u79cd\u63d2\u4ef6\u5f0f\u8bbe\u8ba1\uff0cLoggie\u5e76\u4e0d\u5c40\u9650\u5728\u65e5\u5fd7\u91c7\u96c6\uff0c\u901a\u8fc7\u914d\u7f6e\u4e0d\u540c\u7684Source/Interceptor/Sink\uff0cLoggie\u53ef\u4ee5\u7ec4\u5408\u5b9e\u73b0\u5404\u79cd\u4e0d\u540c\u7684\u529f\u80fd\u3002

    \u7b80\u5355\u8d77\u89c1\uff0c\u8fd9\u91cc\u6211\u4eec\u4ece\u91c7\u96c6\u65e5\u5fd7\u5f00\u59cb\u3002

    \u9009\u62e9\u4f60\u7684\u90e8\u7f72\u73af\u5883\uff1a

    "},{"location":"getting-started/quick-start/quick-start/#kubernetes","title":"Kubernetes","text":""},{"location":"getting-started/quick-start/quick-start/#_2","title":"\u4e3b\u673a","text":""},{"location":"getting-started/roadmap/roadmap-2023/","title":"2023 Loggie RoadMap","text":""},{"location":"getting-started/roadmap/roadmap-2023/#_1","title":"\u66f4\u591a\u7ec4\u4ef6\u4e0e\u529f\u80fd\u6269\u5c55","text":""},{"location":"getting-started/roadmap/roadmap-2023/#_2","title":"\u670d\u52a1\u53d1\u73b0\u4e0e\u914d\u7f6e\u4e2d\u5fc3","text":""},{"location":"getting-started/roadmap/roadmap-2023/#kubernetes","title":"\u4e91\u539f\u751f\u4e0eKubernetes","text":""},{"location":"reference/","title":"Overview","text":""},{"location":"reference/#_1","title":"\u914d\u7f6e","text":"

    Loggie\u7684\u914d\u7f6e\u4e3b\u8981\u5206\u4e3a\u4e24\u7c7b\uff1a

    "},{"location":"reference/#_2","title":"\u7cfb\u7edf\u914d\u7f6e","text":"

    \u5168\u5c40\u7684\u7cfb\u7edf\u914d\u7f6e\uff0c\u542f\u52a8\u53c2\u6570\u4e2d\u4f7f\u7528-config.system\u6307\u5b9a\uff0c\u5305\u542b\u5982\u4e0b\uff1a

    loggie.yml
    # loggie.yml\nloggie:\nmonitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nsink: ~\n\ndiscovery:\nenabled: false\n\nreload:\nenabled: true\nperiod: 10s\n\ndefaults:\nsink:\ntype: dev\nhttp:\nenabled: true\nport: 9196\n
    "},{"location":"reference/#pipeline","title":"Pipeline\u914d\u7f6e","text":"

    Pipeline\u7684\u914d\u7f6e\uff0c\u901a\u8fc7\u542f\u52a8\u53c2\u6570-config.pipeline\u6307\u5b9a\u3002\u8868\u793a\u961f\u5217\u4f7f\u7528\u7684Source\u3001Sink\u3001Queue\u548cInterceptor\u3002

    pipeline.yml
    pipelines:\n- name: demo # pipeline name\u5fc5\u586b\nsources:\n- type: ${sourceType}\nname: access # source\u4e2dname\u5fc5\u586b\n...\ninterceptors:\n- type: ${interceptorType}\n...\nsink:\ntype: ${sinkType}\n...\n
    "},{"location":"reference/#kubernetes-crd","title":"Kubernetes CRD","text":"

    Loggie\u5b9a\u4e49\u4e86\u4ee5\u4e0b\u51e0\u4e2aCRD\u7528\u4e8e\u5728Kubernetes\u96c6\u7fa4\u73af\u5883\u91cc\u4e0b\u53d1\u914d\u7f6e\uff1a

    Note

    ClusterLogConfig/LogConfig\u4e2d\u7684pipeline\u53ef\u4ee5\u5b9a\u4e49sink\u548cinterceptor\uff0c\u7528\u4e8e\u8be5pipeline\u7684sink/interceptor\u3002 \u5982\u679c\u4f60\u5e0c\u671b\u5728\u591a\u4e2aClusterLogConfig/LogConfig\u4e2d\u590d\u7528sink\u6216\u8005interceptor\uff0c\u53ef\u4ee5\u521b\u5efaSink/Interceptor CR\uff0c\u5728ClusterLogConfig/LogConfig\u4e2d\u4f7f\u7528sinkRef/interceptorRef\u8fdb\u884c\u5f15\u7528\u3002

    "},{"location":"reference/apis/config/","title":"Pipeline config\u914d\u7f6e\u76f8\u5173\u63a5\u53e3","text":""},{"location":"reference/apis/config/#apiv1reloadconfig","title":"/api/v1/reload/config","text":""},{"location":"reference/apis/config/#url","title":"URL","text":"
    GET /api/v1/reload/config\n
    "},{"location":"reference/apis/config/#_1","title":"\u63cf\u8ff0","text":"

    \u67e5\u770bLoggie\u78c1\u76d8\u4e0a\u7684Pipeline\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9\u3002 \u6240\u4ee5\u6bcf\u6b21\u8c03\u7528\u8be5\u63a5\u53e3\u90fd\u4f1a\u4eceLoggie\u542f\u52a8\u53c2\u6570-config.pipeline\u4e2d\u6307\u5b9a\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bfb\u53d6\u4e00\u6b21\u3002 \u4f46\u662f\u8be5\u914d\u7f6e\u6587\u4ef6\u5e76\u4e0d\u4e00\u5b9a\u662f\u5f53\u524dLoggie\u5185\u5b58\u4e2d\u6240\u8bfb\u53d6\u5230\u7684\u914d\u7f6e\uff0c\u56e0\u4e3a\u5b58\u5728reload\u95f4\u9694\u65f6\u95f4\u3001\u914d\u7f6e\u6587\u4ef6\u683c\u5f0f\u9519\u8bef\u7b49\u60c5\u51b5\u3002

    "},{"location":"reference/apis/config/#_2","title":"\u8bf7\u6c42\u53c2\u6570","text":"

    \u65e0

    "},{"location":"reference/apis/config/#_3","title":"\u8fd4\u56de","text":"

    Pipeline\u914d\u7f6e\u6587\u4ef6\u6587\u672c\u5185\u5bb9\u3002

    "},{"location":"reference/apis/config/#apiv1controllerpipelines","title":"/api/v1/controller/pipelines","text":""},{"location":"reference/apis/config/#url_1","title":"URL","text":"
    GET /api/v1/controller/pipelines\n
    "},{"location":"reference/apis/config/#_4","title":"\u63cf\u8ff0","text":"

    \u67e5\u770bLoggie\u5185\u5b58\u4e2d\u88ab\u8bfb\u53d6\u5230\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4e5f\u662f\u6b63\u5728\u8fd0\u884c\u7684Pipeline\u914d\u7f6e\u3002 \u8be5\u63a5\u53e3\u8fd4\u56de\u7684\u914d\u7f6e\u5185\u5bb9\u548chelp\u63a5\u53e3\u4e2d\u7684\u4e00\u81f4\u3002

    "},{"location":"reference/apis/config/#_5","title":"\u8bf7\u6c42\u53c2\u6570","text":"

    \u65e0

    "},{"location":"reference/apis/config/#_6","title":"\u8fd4\u56de","text":"

    Pipeline\u914d\u7f6e\u6587\u4ef6\u6587\u672c\u5185\u5bb9\u3002

    "},{"location":"reference/apis/help/","title":"help\u63a5\u53e3","text":""},{"location":"reference/apis/help/#apiv1help","title":"/api/v1/help","text":""},{"location":"reference/apis/help/#url","title":"URL","text":"
    GET /api/v1/help\n
    "},{"location":"reference/apis/help/#_1","title":"\u63cf\u8ff0","text":"

    \u67e5\u8be2\u8be5Loggie Agent\u7684\u5185\u90e8\u914d\u7f6e\u65e5\u5fd7\u91c7\u96c6\u72b6\u6001

    "},{"location":"reference/apis/help/#_2","title":"\u8bf7\u6c42\u53c2\u6570","text":"

    \u793a\u4f8b\uff1a

    /api/v1/help?pipeline=test&status=pending\n
    \u8868\u793a\u53ea\u8fd4\u56depipeline\u4e3atest\u7684\u6b63\u5728\u91c7\u96c6\u7684\u6240\u6709\u65e5\u5fd7\u6587\u4ef6\u72b6\u6001

    "},{"location":"reference/apis/help/#_3","title":"\u8fd4\u56de","text":"

    \u793a\u4f8b\u5982\u4e0b\uff1a

    --------- Usage: -----------------------\n|--- view details: /api/v1/help?detail=<module>, module is one of: pipeline/log\n|--- query by pipeline name: /api/v1/help?pipeline=<name>\n|--- query by source name: /api/v1/help?source=<name>\n\n--------- Pipeline Status: --------------\nall 1 pipelines running\n  * pipeline: local, sources: [demo]\n\n\u2705 pipeline configurations consistency check passed\n\npipelines:\n- name: local\ncleanDataTimeout: 5s\n  queue:\n    type: channel\n  interceptors:\n  - name: global\n    type: schema\n    addMeta:\n      timestamp:\n        key: '@timestamp'\norder: 700\n- type: metric\n  - type: maxbytes\n  - type: retry\n  sources:\n  - name: demo\n    type: file\n    fieldsUnderKey: fields\n    fields:\n      topic: loggie\n    paths:\n    - /tmp/log/*.log\n    watcher:\n      maxOpenFds: 6000\nsink:\n    type: dev\n    parallelism: 1\ncodec:\n      type: json\n      printEvents: true\npretty: true\n\n| more details:\n|--- pipelines configuration in the path ref: /api/v1/reload/config\n|--- current running pipelines configuration ref: /api/v1/controller/pipelines\n\n--------- Log Collection Status: ---------\n\nall activeFdCount: 0, inActiveFdCount: 1\n\n> pipeline * source - filename | progress(offset/size) | modify\n  > local\n* demo\n      - /tmp/log/app.log | 100.00%(189/189) | 2023-07-17T17:10:33+08:00\n\n| more details:\n|--- registry storage ref: /api/v1/source/file/registry\n
    "},{"location":"reference/apis/help/#apiv1helplog","title":"/api/v1/help/log","text":""},{"location":"reference/apis/help/#url_1","title":"URL","text":"
    GET /api/v1/help/log\n
    "},{"location":"reference/apis/help/#_4","title":"\u63cf\u8ff0","text":"

    \u67e5\u8be2\u8be5Loggie Agent\u7684\u65e5\u5fd7\u91c7\u96c6\u72b6\u6001

    "},{"location":"reference/apis/help/#_5","title":"\u8bf7\u6c42\u53c2\u6570","text":"

    \u793a\u4f8b\uff1a

    /api/v1/help/log?pipeline=test&status=pending\n
    \u8868\u793a\u53ea\u8fd4\u56depipeline\u4e3atest\u7684\u6b63\u5728\u91c7\u96c6\u7684\u6240\u6709\u65e5\u5fd7\u6587\u4ef6\u72b6\u6001

    "},{"location":"reference/apis/help/#_6","title":"\u8fd4\u56de\u53c2\u6570","text":"\u53c2\u6570\u540d\u79f0 \u8bf4\u660e \u53c2\u6570\u7c7b\u578b \u5907\u6ce8 fdStatus \u6587\u4ef6\u53e5\u67c4\u72b6\u6001 fdStatus.activeFdCount \u6d3b\u8dc3\u7684fd\u4e2a\u6570 int fdStatus.inActiveFdCount \u4e0d\u6d3b\u8dc3\u7684fd\u4e2a\u6570 int fileStatus \u6587\u4ef6\u91c7\u96c6\u72b6\u6001 fileStatus.pipeline.<name> \u7ba1\u9053\u72b6\u6001\uff0c\u5bf9\u5e94\u914d\u7f6e\u4e2d\u7684pipeline name\uff0c\u53c2\u8003\u4e0b\u9762\u7684pipeline\u53c2\u6570 map"},{"location":"reference/apis/help/#pipeline","title":"pipeline","text":"\u53c2\u6570\u540d\u79f0 \u8bf4\u660e \u53c2\u6570\u7c7b\u578b \u5907\u6ce8 source.<name> pipeline\u4e2dsource\u7684\u72b6\u6001\uff0c\u53c2\u8003\u4e0b\u9762\u7684source\u53c2\u6570 map"},{"location":"reference/apis/help/#source","title":"source","text":"\u53c2\u6570\u540d\u79f0 \u8bf4\u660e \u53c2\u6570\u7c7b\u578b \u5907\u6ce8 paths \u914d\u7f6e\u6587\u4ef6source\u4e2d\u5b9a\u4e49\u7684path string\u6570\u7ec4 detail pipeline\u4e2dsource\u7684\u72b6\u6001 \u6570\u7ec4 detail[n].filename \u6587\u4ef6\u540d\u79f0 string detail[n].offset \u91c7\u96c6\u8fdb\u5ea6offset int detail[n].size \u6587\u4ef6\u5927\u5c0f int detail[n].modify \u6587\u4ef6\u6700\u8fd1\u7684\u66f4\u65b0\u65f6\u95f4 int unix milliseconds detail[n].ignored \u6587\u4ef6\u662f\u5426\u88ab\u5ffd\u7565\uff08\u7531file source\u4e2d\u7684ignoreOlder\u914d\u7f6e\u51b3\u5b9a\uff09 bool

    Example

    {\n\"fdStatus\": {\n\"activeFdCount\": 0,\n\"inActiveFdCount\": 1\n},\n\"fileStatus\": {\n\"pipeline\": {\n\"local\": {\n\"source\": {\n\"demo\": {\n\"paths\": [\n\"/tmp/log/*.log\"\n],\n\"detail\": [\n{\n\"filename\": \"/tmp/log/access.log\",\n\"offset\": 469,\n\"size\": 469,\n\"modify\": 1673436846523,\n\"ignored\": false\n}\n]\n}\n}\n}\n}\n}\n}\n
    "},{"location":"reference/apis/registry/","title":"registry\u6301\u4e45\u5316\u5b58\u50a8\u63a5\u53e3","text":""},{"location":"reference/apis/registry/#apiv1sourcefileregistry","title":"/api/v1/source/file/registry","text":""},{"location":"reference/apis/registry/#url","title":"URL","text":"
    GET /api/v1/source/file/registry\n
    "},{"location":"reference/apis/registry/#_1","title":"\u63cf\u8ff0","text":"

    \u67e5\u8be2Loggie\u5728\u672c\u8282\u70b9\u4e0b\u6587\u4ef6\u7684\u6301\u4e45\u5316\u91c7\u96c6\u8fdb\u5ea6\u3002 Loggie\u4f1a\u5c06\u6587\u4ef6\u91c7\u96c6\u4e86\u591a\u5c11\u7684\u8fdb\u5ea6\u7b49\u4fe1\u606f\u6301\u4e45\u5316\u5230\u672c\u5730\uff0c\u5982\u679cLoggie\u53d1\u751f\u4e86\u91cd\u542f\uff0c\u4f1a\u4ece\u6587\u4ef6\u8bb0\u5f55\u7684\u8fdb\u5ea6offset\u5f00\u59cb\u91c7\u96c6\uff0c\u907f\u514d\u91cd\u5934\u5f00\u59cb\u91c7\u96c6\u6587\u4ef6\u3002

    "},{"location":"reference/apis/registry/#_2","title":"\u8bf7\u6c42\u53c2\u6570","text":"

    \u793a\u4f8b\uff1a

    /api/v1/source/file/registry?format=text\n
    "},{"location":"reference/apis/registry/#_3","title":"\u8fd4\u56de","text":"

    \u793a\u4f8b\uff1a

    {Id:1 PipelineName:local SourceName:demo Filename:/tmp/log/app2.log JobUid:75064440-16777234 Offset:259 CollectTime:2023-07-17 20:19:04.846 Version:0.0.1 LineNumber:9} {Id:2 PipelineName:local SourceName:demo Filename:/tmp/log/app.log JobUid:75610913-16777234 Offset:0 CollectTime:2023-07-17 20:19:12.343 Version:0.0.1 LineNumber:0} 

    "},{"location":"reference/apis/version/","title":"version\u7248\u672c\u63a5\u53e3","text":""},{"location":"reference/apis/version/#url","title":"URL","text":"
    GET /version\n
    "},{"location":"reference/apis/version/#_1","title":"\u63cf\u8ff0","text":"

    \u67e5\u770bLoggie\u7248\u672c

    "},{"location":"reference/apis/version/#_2","title":"\u8bf7\u6c42\u53c2\u6570","text":"

    \u65e0

    "},{"location":"reference/apis/version/#_3","title":"\u8fd4\u56de\u53c2\u6570","text":"

    \u76f4\u63a5\u8fd4\u56deLoggie\u7684\u7248\u672c\u540d\u79f0\u3002

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/","title":"ClusterLogConfig","text":"

    Cluster\u7ea7\u522bCRD\uff0c\u53ef\u7528\u4e8e\uff1a

    Example

    apiVersion: loggie.io/v1beta1\nkind:  ClusterLogConfig\nmetadata:\nname: test\nspec:\nselector:\ntype: node\nnodeSelector:\nnodepool: test\npipeline:\nsources: |\n- type: file\nname: messages\npaths:\n- /var/log/messages\nsinkRef: default\n
    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#specselector","title":"spec.selector","text":"

    \u8868\u793aPipeline\u914d\u7f6e\u9002\u7528\u7684\u8303\u56f4

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#specnamespaceselector","title":"spec.namespaceSelector","text":"

    \u6280\u672f\u63d0\u4f9b\u65b9\uff1a\u64ce\u521b\u79d1\u6280

    \u8868\u793a\u5339\u914d\u6307\u5b9a\u547d\u540d\u7a7a\u95f4\u4e0b\u7684\u5168\u90e8POD

    !!! example

      namespaceSelector:\n- test1\n- test2\n

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#specexcludenamespaceselector","title":"spec.excludeNamespaceSelector","text":"

    \u6280\u672f\u63d0\u4f9b\u65b9\uff1a\u64ce\u521b\u79d1\u6280

    \u8868\u793a\u6392\u9664\u6307\u5b9a\u547d\u540d\u7a7a\u95f4\u4e0b\u7684\u5168\u90e8POD

    Example

      excludeNamespaceSelector:\n- test1\n- test2\n
    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#type-pod","title":"type: pod","text":"

    \u901a\u8fc7Pipeline\u914d\u7f6e\u9009\u62e9\u4e00\u6279Pod\u8fdb\u884c\u65e5\u5fd7\u91c7\u96c6

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 labelSelector map \u5fc5\u586b \u901a\u8fc7\u8be5label\u6765\u5339\u914dPods\uff0c\u652f\u6301\u4f7f\u7528*\u6765\u5339\u914d\u6240\u6709\u7684value\uff0c\u6bd4\u5982app: '*'

    Example

    spec: selector:\ntype: pod\nlabelSelector:\napp: nginx\n
    \u8868\u793a\u91c7\u96c6\u5e26\u6709\u6807\u7b7e app: nginx\u7684\u6240\u6709Pod\u7684\u65e5\u5fd7\u3002

    Warning

    \u5728type: pod\u65f6\uff0c\u4e0b\u9762\u7684Pipeline\u53ea\u80fd\u4f7f\u7528file source\uff0c\u6b64\u65f6\u7684\u573a\u666f\u53ea\u80fd\u662f\u91c7\u96c6\u65e5\u5fd7\u3002

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#type-node","title":"type: node","text":"

    \u4e0b\u53d1Pipeline\u914d\u7f6e\u81f3\u8be5\u6279\u8282\u70b9\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 nodeSelector map \u5fc5\u586b \u901a\u8fc7label\u9009\u62e9\u4e0b\u53d1\u914d\u7f6e\u7684node

    Example

    spec: selector:\ntype: node\nnodeSelector:\nnodepool: test\n
    \u8868\u793a\u5c06\u914d\u7f6e\u7684Pipelines\u4e0b\u53d1\u81f3\u5e26\u6709nodepool: test\u7684\u6240\u6709node\u4e0a\u3002

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#type-cluster","title":"type: cluster","text":"

    \u4e0b\u53d1Pipeline\u914d\u7f6e\u81f3\u67d0\u4e2aLoggie\u96c6\u7fa4\uff0c\u901a\u5e38\u9700\u8981\u914d\u5408cluster\u5b57\u6bb5\u6307\u5b9a\u96c6\u7fa4\u540d\u4f7f\u7528\u3002

    Example

    spec:\nselector:\ncluster: aggregator\ntype: cluster\n
    \u8868\u793a\u5c06\u914d\u7f6e\u7684Pipelines\u4e0b\u53d1\u81f3cluster\u4e3aaggregator\u7684Loggie\u96c6\u7fa4\u3002

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#type-workload","title":"type: workload","text":"

    \u6280\u672f\u63d0\u4f9b\u65b9\uff1a\u64ce\u521b\u79d1\u6280

    \u901a\u8fc7Pipeline\u914d\u7f6e\u9009\u62e9\u4e00\u6279\u8d1f\u8f7d\u8fdb\u884c\u65e5\u5fd7\u91c7\u96c6

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 type array \u975e\u5fc5\u586b \u76ee\u524d\u652f\u6301Deployment\u3001DaemonSet\u3001CronJob\u3001Job\u3001StatefulSet\uff0c\u4e0d\u5199\u5c31\u662f\u5168\u90e8 nameSelector array \u975e\u5fc5\u586b \u8d1f\u8f7d\u540d\u5b57\uff0c\u4e0d\u5199\u5c31\u662f\u5168\u90e8 namespaceSelector array \u975e\u5fc5\u586b \u547d\u540d\u7a7a\u95f4\uff0c\u53ea\u5339\u914d\u6307\u5b9a\u547d\u540d\u7a7a\u95f4\u4e0b\u7684\u8d1f\u8f7d\uff0c\u4e0d\u5199\u5c31\u662f\u5168\u90e8 excludeNamespaceSelector array \u975e\u5fc5\u586b \u6392\u9664\u4e00\u90e8\u5206\u547d\u540d\u7a7a\u95f4

    Example

    apiVersion: loggie.io/v1beta1\nkind:  ClusterLogConfig\nmetadata:\nname: globalstdout\nspec:\nselector:\ntype: workload\nworkload_selector:\n- type:\n- Deployment\nnameSelector:\n- default1\n- default2\nnameSpaceSelector:\n- default1\n- default2\n\npipeline:\nsources: |\n- type: file\nname: stdout\npaths:\n- stdout\nsinkRef: default\n
    \u8868\u793a\u91c7\u96c6default1\u548cdefault2\u7684Deployment\u4e0b\u540d\u5b57\u4e3adefault1\u548cdefault2\u7684\u6240\u6709Pod\u7684\u65e5\u5fd7\u3002

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#cluster","title":"cluster","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cluster string \u975e\u5fc5\u586b \"\" \u8868\u793a\u914d\u7f6e\u6307\u5b9a\u4e0b\u53d1\u7684Loggie\u96c6\u7fa4\u3002\u5f53\u90e8\u7f72\u591a\u5957Loggie\u65f6\uff0c\u548c\u5168\u5c40\u7cfb\u7edf\u914d\u7f6ediscovery.kubernetes.cluster\u914d\u5957\u4f7f\u7528"},{"location":"reference/discovery/kubernetes/clusterlogconfig/#specpipeline","title":"spec.pipeline","text":"

    \u57fa\u672c\u914d\u7f6e\u548cLogConfig\u4e00\u81f4\u3002

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#sources","title":"sources","text":"

    \u5728ClusterLogConfig\u4e2d\uff0csource\u65b0\u589e\u4ee5\u4e0b\u989d\u5916\u7684\u53c2\u6570\uff1a

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#typenodefields","title":"typeNodeFields","text":"

    \u5982\u679c\u5f53type: node\u65f6\uff1a

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 typeNodeFields map \u975e\u5fc5\u586b \u548c\u5168\u5c40\u914d\u7f6ediscovery.kubernetes\u4e2d\u7684typeNodeFields\u4e00\u6837\uff0c\u533a\u522b\u662f\u8fd9\u91cc\u4e3aclusterlogconfig\u7ea7\u522b\u751f\u6548"},{"location":"reference/discovery/kubernetes/interceptors/","title":"Interceptor","text":"

    \u8868\u793a\u4e00\u4e2ainterceptor\u7ec4\u3002\u7528\u4e8e\u5728LogConfig/ClusterLogConfig\u4e2d\u88ab\u5f15\u7528\u3002

    Example

    apiVersion: loggie.io/v1beta1\nkind: Interceptor\nmetadata:\nname: default\nspec:\ninterceptors: |\n- type: rateLimit\nqps: 90000\n
    "},{"location":"reference/discovery/kubernetes/interceptors/#specinterceptors","title":"spec.interceptors","text":"

    \u4f7f\u7528\"|\"\u7b26\u53f7\u8868\u793a\u4e00\u6574\u6bb5interceptors\u914d\u7f6e\u5217\u8868\uff0c\u548cPipelines\u91cc\u7684\u914d\u7f6e\u4e00\u81f4\u3002

    "},{"location":"reference/discovery/kubernetes/logconfig/","title":"Logconfig","text":"

    namespace\u7ea7\u522bCRD\uff0c\u8868\u793a\u4e00\u4e2a\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\uff0c\u7528\u4e8e\u91c7\u96c6Pod\u5bb9\u5668\u65e5\u5fd7\u3002

    Example

    \u76f4\u63a5\u5b9a\u4e49sink/interceptor\u65b9\u5f0f\u5f15\u7528sink\u548cinterceptor\u65b9\u5f0f
    apiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: tomcat\nnamespace: default\nspec:\nselector:\ntype: pod\nlabelSelector:\napp: tomcat\npipeline:\nsources: |\n- type: file\nname: common\npaths:\n- stdout\nsink: |\ntype: dev\nprintEvents: false\ninterceptors: |\n- type: rateLimit\nqps: 90000\n
    apiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: nginx\nnamespace: default\nspec:\nselector:\ntype: pod\nlabelSelector:\napp: nginx\npipeline:\nsources: |\n- type: file\nname: mylog\npaths:\n- stdout\nsinkRef: default\ninterceptorRef: default 
    "},{"location":"reference/discovery/kubernetes/logconfig/#specselector","title":"spec.selector","text":"

    \u8868\u793aPipeline\u914d\u7f6e\u9002\u7528\u7684\u8303\u56f4\uff0c\u53ef\u4ee5\u9009\u62e9\u91c7\u96c6\u4e00\u6279Pods\u7684\u65e5\u5fd7

    "},{"location":"reference/discovery/kubernetes/logconfig/#type-pod","title":"type: pod","text":"

    \u91c7\u96c6Pods\u65e5\u5fd7

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 labelSelector map \u5fc5\u586b \u901a\u8fc7\u8be5label\u6765\u5339\u914dPods\uff0c\u652f\u6301\u4f7f\u7528*\u6765\u5339\u914d\u6240\u6709\u7684value\uff0c\u6bd4\u5982app: '*'

    Example

    spec: selector:\ntype: pod\nlabelSelector:\napp: nginx\n
    \u8868\u793a\u91c7\u96c6\u8be5namespace\u4e0b\u7684\u5e26\u6709label app: nginx\u7684\u6240\u6709Pods\u65e5\u5fd7\u3002

    Warning

    \u5728type: pod\u65f6\uff0c\u4e0b\u9762\u7684Pipeline\u53ea\u652f\u6301\u4f7f\u7528file source\uff0c\u6b64\u65f6\u7684\u573a\u666f\u53ea\u80fd\u662f\u91c7\u96c6\u65e5\u5fd7\u3002

    "},{"location":"reference/discovery/kubernetes/logconfig/#cluster","title":"cluster","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cluster string \u975e\u5fc5\u586b \"\" \u8868\u793a\u914d\u7f6e\u6307\u5b9a\u4e0b\u53d1\u7684Loggie\u96c6\u7fa4\u3002\u5f53\u90e8\u7f72\u591a\u5957Loggie\u65f6\uff0c\u548c\u5168\u5c40\u7cfb\u7edf\u914d\u7f6ediscovery.kubernetes.cluster\u914d\u5957\u4f7f\u7528"},{"location":"reference/discovery/kubernetes/logconfig/#specpipeline","title":"spec.pipeline","text":"

    \u8868\u793a\u4e00\u4e2aPipeline\uff0c\u4e0d\u652f\u6301\u586b\u5199\u591a\u4e2aPipeline\u3002

    \u548c\u5728\u914d\u7f6e\u6587\u4ef6\u4e2dPipelines\u7684\u533a\u522b\u5728\uff1a

    "},{"location":"reference/discovery/kubernetes/logconfig/#sources","title":"sources","text":"

    \u5728LogConfig\u4e2d\uff0c\u5982\u679ctype: pod\uff0cfile source\u65b0\u589e\u51e0\u4e2a\u4e13\u95e8\u9488\u5bf9\u5bb9\u5668\u5316\u7684\u53c2\u6570\uff1a

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 containerName string \u975e\u5fc5\u586b \u8868\u793a\u6307\u5b9a\u91c7\u96c6\u7684\u5bb9\u5668\u540d\u79f0\uff0c\u5efa\u8bae\u5728Pod\u91cc\u5305\u542b\u591a\u4e2a\u5bb9\u5668\u65f6\u586b\u5199 excludeContainerPatterns string\u6570\u7ec4 \u975e\u5fc5\u586b \u6392\u9664\u7684\u5bb9\u5668\u540d\u79f0\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u5f62\u5f0f matchFields struct \u975e\u5fc5\u586b \u5c06Pod\u4e2d\u7684label\u7b49\u4fe1\u606f\u52a0\u5165\u5230fields\u4e2d\u4f5c\u4e3a\u989d\u5916\u7684\u5b57\u6bb5\uff0c\u5177\u4f53\u8bf7\u53c2\u8003\u4e0b\u9762matchFields typePodFields map \u975e\u5fc5\u586b \u548c\u5168\u5c40\u914d\u7f6ediscovery.kubernetes\u4e2d\u7684typePodFields\u4e00\u6837\uff0c\u533a\u522b\u662f\u8fd9\u91cc\u4e3alogconfig\u7ea7\u522b\u751f\u6548"},{"location":"reference/discovery/kubernetes/logconfig/#matchfields","title":"matchFields","text":"

    \u975e\u5fc5\u586b, \u5c06Pod\u4e2d\u7684\u4fe1\u606f\u52a0\u5165\u5230Fields\u4e2d

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 labelKey string\u6570\u7ec4 \u975e\u5fc5\u586b \u6307\u5b9a\u589e\u52a0\u7684Pod\u4e0a\u7684Label Key\u503c\uff0c\u6bd4\u5982Pod\u4e0a\u5305\u542bLabel: app: demo\uff0c\u6b64\u5904\u586b\u5199labelKey: app\uff0c\u6b64\u65f6\u4f1a\u5c06Pod\u4e0a\u7684app: demo label\u589e\u52a0\u5230file source fields\u4e2d\uff0c\u91c7\u96c6\u5230\u7684\u65e5\u5fd7\u4f1a\u88ab\u52a0\u4e0a\u8be5label\u4fe1\u606f\u3002\u9002\u7528\u4e8e\u5339\u914d\u7684Pod\u7684label\u5b58\u5728\u4e0d\u4e00\u81f4\u7684\u573a\u666f\u3002\u652f\u6301\u914d\u7f6e\u4e3a\"*\"\u7684\u65b9\u5f0f\u83b7\u53d6\u6240\u6709\u7684label annotationKey string\u6570\u7ec4 \u975e\u5fc5\u586b \u548c\u4e0a\u9762labelKey\u7c7b\u4f3c\uff0c\u6ce8\u5165\u7684\u4e3aPod Annoatation\u7684\u503c\uff0c\u652f\u6301\u914d\u7f6e\u4e3a\"*\"\u7684\u65b9\u5f0f\u83b7\u53d6\u6240\u6709\u7684annotation env string\u6570\u7ec4 \u975e\u5fc5\u586b \u548c\u4e0a\u9762labelKey\u7c7b\u4f3c\uff0c\u6ce8\u5165\u7684\u4e3aPod Env\u73af\u5883\u53d8\u91cf\u7684\u503c\uff0c\u652f\u6301\u914d\u7f6e\u4e3a\"*\"\u7684\u65b9\u5f0f\u83b7\u53d6\u6240\u6709\u7684env reformatKeys \u975e\u5fc5\u586b \u91cd\u65b0\u683c\u5f0f\u5316key reformatKeys.label fmt\u53c2\u6570\u6570\u7ec4 \u975e\u5fc5\u586b \u91cd\u65b0\u683c\u5f0f\u5316label key\uff0c\uff0c\u8bf7\u53c2\u8003\u4e0b\u6587fmt\u53c2\u6570 reformatKeys.annotation fmt\u53c2\u6570\u6570\u7ec4 \u975e\u5fc5\u586b \u91cd\u65b0\u683c\u5f0f\u5316annotation key\uff0c\u8bf7\u53c2\u8003\u4e0b\u6587fmt\u53c2\u6570 reformatKeys.env fmt\u53c2\u6570\u6570\u7ec4 \u975e\u5fc5\u586b \u91cd\u65b0\u683c\u5f0f\u5316env key\uff0c\uff0c\u8bf7\u53c2\u8003\u4e0b\u6587fmt\u53c2\u6570"},{"location":"reference/discovery/kubernetes/logconfig/#fmt","title":"fmt","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 regex string \u975e\u5fc5\u586b \u5339\u914d\u7684\u6b63\u5219\u8868\u8fbe\u5f0f replace string \u975e\u5fc5\u586b \u91cd\u65b0\u6e32\u67d3\u7684\u683c\u5f0f

    reformatKeys

    \u5047\u8bbepod labels\u4e3aaa.bb/foo=bar \u914d\u7f6ereformatKeys\u5982\u4e0b\uff1a

    matchFields:\n reformatKeys:\n   label:\n   - regex: aa.bb/(.*)\n     replace: pre-${1}\n
    \u6700\u7ec8\u6dfb\u52a0\u5230\u65e5\u5fd7\u7684\u5143\u4fe1\u606f\u4e3a\uff1apre-foo=bar

    Example

    apiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: nginx\nnamespace: default\nspec:\nselector:\ntype: pod\nlabelSelector:\napp: nginx\npipeline:\nsources: |\n- type: file\nname: mylog\ncontainerName: nginx\nmatchFields:\nlabelKey: [\"app\"]\npaths:\n- stdout\n
    "},{"location":"reference/discovery/kubernetes/logconfig/#interceptors","title":"interceptors","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 interceptors string \u975e\u5fc5\u586b \u8868\u793a\u8be5Pipeline\u7684interceptor\uff0c\u4f7f\u7528\u65b9\u5f0f\u548c\u4ee5\u4e0asources\u7c7b\u4f3c"},{"location":"reference/discovery/kubernetes/logconfig/#sink","title":"sink","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sink string \u975e\u5fc5\u586b \u8868\u793a\u8be5Pipeline\u7684sink\uff0c\u4f7f\u7528\u65b9\u5f0f\u548c\u4ee5\u4e0a\u7684sources\u7c7b\u4f3c

    \u5982\u679c\u4f60\u5e0c\u671bsink\u548cinterceptor\u53ef\u4ee5\u5728\u4e0d\u540c\u7684ClusterLogConfig/LogConfig\u95f4\u590d\u7528\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0bref\u7684\u65b9\u5f0f\uff1a

    "},{"location":"reference/discovery/kubernetes/logconfig/#sinkref","title":"sinkRef","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sinkRef string \u975e\u5fc5\u586b \u8868\u793a\u8be5Pipeline\u5f15\u7528\u7684Sink CR"},{"location":"reference/discovery/kubernetes/logconfig/#interceptorref","title":"interceptorRef","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 interceptorRef string \u975e\u5fc5\u586b \u8868\u793a\u8be5Pipeline\u5f15\u7528\u7684Interceptor CR"},{"location":"reference/discovery/kubernetes/sink/","title":"Sink","text":"

    \u8868\u793a\u4e00\u4e2asink\u914d\u7f6e\u3002\u7528\u4e8e\u5728LogConfig/ClusterLogConfig\u4e2d\u88ab\u5f15\u7528\u3002

    Example

    apiVersion: loggie.io/v1beta1\nkind: Sink\nmetadata:\nname: default\nspec:\nsink: |\ntype: elasticsearch\nindex: \"loggie\"\nhosts: [\"elasticsearch-master.default.svc:9200\"]\n
    "},{"location":"reference/discovery/kubernetes/sink/#specsink","title":"spec.sink","text":"

    \u4f7f\u7528\"|\"\u7b26\u53f7\u8868\u793a\u4e00\u4e2asink\u914d\u7f6e\uff0c\u548cPipelines\u91cc\u7684\u914d\u7f6e\u4e00\u81f4\u3002

    "},{"location":"reference/global/args/","title":"\u542f\u52a8\u53c2\u6570","text":""},{"location":"reference/global/args/#_1","title":"\u7cfb\u7edf\u53c2\u6570","text":"

    Warning

    \u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679cconfig.pipeline=/etc/loggie\uff0cglob\u5339\u914d\u4f1a\u8ba4\u4e3a/etc/loggie\u4e3a/etc\u76ee\u5f55\u4e0b\u7684loggie\u6587\u4ef6\uff0c\u800c\u4e0d\u662f\u5339\u914d/etc/loggie\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\uff0c\u8bf7\u907f\u514d\u7c7b\u4f3c\u7684\u8bbe\u7f6e\u65b9\u5f0f

    "},{"location":"reference/global/args/#_2","title":"\u65e5\u5fd7\u53c2\u6570","text":"

    Info

    Loggie\u7684\u65e5\u5fd7\u8f6e\u8f6c\u4f7f\u7528lumberjack\u5e93

    "},{"location":"reference/global/db/","title":"db","text":"

    \u6301\u4e45\u5316\u6570\u636e\u7684\u914d\u7f6e\u3002\u4fdd\u5b58\u91c7\u96c6\u8fc7\u7a0b\u4e2d\u7684\u6587\u4ef6\u540d\u79f0\u3001\u6587\u4ef6inode\u3001\u6587\u4ef6\u91c7\u96c6\u7684offset\u7b49\u4fe1\u606f\u3002\u7528\u6765\u5728loggie reload\u6216\u8005\u91cd\u542f\u540e\u6062\u590d\u4e0a\u4e00\u6b21\u7684\u91c7\u96c6\u8fdb\u5ea6\u3002

    v1.5\u7248\u672c\u53ca\u4ee5\u540e\u65b0\u5f15\u5165\u4e86badger\u6301\u4e45\u5316\u5f15\u64ce\uff0c\u53ef\u66ff\u6362\u4e4b\u524d\u7684sqlite\uff0c\u907f\u514d\u4f7f\u7528CGO\u3002

    Caution

    \u8bf7\u6ce8\u610f\uff0c\u4e0d\u517c\u5bb9\u6539\u52a8\uff1a\u5728v1.5\u4e4b\u540e\uff08\u5305\u62ecv1.5\uff09\uff0cfile source\u4e2d\u7684db\u79fb\u52a8\u5230\u8fd9\u91cc\u4e3a\u5168\u5c40\u914d\u7f6e\u3002

    \u5982\u679c\u4ece\u4f4e\u7248\u672c\u5347\u7ea7\u5230v1.5\u53ca\u4ee5\u540e\u7248\u672c\uff0c\u8bf7\u52a1\u5fc5\u68c0\u67e5file source\u662f\u5426\u6709\u914d\u7f6e\u8fc7db\u3002\u5982\u679c\u6ca1\u6709\u914d\u7f6e\uff0c\u53ef\u5ffd\u7565\uff0c\u9ed8\u8ba4\u503c\u4f1a\u4fdd\u6301\u517c\u5bb9\u3002

    Example

    sqlitebadger
    db:\n  file: /opt/data/loggie.db\n
    db:\n  file: /opt/data/badger\n
    "},{"location":"reference/global/db/#file","title":"file","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 file string \u975e\u5fc5\u586b badger: ./data/badger\uff0csqlite: ./data/loggie.db \u6301\u4e45\u5316\u7684\u76ee\u5f55\u6587\u4ef6"},{"location":"reference/global/db/#flushtimeout","title":"flushTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 flushTimeout time.Duration \u975e\u5fc5\u586b 2s"},{"location":"reference/global/db/#buffersize","title":"bufferSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 bufferSize int \u975e\u5fc5\u586b 2048 \u6301\u4e45\u5316\u5199\u5165\u4f7f\u7528\u7684buffer"},{"location":"reference/global/db/#cleaninactivetimeout","title":"cleanInactiveTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cleanInactiveTimeout time.Duration \u975e\u5fc5\u586b 504h \u5982\u679c\u4e00\u6761\u8bb0\u5f55\u957f\u65f6\u95f4\u6ca1\u6709\u88ab\u66f4\u65b0\uff0c\u5219\u4f1a\u88ab\u6e05\u7406\uff0c\u9ed8\u8ba4\u4e3a21d(504h)"},{"location":"reference/global/db/#cleanscaninterval","title":"cleanScanInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cleanInactiveTimeout time.Duration \u975e\u5fc5\u586b 1h \u6e05\u7406\u903b\u8f91\u6267\u884c\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/global/defaults/","title":"Defaults","text":"

    defaults\u7528\u4e8e\u8bbe\u7f6ePipelines\u914d\u7f6e\u4e2d\u7684\u9ed8\u8ba4\u503c\u3002\u5f53Pipeline\u4e2d\u6ca1\u6709\u8bbe\u7f6e\u503c\u65f6\u751f\u6548\uff0c\u6216\u8005\u7528\u4e8e\u8986\u76d6\u9ed8\u8ba4\u7684\u53c2\u6570\u3002

    Example

    defaults:\nsources:\n- type: file\nwatcher:\ncleanFiles:\nmaxHistory: 10\nsink:\ntype: dev\nprintEvents: true\n
    "},{"location":"reference/global/defaults/#sources","title":"sources","text":"

    \u548cPipeline\u4e2d\u7684source\u4e00\u81f4\u3002\u5f53Pipelines\u914d\u7f6e\u4e86\u76f8\u540ctype\u7684source\u65f6\uff0c\u4f1a\u8986\u76d6\u5176\u4e2d\u672a\u586b\u5199\u5b57\u6bb5\u7684\u9ed8\u8ba4\u503c\u3002

    \u6bd4\u5982:

        sources:\n- type: file\nwatcher:\ncleanFiles:\nmaxHistory: 10\n
    \u5982\u679cPipeline\u914d\u7f6e\u4e86file source\uff0c\u6b64\u65f6\u53ef\u4ee5\u8bbe\u7f6e\u5168\u5c40\u7684\u6587\u4ef6\u6e05\u7406\u4fdd\u7559\u5929\u6570\u4e3a10\u5929\uff0c\u800c\u4e0d\u9700\u8981\u5728\u6bcf\u4e2aPipeline\u7684file source\u4e2d\u90fd\u8bbe\u7f6e\u4e00\u904d\u3002

    "},{"location":"reference/global/defaults/#sink","title":"sink","text":"

    \u548cPipeline\u4e2d\u7684sink\u4e00\u81f4\uff0c\u5982\u679c\u96c6\u7fa4\u53ea\u9700\u8981\u8bbe\u7f6e\u4e00\u4e2a\u5168\u5c40\u7684sink\u8f93\u51fa\u6e90\uff0c\u5219\u53ea\u9700\u8981\u5728\u8fd9\u91cc\u914d\u7f6e\u4e00\u6b21\uff0c\u907f\u514d\u5728\u6bcf\u4e2aPipeline\u4e2d\u586b\u5199\u3002

    "},{"location":"reference/global/defaults/#interceptors","title":"interceptors","text":"

    defaults\u4e2d\u914d\u7f6e\u7684interceptors\u4f1a\u6dfb\u52a0\u5230pipeline\u4e2d\u5b9a\u4e49\u7684interceptors\u4e2d\uff0c\u4f46pipeline\u4e2d\u7684interceptor\u4f1a\u8986\u76d6defaults\u4e2d\u7684\u540c\u4e00\u4e2atype\u7684interceptor\u3002 \u5982\u679c\u4e0d\u5e0c\u671b\u8986\u76d6\u76f8\u540c\u7c7b\u578b\u7684interceptor\uff0c\u800c\u662f\u6dfb\u52a0\u76f8\u540ctype\u7684interceptor\uff0c\u4f9d\u6b21\u8fdb\u884c\u5904\u7406\uff0c\u9700\u8981\u989d\u5916\u586b\u5199name\u5b57\u6bb5\uff0c\u8fdb\u884c\u552f\u4e00\u6027\u6807\u8bc6\u3002

    \u5728defaults\u4e2d\u5df2\u7ecf\u5b9a\u4e49normalize interceptor\u5982\u4e0b:

    defaults:\ninterceptors:\n- type: normalize\nprocessor:\n- addMeta: ~\n

    \u5982\u679c\u5728pipelines\u4e2d\u5b9a\u4e49\u5982\u4e0bnormalize interceptor\uff1a

    pipelines:\ninterceptors:\n- type: normalize\nprocessor:\n- drop:\n...\n

    \u6b64\u65f6defaults\u4e2d\u7684normalize interceptor\u4f1a\u88ab\u8986\u76d6\uff0c\u4e0d\u4f1a\u751f\u6548\u3002

    \u5982\u679c\u6211\u4eec\u5e0c\u671b\u5148\u6267\u884cdefaults\u4e2d\u7684normalize interceptor\uff0c\u63a5\u7740\u518d\u6267\u884cpipeline\u4e2d\u7684normalize interceptor\uff0c\u53ef\u4ee5\u5728defaults\u4e2d\u6539\u4e3a\uff1a

    defaults:\ninterceptors:\n- type: normalize\nname: global # \u7528\u4e8e\u533a\u5206pipelines\u4e2d\u7684normalize\norder: 500   # \u9ed8\u8ba4normalize\u7684order\u503c\u4e3a900\uff0c\u8fd9\u91cc\u5b9a\u4e49\u4e00\u4e2a\u76f8\u5bf9\u8f83\u5c0f\u503c\uff0c\u53ef\u63a7\u5236\u5148\u6267\u884cdefaults\u4e2d\u7684normalize\nprocessor:\n- addMeta: ~\n

    Loggie\u4f1a\u9ed8\u8ba4\u8bbe\u7f6emetric\u3001maxbytes\u3001retry3\u4e2a\u7cfb\u7edf\u5185\u7f6einterceptors\u3002 \u5982\u679c\u9700\u8981\u6dfb\u52a0\u5176\u4ed6\u7684\u9ed8\u8ba4interceptors\uff0c\u4f1a\u8986\u76d6\u6389\u4ee5\u4e0a\u7684\u5185\u7f6einterceptors\uff0c\u6240\u4ee5\u5f3a\u70c8\u5efa\u8bae\u6b64\u65f6\u5c06\u5185\u7f6einterceptors\u52a0\u4e0a\uff0c\u9664\u975e\u4f60\u786e\u8ba4\u4e0d\u9700\u8981\u4ee5\u4e0a\u7cfb\u7edf\u5185\u7f6e\u7684interceptors\u3002

    "},{"location":"reference/global/defaults/#queue","title":"queue","text":"

    \u9ed8\u8ba4\u4e3achannel queue\u3002

    "},{"location":"reference/global/discovery/","title":"Discovery","text":"

    \u670d\u52a1\u53d1\u73b0\u548c\u914d\u7f6e\u4e0b\u53d1\u76f8\u5173\u7684\u914d\u7f6e\u3002\u76ee\u524d\u4e3b\u8981\u4e3aKubernetes\u76f8\u5173\u5168\u5c40\u914d\u7f6e\u3002

    Example

    discovery:\nenabled: true\nkubernetes:\n# Choose: docker or containerd\ncontainerRuntime: containerd\n# Collect log files inside the container from the root filesystem of the container, no need to mount the volume\nrootFsCollectionEnabled: false\n# Automatically parse and convert the wrapped container standard output format into the original log content\nparseStdout: false\n# If set to true, it means that the pipeline configuration generated does not contain specific Pod paths and meta information,\n# and these data will be dynamically obtained by the file source, thereby reducing the number of configuration changes and reloads.\ndynamicContainerLog: false\n# Automatically add fields when selector.type is pod in logconfig/clusterlogconfig\ntypePodFields:\nlogconfig: \"${_k8s.logconfig}\"\nnamespace: \"${_k8s.pod.namespace}\"\nnodename: \"${_k8s.node.name}\"\npodname: \"${_k8s.pod.name}\"\ncontainername: \"${_k8s.pod.container.name}\"\ntypeNodeFields:\nnodename: \"${_k8s.node.name}\"\nclusterlogconfig: \"${_k8s.clusterlogconfig}\"\nos: \"${_k8s.node.nodeInfo.osImage}\"\n
    "},{"location":"reference/global/discovery/#enabled","title":"enabled","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u670d\u52a1\u53d1\u73b0\u914d\u7f6e\u4e0b\u53d1\u6a21\u5757"},{"location":"reference/global/discovery/#kubernetes","title":"Kubernetes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cluster string \u975e\u5fc5\u586b \"\" \u6807\u8bc6Loggie\u96c6\u7fa4\u540d\u79f0\u3002Loggie\u652f\u6301\u5728\u4e00\u4e2aKubernetes\u96c6\u7fa4\u4e2d\u90e8\u7f72\u591a\u5957Loggie\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728LogConfig CRD\u4e2d\u6307\u5b9aselector.cluster\uff0c\u6307\u5b9a\u914d\u7f6e\u4e0b\u53d1\u7684Loggie\u96c6\u7fa4 kubeconfig string \u975e\u5fc5\u586b \u6307\u5b9a\u8bf7\u6c42Kubernetes\u96c6\u7fa4API\u7684kubeconfig\u6587\u4ef6\u3002\u901a\u5e38\u5728Loggie\u90e8\u7f72\u5230Kubernetes\u96c6\u7fa4\u4e2d\u65e0\u9700\u586b\u5199\uff0c\u6b64\u65f6\u4e3ainCluster\u6a21\u5f0f\u3002\u5982\u679cLoggie\u90e8\u7f72\u5728Kubernetes\u96c6\u7fa4\u5916\uff08\u4f8b\u5982\u672c\u5730\u8c03\u8bd5\u65f6\uff09\uff0c\u9700\u8981\u6307\u5b9a\u8be5kubeconfig\u6587\u4ef6\u3002 master string \u975e\u5fc5\u586b \u6307\u5b9a\u8bf7\u6c42Kubernetes\u96c6\u7fa4API\u7684master\u5730\u5740\uff0cinCluster\u6a21\u5f0f\u4e00\u822c\u65e0\u9700\u586b\u5199 containerRuntime string \u975e\u5fc5\u586b docker \u5bb9\u5668\u8fd0\u884c\u65f6\uff0c\u53ef\u9009docker\u3001containerd\u3001none rootFsCollectionEnabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u91c7\u96c6root filesystem\u91cc\u7684\u65e5\u5fd7\uff0c\u7528\u4e8e\u4e0d\u6302\u8f7d\u65e5\u5fd7volume\u7684\u573a\u666f parseStdout bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u81ea\u52a8\u63d0\u53d6\u5bb9\u5668\u6807\u51c6\u8f93\u51fa\u539f\u59cb\u5185\u5bb9 dynamicContainerLog bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u52a8\u6001\u5bb9\u5668\u65e5\u5fd7\u914d\u7f6e\uff0c\u6253\u5f00\u540e\u914d\u7f6e\u6587\u4ef6\u4e0d\u4f1a\u6e32\u67d3\u5177\u4f53\u7684path\u548c\u52a8\u6001fields\u5b57\u6bb5\uff0c\u53ef\u4ee5\u6709\u6548\u907f\u514d\u5927\u89c4\u6a21\u5bb9\u5668\u5316\u573a\u666f\u91ccPod\u53d8\u52a8\u4ece\u800c\u5bfc\u81f4\u914d\u7f6e\u7684\u9891\u7e41\u6e32\u67d3\uff0c\u663e\u8457\u51cf\u5c11reload\u6b21\u6570\uff0c\u7279\u522b\u662f\u5728\u5355\u8282\u70b9\u7684Pod\u4e2a\u6570\u8f83\u591a\u548c\u4f7f\u7528clusterlogconfig\u5339\u914d\u5927\u91cf\u7684Pod\u65f6\u3002\u4e00\u822c\u5efa\u8bae\u8bbe\u7f6e\u4e3atrue\u3002 kubeletRootDir string \u975e\u5fc5\u586b /var/lib/kubelet kubelet\u7684root\u8def\u5f84 podLogDirPrefix string \u975e\u5fc5\u586b /var/log/pods kubernetes\u9ed8\u8ba4\u653e\u7f6e\u7684pod\u6807\u51c6\u8f93\u51fa\u8def\u5f84 hostRootMountPath string \u975e\u5fc5\u586b \u4f7f\u7528Loggie\u76f4\u63a5\u6302\u8f7d\u8282\u70b9root\u6839\u76ee\u5f55\u7684\u6a21\u5f0f\uff0c\u90e8\u7f72\u811a\u672c\u548c\u5347\u7ea7\u53c2\u8003\u8fd9\u91cc typePodFields map \u975e\u5fc5\u586b \u5f53logconfig/clusterlogconfig\u91ccselector\u4e3atype: pod\u65f6\uff0c\u81ea\u52a8\u6dfb\u52a0\u7684kubernetes\u76f8\u5173\u5143\u4fe1\u606f\uff0ckey\u5373\u4e3a\u6dfb\u52a0\u7684\u5143\u4fe1\u606fkey\uff0cvalue\u8bf7\u4f7f\u7528${_k8s.XX}\u7684\u65b9\u5f0f\u6307\u5b9a\uff0c\u540c\u65f6\u652f\u6301\u586b\u5199\u56fa\u5b9a\u503c\u7684key:value\u5b57\u6bb5 typeNodeFields map \u975e\u5fc5\u586b \u5f53logconfig/clusterlogconfig\u91ccselector\u4e3atype: node\u65f6\uff0c\u81ea\u52a8\u6dfb\u52a0\u7684kubernetes\u76f8\u5173\u5143\u4fe1\u606f\uff0ckey\u5373\u4e3a\u6dfb\u52a0\u7684\u5143\u4fe1\u606fkey\uff0cvalue\u8bf7\u4f7f\u7528${_k8s.XX}\u7684\u65b9\u5f0f\u6307\u5b9a\uff0c\u540c\u65f6\u652f\u6301\u586b\u5199\u56fa\u5b9a\u503c\u7684key:value\u5b57\u6bb5 fieldsOmitEmpty bool \u975e\u5fc5\u586b \u5ffd\u7565\u7a7a\u503c\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\uff0c\u6bd4\u5982\u5982\u679cevent\u4e2d\u6709logconfig: \"\"\uff0c\u5219\u6574\u4e2a\u5b57\u6bb5\u4e0d\u6dfb\u52a0 defaults \u975e\u5fc5\u586b defaults.sinkRef string \u975e\u5fc5\u586b \u5982\u679cLogConfig/clusterLogConfig\u4e2d\u6ca1\u6709\u914d\u7f6esinkRef\uff0c\u6240\u6709\u7684LogConfig/clusterLogConfig\u9ed8\u8ba4\u4f7f\u7528\u8be5sink\u3002 \u8bf7\u6ce8\u610f\u4f18\u5148\u7ea7\u8986\u76d6\u5173\u7cfb\uff1alogconfig\u4e2d\u7684sinkRef \u4f18\u5148\u4e8e default.sinkRef \u4f18\u5148\u4e8e \u5168\u5c40defaults\u91cc\u914d\u7f6e\u7684sink"},{"location":"reference/global/discovery/#typepodfields","title":"typePodFields\u652f\u6301\u7684\u53d8\u91cf","text":"

    \"${_k8s.XX}\"\u7684\u65b9\u5f0f\u53ef\u586b\u5199\u4ee5\u4e0b\u53c2\u6570\uff1a

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ${_k8s.logconfig} string \u975e\u5fc5\u586b \u6dfb\u52a0LogConfig name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.clusterlogconfig} string \u975e\u5fc5\u586b \u6dfb\u52a0ClusterLogConfig name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.name} string \u975e\u5fc5\u586b \u6dfb\u52a0\u6240\u5728\u8282\u70b9node name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.ip} string \u975e\u5fc5\u586b \u6dfb\u52a0\u6240\u5728\u8282\u70b9node ip\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.namespace} string \u975e\u5fc5\u586b \u6dfb\u52a0namespace\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.name} string \u975e\u5fc5\u586b \u6dfb\u52a0pod name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.ip} string \u975e\u5fc5\u586b \u6dfb\u52a0pod ip\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.uid} string \u975e\u5fc5\u586b \u6dfb\u52a0pod uid\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.container.name} string \u975e\u5fc5\u586b \u6dfb\u52a0container name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.container.id} string \u975e\u5fc5\u586b \u6dfb\u52a0container id\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.container.image} string \u975e\u5fc5\u586b \u6dfb\u52a0container image\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.workload.kind} string \u975e\u5fc5\u586b \u6dfb\u52a0pod\u5f52\u5c5e\u7684Deployment/Statefulset/DaemonSet/Job\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.workload.name} string \u975e\u5fc5\u586b \u6dfb\u52a0pod\u5f52\u5c5e\u7684Deployment/Statefulset/DaemonSet/Job\u540d\u79f0\u4f5c\u4e3a\u5143\u4fe1\u606f"},{"location":"reference/global/discovery/#typenodefields","title":"typeNodeFields\u652f\u6301\u7684\u53d8\u91cf","text":"

    \"${_k8s.XX}\"\u7684\u65b9\u5f0f\u53ef\u586b\u5199\u4ee5\u4e0b\u53c2\u6570\uff1a

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ${_k8s.clusterlogconfig} string \u975e\u5fc5\u586b \u6dfb\u52a0clusterlogconfig name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.name} string \u975e\u5fc5\u586b \u6dfb\u52a0\u6240\u5728\u8282\u70b9node name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.addresses.InternalIP} string \u975e\u5fc5\u586b \u6dfb\u52a0node InternalIP \u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.addresses.Hostname} string \u975e\u5fc5\u586b \u6dfb\u52a0node Hostname\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.kernelVersion} string \u975e\u5fc5\u586b \u6dfb\u52a0node kernelVersion\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.osImage} string \u975e\u5fc5\u586b \u6dfb\u52a0node osImage\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.containerRuntimeVersion} string \u975e\u5fc5\u586b \u6dfb\u52a0node containerRuntimeVersion\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.kubeletVersion} string \u975e\u5fc5\u586b \u6dfb\u52a0node kubeletVersion\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.kubeProxyVersion} string \u975e\u5fc5\u586b \u6dfb\u52a0node kubeProxyVersion\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.operatingSystem} string \u975e\u5fc5\u586b \u6dfb\u52a0node operatingSystem\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.architecture} string \u975e\u5fc5\u586b \u6dfb\u52a0node architecture\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.labels.<key>} string \u975e\u5fc5\u586b \u6dfb\u52a0node\u7684\u67d0\u4e2alabel\u4f5c\u4e3a\u5143\u4fe1\u606f\uff0c\u5176\u4e2d\u7684<key>\u8bf7\u66ff\u6362\u6210\u5177\u4f53\u7684label key ${_k8s.node.annotations.<key>} string \u975e\u5fc5\u586b \u6dfb\u52a0node\u7684\u67d0\u4e2aannotation\u4f5c\u4e3a\u5143\u4fe1\u606f\uff0c\u5176\u4e2d\u7684<key>\u8bf7\u66ff\u6362\u6210\u5177\u4f53\u7684annotation key"},{"location":"reference/global/http/","title":"Http","text":"

    Loggie\u81ea\u8eab\u63d0\u4f9b\u7684Http\u7aef\u53e3\uff0c\u5305\u542b\u76d1\u63a7metrics\uff0c\u5185\u90e8\u8fd0\u7ef4\u7b49\u63a5\u53e3\u3002

    Example

    http:\nenabled: true\nhost: \"0.0.0.0\"\nport: 9196\n
    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542fhttp host string \u975e\u5fc5\u586b 0.0.0.0 http\u76d1\u542c\u7684host port http \u975e\u5fc5\u586b 9196 http\u76d1\u63a7\u7684\u7aef\u53e3

    Tips

    \u4e00\u822c\u63a8\u8350\u6253\u5f00http\u7aef\u53e3\uff0c\u4f46\u662f\u5982\u679cKubernetes\u6216\u8005\u5bb9\u5668\u90e8\u7f72\u65f6\uff0c\u4f7f\u7528hostNetwork\u8bf7\u6ce8\u610f\u7aef\u53e3\u51b2\u7a81\uff0c\u4ee5\u53ca\u76d1\u542chost\u662f\u5426\u66b4\u9732\u7ed9\u516c\u7f51\u3001\u662f\u5426\u6709\u5b89\u5168\u9690\u60a3\u3002

    "},{"location":"reference/global/monitor/","title":"Monitor","text":"

    \u76d1\u63a7\u4e8b\u4ef6\u603b\u7ebf\uff0c\u6240\u6709\u7684\u7ec4\u4ef6\u90fd\u53ef\u4ee5\u53d1\u51fa\u81ea\u5df1\u7684metrics\u6307\u6807\u6570\u636e\uff0c\u7531listeners\u6d88\u8d39\u5904\u7406\u3002

    \u5177\u4f53\u8bf7\u53c2\u8003\u8fd9\u91cc\u3002

    Example

    monitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nsink: ~    
    "},{"location":"reference/global/reload/","title":"Reload","text":"

    reload\u4f1a\u5b9a\u65f6\u68c0\u67e5\u542f\u52a8\u53c2\u6570-config.pipeline\u6307\u5b9a\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5982\u679c\u68c0\u6d4b\u5230\u6587\u4ef6\u5185\u5bb9\u53d1\u751f\u53d8\u52a8\uff0c\u4f1a\u91cd\u542f\u6709\u53d8\u52a8\u914d\u7f6e\u7684Pipeline\uff0c\u672a\u88ab\u4fee\u6539\u7684Pipeline\u4e0d\u4f1a\u53d7\u5f71\u54cd\u3002

    Example

      reload:\nenabled: true\nperiod: 10s\n
    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542freload period time.Duration \u975e\u5fc5\u586b 10s reload\u68c0\u6d4b\u914d\u7f6e\u7684\u65f6\u95f4\u95f4\u9694\uff0c\u4e0d\u5efa\u8bae\u8bbe\u7f6e\u8fc7\u77ed\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u589e\u52a0CPU\u7684\u6d88\u8017"},{"location":"reference/global/subcmd/","title":"\u5b50\u547d\u4ee4","text":""},{"location":"reference/global/subcmd/#genfiles","title":"genfiles","text":"

    \u6a21\u62df\u4ea7\u751f\u65e5\u5fd7\u3002\u53ef\u7528\u4e8e\u65e5\u5fd7\u91c7\u96c6\u7684\u538b\u6d4b\u548c\u6d4b\u8bd5\u573a\u666f\u3002

    "},{"location":"reference/global/subcmd/#_2","title":"\u53c2\u6570","text":""},{"location":"reference/global/subcmd/#_3","title":"\u4f7f\u7528\u65b9\u5f0f","text":""},{"location":"reference/global/subcmd/#loggie","title":"\u4f7f\u7528loggie\u53ef\u6267\u884c\u6587\u4ef6","text":"
    LOG_DIR=/tmp/log ## log directory\nLOG_MAXSIZE=10 ## max size in MB of the logfile before it's rolled\nLOG_QPS=0 ## qps of line generate\nLOG_TOTAL=5 ## total line count\nLOG_LINE_BYTES=1024 ## bytes per line\nLOG_MAX_BACKUPS=5 ## max number of rolled files to keep\n\n./loggie genfiles -totalCount=${LOG_TOTAL} -lineBytes=${LOG_LINE_BYTES} -qps=${LOG_QPS} \\\n-log.maxBackups=${LOG_MAX_BACKUPS} -log.maxSize=${LOG_MAXSIZE} -log.directory=${LOG_DIR} -log.noColor=true \\\n-log.enableStdout=false -log.enableFile=true -log.timeFormat=\"2006-01-02 15:04:05.000\"\n

    \u793a\u4f8b\uff1a

    # Generate a log file loggie.log under /tmp/log, \n# which contains 1000 logs, each line of log is 1KB, and the total size is about 1.1MB\n\n\n./loggie genfiles -totalCount=1000 -lineBytes=1024 -qps=0 \\\n-log.maxBackups=1 -log.maxSize=1000 -log.directory=/tmp/log -log.noColor=true \\\n-log.enableStdout=false -log.enableFile=true -log.timeFormat=\"2006-01-02 15:04:05.000\"\n

    \u5728\u5bb9\u5668\u4e2d\u4f7f\u7528\uff0c\u8bf7\u53c2\u8003\u90e8\u7f72catalog\u4e2d\u7684deployment\uff0c\u5e76exec\u5230\u5176\u4e2d\u7684Pod\u4e2d\u6267\u884c\u4ee5\u4e0a\u547d\u4ee4\u3002

    "},{"location":"reference/global/subcmd/#_4","title":"\u672c\u5730\u6d4b\u8bd5","text":"

    \u793a\u4f8b\uff1a

    make genfiles LOG_TOTAL=1000\n
    \u5177\u4f53\u5176\u4ed6\u53c2\u6570\u53ef\u4ee5\u53c2\u8003\u9879\u76ee\u4e2d\u7684makefiles\u3002

    "},{"location":"reference/global/subcmd/#version","title":"version","text":"

    \u67e5\u770bLoggie\u7684\u7248\u672c\u3002

    "},{"location":"reference/global/subcmd/#_5","title":"\u53c2\u6570","text":"

    \u65e0

    "},{"location":"reference/global/subcmd/#_6","title":"\u4f7f\u7528\u65b9\u5f0f","text":"
    ./loggie version\n
    "},{"location":"reference/global/var/","title":"\u5b57\u6bb5\u52a8\u6001\u53d8\u91cf","text":"

    \u5728\u5f88\u591a\u573a\u666f\u4e0b\uff0c\u6211\u4eec\u5f80\u5f80\u9700\u8981\u52a8\u6001\u7684\u83b7\u53d6event\u91cc\u7684\u67d0\u4e2a\u5b57\u6bb5\u3002 \u6bd4\u5982\uff1a

    \u4ee5\u4e0bevent\u4e3a\u4f8b:

    {\n\"fields\": {\n\"svc\": \"test\",\n}\n}\n

    kafka sink topic\u914d\u7f6e\u4e3a\uff1alog-${fields.svc}\uff0c\u5219\u6700\u7ec8\u6e32\u67d3\u751f\u6210\u7684\u4e3alog-test\u3002

    Caution

    \u4e00\u822c\u53ef\u4ee5\u4f7f\u7528.\u70b9\u53f7\u6765\u8868\u793a\u5d4c\u5957\u7684\u5b57\u6bb5\u3002\u4f46\u662f\uff0c\u5982\u679c\u5b57\u6bb5\u672c\u8eab\u5c31\u5305\u62ec.\u53f7\uff0c\u5219\u9700\u8981\u4f7f\u7528[]\u5305\u56f4\u8d77\u6765\uff0c\u907f\u514d\u8bef\u8ba4\u4e3a\u662f\u4e00\u4e2a\u5d4c\u5957\u7684\u5b57\u6bb5\u3002 \u6bd4\u5982\uff1a

    {\n\"fields\": {\n\"a.b\": \"demo\",\n}\n}\n
    \u9700\u8981\u4f7f\u7528${fields.[a.b]}\u6765\u8868\u793a\u5b57\u6bb5a.b\u3002

    "},{"location":"reference/monitor/filesource/","title":"filesource listener","text":"

    \u5b9e\u65f6\u6587\u4ef6\u91c7\u96c6\u7684\u76d1\u63a7\uff0c\u8868\u793a\u5f53\u524d\u65e5\u5fd7\u91c7\u96c6\u7684\u8fdb\u5ea6\u4e0e\u72b6\u6001\uff0c\u5305\u62ec\u6587\u4ef6\u7684\u540d\u79f0\u3001\u91c7\u96c6\u8fdb\u5ea6\u3001QPS\u7b49\u3002

    "},{"location":"reference/monitor/filesource/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 period time.Duration \u975e\u5fc5\u586b 10s listener\u6d88\u8d39\u5904\u7406\u6570\u636e\u7684\u65f6\u95f4\u95f4\u9694 fieldsRef string\u6570\u7ec4 \u975e\u5fc5\u586b \u652f\u6301\u4ecesource fields\u914d\u7f6e\u5f53\u4e2d\u83b7\u53d6key value\u52a0\u5165\u5230metrics\u4e2d\u4e3alabel"},{"location":"reference/monitor/filesource/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/filesource/#file_size","title":"file_size","text":"
    # HELP file size\n# TYPE loggie_filesource_file_size gauge\nloggie_filesource_file_size{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\"} 2048\n
    "},{"location":"reference/monitor/filesource/#file_offset","title":"file_offset","text":"
    # HELP file offset\n# TYPE loggie_filesource_file_offset gauge\nloggie_filesource_file_offset{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\"} 1024\n
    "},{"location":"reference/monitor/filesource/#line_number","title":"line_number","text":"
    # HELP current read line number\n# TYPE loggie_filesource_line_number gauge\nloggie_filesource_line_number{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\"} 20\n
    "},{"location":"reference/monitor/filesource/#line_qps","title":"line_qps","text":"
    # HELP current read line qps\n# TYPE loggie_filesource_line_qps gauge\nloggie_filesource_line_qps{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\"} 48\n
    "},{"location":"reference/monitor/filewatcher/","title":"filewatcher listener","text":"

    \u5bf9\u6587\u4ef6\u91c7\u96c6\u60c5\u51b5\u7684\u5b9a\u65f6\u68c0\u67e5\u5e76\u66b4\u9732\u6307\u6807\uff0c\u5305\u62ec\u6587\u4ef6\u540d\u79f0\u3001ackOffset\u3001\u4fee\u6539\u65f6\u95f4\u3001\u5927\u5c0f\u7b49\u3002

    "},{"location":"reference/monitor/filewatcher/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 period time.Duration \u975e\u5fc5\u586b 5m \u5b9a\u65f6\u68c0\u67e5\u95f4\u9694\u65f6\u95f4 checkUnFinishedTimeout time.Duration \u975e\u5fc5\u586b 24h \u68c0\u67e5\u6587\u4ef6\u662f\u5426\u91c7\u96c6\u5b8c\u6bd5\u7684\u8d85\u65f6\u65f6\u95f4\uff0c\u5982\u679c\u68c0\u6d4b\u5230\u6587\u4ef6\u7684\u6700\u8fd1\u4fee\u6539\u65f6\u95f4\u4e3acheckUnFinishedTimeout\u4e4b\u524d\uff0c\u540c\u65f6\u6587\u4ef6\u7684\u5e76\u672a\u91c7\u96c6\u5b8c\u6bd5\uff0c\u5219\u4f1a\u5728metrics\u4e2d\u88ab\u6807\u8bb0\u4e3aunfinished\u72b6\u6001\uff0c\u53ef\u7528\u4e8e\u68c0\u67e5\u662f\u5426\u6709\u957f\u65f6\u95f4\u672a\u88ab\u91c7\u96c6\u7684\u65e5\u5fd7\u6587\u4ef6"},{"location":"reference/monitor/filewatcher/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/filewatcher/#_2","title":"\u5168\u5c40\u7ea7\u522b","text":""},{"location":"reference/monitor/filewatcher/#total_file_count","title":"total_file_count","text":"
    # HELP file count total\n# TYPE loggie_filewatcher_total_file_count gauge\nloggie_filewatcher_total_file_count{} 20\n
    "},{"location":"reference/monitor/filewatcher/#inactive_file_count","title":"inactive_file_count","text":"
    # HELP inactive file count\n# TYPE loggie_filewatcher_inactive_file_count gauge\nloggie_filewatcher_inactive_file_count{} 20\n
    "},{"location":"reference/monitor/filewatcher/#_3","title":"\u6587\u4ef6\u7ea7\u522b","text":"

    \u6587\u4ef6\u7ea7\u522b\u5305\u62ec\u4e86\u4ee5\u4e0bprometheus labels:

    \u7531\u4e8e\u5b9a\u65f6\u626b\u63cf\u7684\u65f6\u95f4\u95f4\u9694period\u9ed8\u8ba4\u4e3a5min\uff0c\u4ee5\u4e0b\u6307\u6807\u53ef\u80fd\u5b58\u5728\u4e00\u5b9a\u7a0b\u5ea6\u7684\u5ef6\u8fdf\u3002

    "},{"location":"reference/monitor/filewatcher/#file_size","title":"file_size","text":"
    # HELP file size\n# TYPE loggie_filewatcher_file_size gauge\nloggie_filewatcher_file_size{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\", status=\"pending\"} 2048\n
    "},{"location":"reference/monitor/filewatcher/#file_ack_offset","title":"file_ack_offset","text":"
    # HELP file ack offset\n# TYPE loggie_filewatcher_file_ack_offset gauge\nloggie_filewatcher_file_ack_offset{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\", status=\"pending\"} 1024\n
    "},{"location":"reference/monitor/filewatcher/#file_last_modify","title":"file_last_modify","text":"
    # HELP file last modify timestamp\n# TYPE loggie_filewatcher_file_last_modify gauge\nloggie_filewatcher_file_last_modify{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\", status=\"pending\"} 2343214422\n
    "},{"location":"reference/monitor/info/","title":"info listener","text":"

    \u5c55\u793aLoggie\u672c\u8eab\u7684\u4e00\u4e9b\u4fe1\u606f\u3002

    "},{"location":"reference/monitor/info/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 period time.Duration \u975e\u5fc5\u586b 10s \u66b4\u9732\u6307\u6807\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/monitor/info/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/info/#loggie_info_stat","title":"loggie_info_stat","text":"

    # HELP loggie_info_stat Loggie info\n# TYPE loggie_info_stat gauge\nloggie_info_stat{version=v1.4} 1\n
    \u5176\u4e2d\u7684version\u8868\u793aLoggie\u81ea\u8eab\u7684\u7248\u672c\u53f7\uff08\u7248\u672c\u53f7\u5728Loggie\u6784\u5efa\u7684\u65f6\u5019\u88ab\u6ce8\u5165\uff0c\u5982\u679c\u672a\u51fa\u73b0\u6b63\u786e\u7684\u7248\u672c\u53f7\uff0c\u8bf7\u68c0\u67e5\u4f7f\u7528go\u6784\u5efa\u7f16\u8bd1\u7684\u53c2\u6570\uff09\u3002

    "},{"location":"reference/monitor/logalert/","title":"logAlert listener","text":"

    \u7528\u4e8e\u65e5\u5fd7\u62a5\u8b66\u7684\u53d1\u9001\u3002 \u4f7f\u7528\u793a\u4f8b\u8bf7\u53c2\u8003\u65e5\u5fd7\u62a5\u8b66\u3002

    Example

    logAlert:\naddr: [ \"http://127.0.0.1:8080/loggie\" ]\nbufferSize: 100\nbatchTimeout: 10s\nbatchSize: 1\nlineLimit: 10\ntemplate: |\n*****\n
    "},{"location":"reference/monitor/logalert/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addr string\u6570\u7ec4 \u5fc5\u586b \u53d1\u9001alert\u7684http\u5730\u5740 bufferSize int \u975e\u5fc5\u586b 100 \u65e5\u5fd7\u62a5\u8b66\u53d1\u9001\u7684buffer\u5927\u5c0f\uff0c\u5355\u4f4d\u4e3a\u62a5\u8b66\u4e8b\u4ef6\u4e2a\u6570 batchTimeout time.Duration \u975e\u5fc5\u586b 10s \u6bcf\u4e2a\u62a5\u8b66\u53d1\u9001batch\u7684\u6700\u5927\u53d1\u9001\u65f6\u95f4 batchSize int \u975e\u5fc5\u586b 10 \u6bcf\u4e2a\u62a5\u8b66\u53d1\u9001batch\u7684\u6700\u5927\u5305\u542b\u62a5\u8b66\u8bf7\u6c42\u4e2a\u6570 template string \u975e\u5fc5\u586b \u6e32\u67d3\u53d1\u9001\u7684alert\u7ed3\u6784\u4f53\u7684go template\u6a21\u677f timeout time.Duration \u975e\u5fc5\u586b 30s \u53d1\u9001alert\u7684http timeout headers map \u975e\u5fc5\u586b \u53d1\u9001alert\u7684http header method string \u975e\u5fc5\u586b POST \u53d1\u9001alert\u7684http method, \u5982\u679c\u4e0d\u586bput(\u4e0d\u533a\u5206\u5927\u5c0f\u5199)\uff0c\u90fd\u8ba4\u4e3a\u662fPOST lineLimit int \u975e\u5fc5\u586b 10 \u591a\u884c\u65e5\u5fd7\u91c7\u96c6\u60c5\u51b5\u4e0b\uff0c\u6bcf\u4e2aalert\u4e2d\u5305\u542b\u7684\u6700\u5927\u65e5\u5fd7\u884c\u6570"},{"location":"reference/monitor/overview/","title":"Monitor","text":"

    \u76d1\u63a7\u4e8b\u4ef6\u603b\u7ebf\uff0c\u6240\u6709\u7684\u7ec4\u4ef6\u90fd\u53ef\u4ee5\u53d1\u51fa\u81ea\u5df1\u7684metrics\u6307\u6807\u6570\u636e\uff0c\u7531listeners\u6d88\u8d39\u5904\u7406\u3002

    Example

    monitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nsink: ~    
    "},{"location":"reference/monitor/overview/#logger","title":"logger","text":"

    Loggie\u652f\u6301\u5c06metrics\u6307\u6807\u8f93\u51fa\u5230\u65e5\u5fd7\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7logger\u914d\u7f6e\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 logger.enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f logger.period time.Duration \u975e\u5fc5\u586b 10s \u6307\u6807\u6253\u5370\u7684\u65f6\u95f4\u95f4\u9694\uff0c\u6570\u636e\u91cf\u8f83\u5927\u65f6\u5efa\u8bae\u5c06\u95f4\u9694\u5ef6\u957f\uff0c\u598230s\u30015m logger.pretty bool \u975e\u5fc5\u586b false \u6253\u5370\u7684\u6307\u6807json\u662f\u5426\u9700\u8981\u53cb\u597d\u5c55\u793a logger.additionLogEnabled bool \u975e\u5fc5\u586b false \u662f\u5426\u9700\u8981\u5c06\u6253\u5370\u7684\u6307\u6807\u5355\u72ec\u8f93\u51fa\u5230\u53e6\u5916\u7684\u65e5\u5fd7\u6587\u4ef6\u4e2d\uff0c\u5728\u6570\u636e\u91cf\u6bd4\u8f83\u591a\u7684\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u6211\u4eec\u914d\u7f6e\u7684\u6253\u5370\u65f6\u95f4\u95f4\u9694\u8f83\u77ed\uff0c\u53ef\u4ee5\u6253\u5f00\u8be5\u5f00\u5173\uff0c\u907f\u514d\u592a\u591a\u7684metrics\u65e5\u5fd7\u5e72\u6270 logger.additionLogConfig \u975e\u5fc5\u586b \u989d\u5916\u8f93\u51fa\u7684\u65e5\u5fd7\u914d\u7f6e\u53c2\u6570 logger.additionLogConfig.directory bool \u975e\u5fc5\u586b /data/loggie/log \u989d\u5916\u8f93\u51fa\u7684\u65e5\u5fd7\u76ee\u5f55 logger.additionLogConfig.maxBackups int \u975e\u5fc5\u586b metrics.log \u65e5\u5fd7\u8f6e\u8f6c\u6700\u591a\u4fdd\u7559\u7684\u6587\u4ef6\u4e2a\u6570\uff0c\u9ed8\u8ba4\u4e3a3 logger.additionLogConfig.maxSize int \u975e\u5fc5\u586b 1024 \u65e5\u5fd7\u8f6e\u8f6c\u7684\u65f6\u5019\uff0c\u6700\u5927\u7684\u6587\u4ef6\u5927\u5c0f\uff0c\u5355\u4f4d\u4e3aMB logger.additionLogConfig.maxAge int \u975e\u5fc5\u586b 14 \u65e5\u5fd7\u8f6e\u8f6c\u6700\u5927\u4fdd\u7559\u7684\u5929\u6570 logger.additionLogConfig.timeFormat string \u975e\u5fc5\u586b 2006-01-02 15:04:05 \u6bcf\u884c\u65e5\u5fd7\u8f93\u51fa\u7684\u65f6\u95f4\u683c\u5f0f"},{"location":"reference/monitor/overview/#listeners","title":"listeners","text":"

    \u8868\u793a\u5177\u4f53\u542f\u52a8\u7684listeners\u3002 \u914d\u7f6e\u4e0d\u586b\u5199\u5373\u4e3a\u5173\u95ed\uff0c\u4e0d\u542f\u52a8\u8be5Listener\uff0c\u76f8\u5173\u7684\u7684\u6307\u6807\u4e5f\u4e0d\u4f1a\u88ab\u5904\u7406\u548c\u66b4\u9732\u3002

    "},{"location":"reference/monitor/queue/","title":"queue listener","text":""},{"location":"reference/monitor/queue/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 period time.Duration \u975e\u5fc5\u586b 10s listener\u6d88\u8d39\u5904\u7406\u6570\u636e\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/monitor/queue/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/queue/#capacity","title":"capacity","text":"
    # HELP queue capacity\n# TYPE loggie_queue_capacity gauge\nloggie_queue_capacity{pipeline=\"xxx\", type=\"channel\"} 2048\n
    "},{"location":"reference/monitor/queue/#size","title":"size","text":"
    # HELP queue size\n# TYPE loggie_queue_size gauge\nloggie_queue_size{pipeline=\"xxx\", type=\"channel\"} 2048\n
    "},{"location":"reference/monitor/queue/#fill_percentage","title":"fill_percentage","text":"
    # HELP how full is queue\n# TYPE loggie_queue_fill_percentage gauge\nloggie_queue_fill_percentage{pipeline=\"xxx\", type=\"channel\"} 50\n
    "},{"location":"reference/monitor/reload/","title":"reload listener","text":"

    reload\u7684\u6307\u6807\uff0c\u603b\u7684reload\u6b21\u6570\u3002

    "},{"location":"reference/monitor/reload/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/reload/#total","title":"total","text":"
    # HELP Loggie reload total count\n# TYPE loggie_reload_total gauge\nloggie_reload_total{} 10\n
    "},{"location":"reference/monitor/sink/","title":"sink listener","text":"

    sink\u53d1\u9001\u7aef\u7684\u76d1\u63a7\u6307\u6807\u5904\u7406\uff0c\u5305\u62ec\u53d1\u9001\u6210\u529f\u7684event\u6570\u91cf\u3001\u53d1\u9001\u5931\u8d25\u7684event\u6570\u91cf\u3001event qps\u7b49

    "},{"location":"reference/monitor/sink/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 period time.Duration \u975e\u5fc5\u586b 10s listener\u6d88\u8d39\u5904\u7406\u6570\u636e\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/monitor/sink/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/sink/#success_event","title":"success_event","text":"
    # HELP send event success count\n# TYPE loggie_sink_success_event gauge\nloggie_sink_success_event{pipeline=\"xxx\", source=\"access\"} 2048\n
    "},{"location":"reference/monitor/sink/#failed_event","title":"failed_event","text":"
    # HELP send event failed count\n# TYPE loggie_sink_failed_event gauge\nloggie_sink_failed_event{pipeline=\"xxx\", source=\"access\"} 2048\n
    "},{"location":"reference/monitor/sink/#event_qps","title":"event_qps","text":"
    # HELP send success event failed count\n# TYPE loggie_sink_event_qps gauge\nloggie_sink_event_qps{pipeline=\"xxx\", source=\"access\"} 2048\n
    "},{"location":"reference/monitor/sys/","title":"sys listener","text":"

    Loggie\u672c\u8eab\u7684CPU\u548cMemory\u6307\u6807

    "},{"location":"reference/monitor/sys/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 period time.Duration \u975e\u5fc5\u586b 10s listener\u6d88\u8d39\u5904\u7406\u6570\u636e\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/monitor/sys/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/sys/#cpu_percent","title":"cpu_percent","text":"
    # HELP loggie_sys_cpu_percent Loggie cpu percent\n# TYPE loggie_sys_cpu_percent gauge\nloggie_sys_cpu_percent 0.37\n
    "},{"location":"reference/monitor/sys/#mem_rss","title":"mem_rss","text":"
    # HELP loggie_sys_mem_rss Loggie memory rss bytes\n# TYPE loggie_sys_mem_rss gauge\nloggie_sys_mem_rss 2.5853952e+07\n
    "},{"location":"reference/pipelines/interceptor/addhostmeta/","title":"addHostMeta","text":"

    \u7528\u4e8e\u4e3b\u673a\u90e8\u7f72\u60c5\u51b5\u4e0b\uff0c\u65b0\u589e\u4e3b\u673a\u7684\u4e00\u4e9b\u5143\u4fe1\u606f\u53c2\u6570\u3002

    Example

    interceptors:\n- type: addHostMeta\naddFields:\nhostname: \"${hostname}\"\nip: \"${ip}\"\nos: \"${os}\"\nplatform: \"${platform}\"\nkernelVersion: \"${kernelVersion}\"\nkernelArch: \"${kernelArch}\"\n
    "},{"location":"reference/pipelines/interceptor/addhostmeta/#addfields","title":"addFields","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addFields map \u5fc5\u586b \u9700\u8981\u6dfb\u52a0\u7684\u5143\u4fe1\u606f

    \u76ee\u524d\u652f\u6301\u6dfb\u52a0\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\u6709\uff1a

    \u52a0\u4e0a\u4ee5\u4e0a\u7684\u5143\u4fe1\u606f\uff0c\u5c55\u793a\u51fa\u7684\u65e5\u5fd7\u793a\u4f8b\uff1a

    Example

     {\n\"@timestamp\": \"2023-07-13T07:13:50.394Z\",\n\"host\": {\n\"kernelVersion\": \"22.2.0\",\n\"os\": \"darwin\",\n\"platform\": \"darwin\",\n\"platformFamily\": \"Standalone Workstation\",\n\"platformVersion\": \"13.1\",\n\"hostname\": \"xxxMacBook-Pro.local\",\n\"ip\": [\n\"10.xxx.xxx.221\",\n\"192.xxx.xxx.1\"\n],\n\"kernelArch\": \"arm64\"\n},\n\"body\": \"xxx\"\n}\n
    "},{"location":"reference/pipelines/interceptor/addhostmeta/#fieldsname","title":"fieldsName","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fieldsName string \u975e\u5fc5\u586b host \u6dfb\u52a0\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\u540d\u79f0"},{"location":"reference/pipelines/interceptor/addk8smeta/","title":"addK8sMeta","text":"

    \u7528\u4e8e\u4eceevent\u4e2d\u7684\u67d0\u4e9b\u5b57\u6bb5\uff08\u6bd4\u5982\u65e5\u5fd7\u6587\u4ef6\u7684\u8def\u5f84\u4e2d\uff09\uff0c\u83b7\u53d6\u5230\uff1a

    \u4ee5\u4e0a3\u79cd\u4efb\u610f\u5176\u4e00\u7684\u7d22\u5f15\u4fe1\u606f\uff0c\u6b64\u65f6Loggie\u53ef\u6839\u636e\u8be5\u7d22\u5f15\u67e5\u8be2\u5230\u5177\u4f53\u7684Pod\uff0c\u5e76\u6dfb\u52a0\u989d\u5916\u7684kubernetes${node.name}\u3001${namespace}\u3001${pod.uid}\u3001${pod.name}\u7b49\u5143\u4fe1\u606f\u4f5c\u52a0\u5165\u5230event\u4e2d\uff0c\u7528\u4e8e\u540e\u7eed\u7684\u5206\u6790\u5904\u7406\u3002 \u5c5e\u4e8esource interceptor\u3002

    Example

    interceptors:\n- type: addK8sMeta\npattern: \"/var/log/${pod.uid}/${pod.name}/\"\naddFields:\nnodename: \"${node.name}\"\nnamespace: \"${namespace}\"\npodname: \"${pod.name}\"\n
    "},{"location":"reference/pipelines/interceptor/addk8smeta/#pattern","title":"pattern","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 pattern string \u5fc5\u586b \u63d0\u53d6\u5b57\u6bb5\u7684\u5339\u914d\u6a21\u578b

    \u5fc5\u987b\u5305\u542b\u6709\uff1a

    \u5176\u4e2d\u4e4b\u4e00\u3002

    \u6bd4\u5982\uff1a/var/log/${pod.uid}/${pod.name}/

    "},{"location":"reference/pipelines/interceptor/addk8smeta/#patternfields","title":"patternFields","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 patternFields string \u975e\u5fc5\u586b \u9ed8\u8ba4\u4f1a\u4eceevent\u4e2d\u83b7\u53d6\u7cfb\u7edf\u5b57\u6bb5\u91cc\u7684filename\uff0c\u6b64\u65f6\u9700\u8981\u4f7f\u7528file source \u4eceevent\u4e2d\u7528\u4e8e\u63d0\u53d6\u7684pattern\u7684\u5b57\u6bb5"},{"location":"reference/pipelines/interceptor/addk8smeta/#fieldsname","title":"fieldsName","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fieldsName string \u975e\u5fc5\u586b kubernetes \u6dfb\u52a0\u5143\u4fe1\u606f\u7684\u5b57\u6bb5"},{"location":"reference/pipelines/interceptor/addk8smeta/#addfields","title":"addFields","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addFields map \u975e\u5fc5\u586b \u9700\u8981\u6dfb\u52a0\u7684\u5143\u4fe1\u606f

    \u76ee\u524d\u652f\u6301\u6dfb\u52a0\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\u6709\uff1a

    "},{"location":"reference/pipelines/interceptor/limit/","title":"rateLimit","text":"

    \u7528\u4e8e\u65e5\u5fd7\u9650\u6d41\u3002 \u5c5e\u4e8esource interceptor\u3002

    Example

    interceptors:\n- type: rateLimit\nqps: 4000\n
    "},{"location":"reference/pipelines/interceptor/limit/#qps","title":"qps","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 qps int \u975e\u5fc5\u586b 2048 \u9650\u6d41qps"},{"location":"reference/pipelines/interceptor/logalert/","title":"logAlert","text":"

    \u7528\u4e8e\u65e5\u5fd7\u62a5\u8b66\u68c0\u6d4b\u3002 \u5c5e\u4e8esource interceptor\u3002 \u4f7f\u7528\u793a\u4f8b\u8bf7\u53c2\u8003\u65e5\u5fd7\u62a5\u8b66\u3002

    Example

    interceptors:\n- type: logAlert\nmatcher:\ncontains: [\"error\", \"err\"]\nregexp: ['.*example.*']\nignore: ['.*INFO.*']\nsendOnlyMatched: true\nadditions:\nmodule: \"loggie\"\nalertname: \"alert-test\"\ncluster: \"local-cluster\"\nnamespace: \"default\"\nadvanced:\nenabled: true\nmode: [ \"noData\",\"regexp\" ]\nduration: 6h\nmatchType: \"any\"\nrules:\n- regexp: '(?<date>.*?) (?<time>[\\S|\\\\.]+)  (<status>[\\S|\\\\.]+) (?<u>.*?) --- (?<thread>\\[*?\\]) (?<pkg>.*) : (?<message>(.|\\n|\\t)*)'\nmatchType: \"any\"\ngroups:\n- key: status\noperator: \"eq\"\nvalue: WARN\n- key: thread\noperator: \"eq\"\nvalue: 200\n- regexp: '(?<date>.*?) (?<time>[\\S|\\\\.]+) (?<status>[\\S|\\\\.]+) (?<u>.*?) --- (?<thread>\\[.*?\\]) (?<pkg>.*) : (?<message>(.|\\n|\\t)*)'\nmatchType: \"any\"\ngroups:\n- key: status\noperator: \"eq\"\nvalue: ERROR\n
    "},{"location":"reference/pipelines/interceptor/logalert/#matcher","title":"matcher","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 matcher.contains string\u6570\u7ec4 \u975e\u5fc5\u586b \u65e5\u5fd7\u6570\u636e\u5305\u542b\u5b57\u7b26\u4e32\u68c0\u6d4b matcher.regexp string\u6570\u7ec4 \u975e\u5fc5\u586b \u65e5\u5fd7\u6570\u636e\u6b63\u5219\u68c0\u6d4b matcher.target string \u975e\u5fc5\u586b body \u6839\u636e\u65e5\u5fd7\u6570\u636e\u7684\u8be5\u5b57\u6bb5\u8fdb\u884c\u68c0\u6d4b\uff0c\u5982\u679c\u8fdb\u884c\u65e5\u5fd7\u5207\u5206\u6216\u8005drop body\u5b57\u6bb5\uff0c\u8bf7\u586b\u5199\u6240\u9700\u5b57\u6bb5"},{"location":"reference/pipelines/interceptor/logalert/#ignore","title":"ignore","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ignore string\u6570\u7ec4 \u975e\u5fc5\u586b \u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u82e5\u5339\u914d\uff0c\u5219\u5ffd\u7565\u8fd9\u6761\u65e5\u5fd7\uff0c\u5411\u4e0b\u4f20\u9012\uff0c\u53ef\u7528\u4e8e\u544a\u8b66\u65f6\u6392\u9664\u67d0\u4e9b\u65e5\u5fd7"},{"location":"reference/pipelines/interceptor/logalert/#additions","title":"additions","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 additions map \u975e\u5fc5\u586b \u53d1\u9001alert\u65f6\uff0c\u989d\u5916\u6dfb\u52a0\u7684\u5b57\u6bb5\uff0c\u4f1a\u653e\u5728_additions\u5b57\u6bb5\u4e2d\uff0c\u53ef\u7528\u4f5c\u6e32\u67d3\u3002"},{"location":"reference/pipelines/interceptor/logalert/#sendonlymatched","title":"sendOnlyMatched","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sendOnlyMatched bool \u975e\u5fc5\u586b false \u662f\u5426\u4ec5\u5c06\u5339\u914d\u6210\u529f\u7684\u6570\u636e\u53d1\u9001\u81f3sink"},{"location":"reference/pipelines/interceptor/logalert/#advanced","title":"advanced","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u9ad8\u7ea7\u5339\u914d\u6a21\u5f0f mode string\u5217\u8868 \u975e\u5fc5\u586b \u5339\u914d\u6a21\u5f0f \u652f\u6301regexp\u548cnoData\u4e24\u79cd\uff0c\u53ef\u540c\u65f6\u751f\u6548\u3002 duration time.Duration \u975e\u5fc5\u586b noData\u6a21\u5f0f\u5fc5\u586b\uff0c\u5728\u4e00\u5b9a\u65f6\u95f4\u5185\uff0c\u6ca1\u6709\u65e5\u5fd7\u4f1a\u53d1\u51fa\u544a\u8b66\u3002 matchType string \u975e\u5fc5\u586b regexp\u6a21\u5f0f\u5fc5\u586b\uff0c\u53ef\u9009any\u6216\u8005all\uff0c\u8868\u793a\u5339\u914d\u4efb\u610f\u6216\u8005\u5168\u90e8\u89c4\u5219rule rules Rule\u5217\u8868 \u975e\u5fc5\u586b regexp\u6a21\u5f0f\u5fc5\u586b\uff0c\u5339\u914d\u89c4\u5219\u5217\u8868"},{"location":"reference/pipelines/interceptor/logalert/#advancedrule","title":"advanced.rule","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 regexp string \u5fc5\u586b \u6b63\u5219\u5206\u7ec4\u8868\u8fbe\u5f0f matchType string \u5fc5\u586b \u53ef\u9009any\u6216\u8005all\uff0c\u8868\u793a\u5339\u914d\u4efb\u610f\u6216\u8005\u5168\u90e8\u5339\u914d\u7ec4group groups group\u5217\u8868 \u5fc5\u586b \u5339\u914d\u7ec4\u5217\u8868"},{"location":"reference/pipelines/interceptor/logalert/#advancedrulegroup","title":"advanced.rule.group","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 key string \u5fc5\u586b \u5206\u7ec4\u5339\u914d\u4e4b\u540e\u7684\u952e\u503c operator string \u5fc5\u586b \u64cd\u4f5c\u7b26\uff0c\u76ee\u524d\u652f\u6301eq\uff0cgt\uff0clt value string \u5fc5\u586b \u76ee\u6807\u503c"},{"location":"reference/pipelines/interceptor/maxbytes/","title":"maxbytes","text":"

    \u5bf9\u539f\u59cb\u5355\u884c\u65e5\u5fd7\u7684\u5927\u5c0f\u8fdb\u884c\u9650\u5236\uff0c\u907f\u514d\u5355\u884c\u65e5\u5fd7\u6570\u636e\u91cf\u592a\u5927\u5f71\u54cdLoggie\u5185\u5b58\u548c\u7a33\u5b9a\u6027\u3002 \u7cfb\u7edf\u5185\u7f6e\uff0c\u9ed8\u8ba4\u52a0\u8f7d\uff0c\u5c5e\u4e8esource interceptor\u3002

    Example

    interceptors:\n- type: maxbytes\nmaxBytes: 102400\n
    "},{"location":"reference/pipelines/interceptor/maxbytes/#maxbytes_1","title":"maxBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxBytes int \u975e\u5fc5\u586b 131072(128KB) \u5355\u884c\u6700\u5927\u5b57\u8282\u4e2a\u6570\uff0c\u8d85\u51fa\u7684\u90e8\u5206\u5c06\u4f1a\u88ab\u4e22\u5f03"},{"location":"reference/pipelines/interceptor/maxbytes/#target","title":"target","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 target string \u975e\u5fc5\u586b body \u76ee\u6807\u5b57\u6bb5"},{"location":"reference/pipelines/interceptor/metrics/","title":"metric","text":"

    \u5bf9\u6570\u636e\u4f20\u8f93\u8fdb\u884c\u91c7\u6837metics\uff0c\u63d0\u4f9b\u7ed9monitor eventbus\u4e2dlistener\u4f7f\u7528\u3002 \u7cfb\u7edf\u5185\u7f6e\uff0c\u9ed8\u8ba4\u52a0\u8f7d\uff0c\u5c5e\u4e8esink interceptor\u3002

    Example

    interceptors:\n- type: metric\n
    "},{"location":"reference/pipelines/interceptor/normalize/","title":"normalize","text":"

    \uff08\u8be5interceptor\u540e\u7eed\u4e0d\u518d\u7ef4\u62a4\uff0c\u5efa\u8bae\u4f7f\u7528transformer\u66ff\u6362\uff09

    \u7528\u4e8e\u65e5\u5fd7\u5207\u5206\u5904\u7406\u3002 \u5c5e\u4e8esource interceptor\u3002\u53ef\u6307\u5b9a\u53ea\u88ab\u67d0\u4e9bsource\u4f7f\u7528\u3002

    "},{"location":"reference/pipelines/interceptor/normalize/#processors","title":"processors","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 processors \u6570\u7ec4 \u5fc5\u586b \u65e0 \u6240\u6709\u7684\u5904\u7406processor\u5217\u8868

    \u914d\u7f6e\u7684processor\u5c06\u6309\u7167\u987a\u5e8f\u4f9d\u6b21\u6267\u884c\u3002

    Tips

    Loggie\u652f\u6301\u4f7f\u7528a.b\u7684\u5f62\u5f0f\u5f15\u7528\u5d4c\u5957\u7684\u5b57\u6bb5\u3002 \u6bd4\u5982\u6570\u636e\u4e3a:

    {\n\"fields\": {\n\"hello\": \"world\"\n}\n}\n
    \u4e0b\u9762\u7684processor\u914d\u7f6e\u4e2d\u5747\u53ef\u4ee5\u4f7f\u7528fields.hello\u6307\u5b9a\u5d4c\u5957\u5728fields\u91cc\u7684hello: world\u3002

    "},{"location":"reference/pipelines/interceptor/normalize/#addmeta","title":"addMeta","text":"

    \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cLoggie\u4e0d\u4f1a\u6dfb\u52a0\u4efb\u4f55\u7684\u7cfb\u7edf\u5185\u90e8\u4fe1\u606f\u5230\u539f\u59cb\u6570\u636e\u4e2d\u3002 \u53ef\u901a\u8fc7addMeta\u6dfb\u52a0\u7cfb\u7edf\u5185\u7f6e\u5b57\u6bb5\u53d1\u9001\u7ed9\u4e0b\u6e38\u3002

    Note

    \u8bf7\u6ce8\u610f\uff0c\u5728pipeline\u4e2d\u914d\u7f6eaddMeta\uff0c\u53ea\u4f1a\u5f71\u54cd\u8be5pipeline\u53d1\u9001\u7684\u6240\u6709\u6570\u636e\uff0c\u5982\u679c\u9700\u8981\u5168\u5c40\u751f\u6548\uff0c\u8bf7\u5728defaults\u4e2d\u914d\u7f6enormalize.addMeta\u3002

    loggie:\n  defaults:\n    interceptors:\n    - type: normalize\n      name: global\n      processors:\n       - addMeta: ~\n
    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 target string \u975e\u5fc5\u586b meta \u7cfb\u7edf\u5185\u7f6e\u5b57\u6bb5\u6dfb\u52a0\u5230event\u4e2d\u7684\u5b57\u6bb5\u540d"},{"location":"reference/pipelines/interceptor/normalize/#regex","title":"regex","text":"

    \u5c06\u6307\u5b9a\u5b57\u6bb5\u8fdb\u884c\u6b63\u5219\u63d0\u53d6\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 regex.pattern string \u5fc5\u586b \u65e0 \u6b63\u5219\u89e3\u6790\u89c4\u5219 regex.target string \u975e\u5fc5\u586b body \u6b63\u5219\u89e3\u6790\u7684\u76ee\u6807\u5b57\u6bb5 regex.ignoreError bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u9519\u8bef

    Example

    interceptors:\n- type: normalize\nprocessors:\n- regex:\npattern: '(?<ip>\\S+) (?<id>\\S+) (?<u>\\S+) (?<time>\\[.*?\\]) (?<url>\\\".*?\\\") (?<status>\\S+) (?<size>\\S+)'\n

    \u4f7f\u7528\u4ee5\u4e0a\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u53ef\u4ee5\u5c06\u4ee5\u4e0b\u793a\u4f8b\u7684\u65e5\u5fd7\uff1a

    10.244.0.1 - - [13/Dec/2021:12:40:48 +0000] \"GET / HTTP/1.1\" 404 683\n
    \u8f6c\u6362\u6210\uff1a
    \"ip\": \"10.244.0.1\",\n\"id\": \"-\",\n\"u\": \"-\",\n\"time\": \"[13/Dec/2021:12:40:48 +0000]\",\n\"url\": \"\\\"GET / HTTP/1.1\\\"\",\n\"status\": \"404\",\n\"size\": \"683\"\n

    \u5177\u4f53\u914d\u7f6e\u7684\u65f6\u5019\uff0c\u5efa\u8bae\u5148\u4f7f\u7528\u4e00\u4e9b\u6b63\u5219\u8c03\u8bd5\u5de5\u5177 (https://regex101.com/) \u9a8c\u8bc1\u662f\u5426\u53ef\u4ee5\u5339\u914d\u3002

    "},{"location":"reference/pipelines/interceptor/normalize/#jsondecode","title":"jsonDecode","text":"

    \u5c06\u6307\u5b9a\u5b57\u6bb5json\u89e3\u6790\u63d0\u53d6\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 jsonDecode.target string \u975e\u5fc5\u586b body json decode\u7684\u76ee\u6807\u5b57\u6bb5 jsonDecode.ignoreError bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u9519\u8bef

    Example

    interceptors:\n- type: normalize\nprocessors:\n- jsonDecode: ~\n
    "},{"location":"reference/pipelines/interceptor/normalize/#split","title":"split","text":"

    \u5c06\u6307\u5b9a\u5b57\u6bb5\u901a\u8fc7\u5206\u9694\u7b26\u8fdb\u884c\u63d0\u53d6\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 split.target string \u975e\u5fc5\u586b body split\u7684\u76ee\u6807\u5b57\u6bb5 split.separator string \u5fc5\u586b \u65e0 \u5206\u9694\u7b26 split.max int \u975e\u5fc5\u586b -1 \u901a\u8fc7\u5206\u5272\u7b26\u5206\u5272\u540e\u5f97\u5230\u7684\u6700\u591a\u7684\u5b57\u6bb5\u6570 split.keys string\u6570\u7ec4 \u5fc5\u586b \u65e0 \u5206\u5272\u540e\u5b57\u6bb5\u5bf9\u5e94\u7684key split.ignoreError bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u9519\u8bef

    Example

    basemax

    interceptors:\n- type: normalize\nprocessors:\n- split:\nseparator: '|'\nkeys: [\"time\", \"order\", \"service\", \"price\"]\n
    \u4f7f\u7528\u4ee5\u4e0asplit\u914d\u7f6e\u53ef\u4ee5\u5c06\u65e5\u5fd7\uff1a
    2021-08-08|U12345|storeCenter|13.14\n
    \u8f6c\u6362\u6210\uff1a
    \"time\": \"2021-08-08\"\n\"order\": \"U12345\"\n\"service\": \"storeCenter\"\n\"price\": 13.14\n

    interceptors:\n- type: normalize\nprocessors:\n- split:\nseparator: ' '\nmax: 2\nkeys: [\"time\", \"content\"]\n
    \u901a\u8fc7\u589e\u52a0max\u53c2\u6570\uff0c\u53ef\u4ee5\u63a7\u5236\u6700\u591a\u5206\u5272\u7684\u5b57\u6bb5\u3002 \u6bd4\u5982\u4ee5\u4e0b\u65e5\u5fd7:
    2021-08-08 U12345 storeCenter 13.14\n
    \u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0a\u914d\u7f6e\u63d0\u53d6\u4e3a:
    \"time\": \"2021-08-08\"\n\"content\": \"U12345 storeCenter 13.14\"\n

    "},{"location":"reference/pipelines/interceptor/normalize/#drop","title":"drop","text":"

    \u4e22\u5f03\u6307\u5b9a\u5b57\u6bb5\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 drop.targets string\u6570\u7ec4 \u5fc5\u586b \u65e0 drop\u7684\u5b57\u6bb5

    Example

    interceptors:\n- type: normalize\nprocessors:\n- drop:\ntargets: [\"id\", \"body\"]\n
    "},{"location":"reference/pipelines/interceptor/normalize/#rename","title":"rename","text":"

    \u91cd\u547d\u540d\u6307\u5b9a\u5b57\u6bb5\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 rename.convert \u6570\u7ec4 \u5fc5\u586b \u65e0 rename.convert[n].from string \u5fc5\u586b \u65e0 rename\u7684\u76ee\u6807 rename.convert[n].to string \u5fc5\u586b \u65e0 rename\u540e\u7684\u540d\u79f0

    Example

    interceptors:\n- type: normalize\nprocessors:\n- rename:\nconvert:\n- from: \"hello\"\nto: \"world\"\n
    "},{"location":"reference/pipelines/interceptor/normalize/#add","title":"add","text":"

    \u65b0\u589e\u5b57\u6bb5\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 add.fields map \u5fc5\u586b \u65e0 \u65b0\u589e\u7684key:value\u503c

    Example

    interceptors:\n- type: normalize\nprocessors:\n- add:\nfields:\nhello: world\n
    "},{"location":"reference/pipelines/interceptor/normalize/#convert","title":"convert","text":"

    \u5b57\u6bb5\u7c7b\u578b\u8f6c\u6362\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 convert.convert \u6570\u7ec4 \u5fc5\u586b \u65e0 convert.convert[n].from string \u5fc5\u586b \u65e0 \u9700\u8981\u8f6c\u6362\u7684\u5b57\u6bb5\u540d convert.convert[n].to string \u5fc5\u586b \u65e0 \u8f6c\u6362\u540e\u7684\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1a\"bool\", \"integer\", \"float\"

    Example

    interceptors:\n- type: normalize\nprocessors:\n- convert:\nconvert:\n- from: count\nto: float\n
    "},{"location":"reference/pipelines/interceptor/normalize/#copy","title":"copy","text":"

    \u5b57\u6bb5\u590d\u5236\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 copy.convert \u6570\u7ec4 \u5fc5\u586b \u65e0 copy.convert[n].from string \u5fc5\u586b \u65e0 \u9700\u8981\u590d\u5236\u7684\u5b57\u6bb5\u540d copy.convert[n].to string \u5fc5\u586b \u65e0 \u590d\u5236\u540e\u7684\u5b57\u6bb5\u540d

    Example

    interceptors:\n- type: normalize\nprocessors:\n- copy:\nconvert:\n- from: hello\nto: world\n
    "},{"location":"reference/pipelines/interceptor/normalize/#underroot","title":"underRoot","text":"

    \u5c06\u5b57\u6bb5\u4e2d\u7684\u6240\u6709key:value\u653e\u5230event\u6700\u5916\u5c42\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 underRoot.keys string\u6570\u7ec4 \u5fc5\u586b \u65e0 \u9700\u8981underRoot\u7684\u5b57\u6bb5\u540d

    Example

    interceptors:\n- type: normalize\nprocessors:\n- underRoot:\nkeys: [\"fields\"]\n
    "},{"location":"reference/pipelines/interceptor/normalize/#timestamp","title":"timestamp","text":"

    \u8f6c\u6362\u65f6\u95f4\u683c\u5f0f\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timestamp.convert \u6570\u7ec4 \u5fc5\u586b \u65e0 timestamp.convert[n].from string \u5fc5\u586b \u65e0 \u6307\u5b9a\u8f6c\u6362\u65f6\u95f4\u683c\u5f0f\u7684\u5b57\u6bb5 timestamp.convert[n].fromLayout string \u5fc5\u586b \u65e0 \u6307\u5b9a\u5b57\u6bb5\u7684\u65f6\u95f4\u683c\u5f0f(golang\u5f62\u5f0f) timestamp.convert[n].toLayout string \u5fc5\u586b \u65e0 \u8f6c\u6362\u540e\u7684\u65f6\u95f4\u683c\u5f0f(golang\u5f62\u5f0f)\uff0c\u53e6\u5916\u53ef\u4e3aunix\u548cunix_ms timestamp.convert[n].toType string \u975e\u5fc5\u586b \u65e0 \u8f6c\u6362\u540e\u7684\u65f6\u95f4\u5b57\u6bb5\u7c7b\u578b timestamp.convert[n].local bool \u975e\u5fc5\u586b false \u662f\u5426\u5c06\u89e3\u6790\u7684\u65f6\u95f4\u8f6c\u6210\u5f53\u524d\u65f6\u533a

    Example

    interceptors:\n- type: normalize\nprocessors:\n- timestamp:\nconvert:\n- from: logtime\nfromLayout: \"2006-01-02T15:04:05Z07:00\"\ntoLayout: \"unix\"\n

    \u4ee5\u4e0a\u7684layout\u53c2\u6570\u9700\u8981\u586b\u5199golang\u5f62\u5f0f\uff0c\u53ef\u53c2\u8003\uff1a

    const (\n    Layout      = \"01/02 03:04:05PM '06 -0700\" // The reference time, in numerical order.\n    ANSIC       = \"Mon Jan _2 15:04:05 2006\"\n    UnixDate    = \"Mon Jan _2 15:04:05 MST 2006\"\n    RubyDate    = \"Mon Jan 02 15:04:05 -0700 2006\"\n    RFC822      = \"02 Jan 06 15:04 MST\"\n    RFC822Z     = \"02 Jan 06 15:04 -0700\" // RFC822 with numeric zone\n    RFC850      = \"Monday, 02-Jan-06 15:04:05 MST\"\n    RFC1123     = \"Mon, 02 Jan 2006 15:04:05 MST\"\n    RFC1123Z    = \"Mon, 02 Jan 2006 15:04:05 -0700\" // RFC1123 with numeric zone\n    RFC3339     = \"2006-01-02T15:04:05Z07:00\"\n    RFC3339Nano = \"2006-01-02T15:04:05.999999999Z07:00\"\n    Kitchen     = \"3:04PM\"\n    // Handy time stamps.\n    Stamp      = \"Jan _2 15:04:05\"\n    StampMilli = \"Jan _2 15:04:05.000\"\n    StampMicro = \"Jan _2 15:04:05.000000\"\n    StampNano  = \"Jan _2 15:04:05.000000000\"\n)\n
    \u8fd8\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\u3002

    "},{"location":"reference/pipelines/interceptor/normalize/#fmt","title":"fmt","text":"

    \u5b57\u6bb5\u5185\u5bb9\u91cd\u65b0\u683c\u5f0f\u5316\u3002\u53ef\u6839\u636e\u5176\u4ed6\u5b57\u6bb5\u5185\u5bb9\u8fdb\u884c\u7ec4\u5408\u548c\u683c\u5f0f\u5316\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fmt.fields map \u5fc5\u586b \u65e0 key\u8868\u793a\u9700\u8981\u683c\u5f0f\u5316\u7684\u5b57\u6bb5\u540d\u79f0\uff0cvalue\u4e3a\u9700\u8981\u683c\u5f0f\u5316\u7684\u5185\u5bb9\u3002\u53ef\u4f7f\u7528${}\u7684\u65b9\u5f0f\u8868\u793a\u53d6\u503c\u67d0\u4e2a\u5b57\u6bb5

    Example

    interceptors:\n- type: normalize\nprocessors:\n- fmt:\nfields:\nd: new-${a.b}-${c}\n
    "},{"location":"reference/pipelines/interceptor/overview/","title":"Overview","text":"

    interceptors\u5b57\u6bb5\u4e3a\u6570\u7ec4\uff0c\u4e00\u4e2aPipeline\u4e2d\u53ef\u586b\u5199\u591a\u4e2ainterceptor\u7ec4\u4ef6\u914d\u7f6e\u3002

    \u76ee\u524d\uff0cinterceptor\u5206\u4e3a\u4e24\u79cd\u7c7b\u578b\uff1a

    \u4e00\u4e2ainterceptor\u53ea\u5c5e\u4e8e\u5176\u4e2d\u4e00\u79cd\u3002\u5927\u90e8\u5206\u7ec4\u4ef6\u4e3asource interceptor\u7c7b\u578b\uff0c\u53ef\u652f\u6301\u914d\u7f6ebelongTo\u88ab\u90e8\u5206source\u4f7f\u7528\u3002\u5c11\u6570\u901a\u7528\u6027\u8d28\u7684\u6bd4\u5982retry interceptor\u4e3asink interceptor\u7c7b\u578b\u3002

    "},{"location":"reference/pipelines/interceptor/overview/#interceptor","title":"Interceptor\u901a\u7528\u914d\u7f6e","text":""},{"location":"reference/pipelines/interceptor/overview/#enabled","title":"enabled","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b true \u8868\u793a\u662f\u5426\u5f00\u542f\u8be5interceptor"},{"location":"reference/pipelines/interceptor/overview/#name","title":"name","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 name string \u975e\u5fc5\u586b \u8868\u793ainterceptor\u7684\u540d\u79f0\u3002\u5f53pipeline\u91cc\u914d\u7f6e\u76f8\u540ctype interceptor\u7684\u60c5\u51b5\u4e0b\uff0c\u5fc5\u586b\uff0c\u7528\u4e8e\u533a\u5206\u6807\u8bc6"},{"location":"reference/pipelines/interceptor/overview/#belongto","title":"belongTo","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 belongTo string\u6570\u7ec4 \u975e\u5fc5\u586b \u4ec5source interceptor\u53ef\u7528\uff0c\u7528\u4e8e\u6307\u5b9a\u8be5interceptor\u4ec5\u88ab\u54ea\u4e9bsource\u4f7f\u7528"},{"location":"reference/pipelines/interceptor/overview/#order","title":"order","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 order int \u975e\u5fc5\u586b interceptor\u7684\u6392\u5217\u987a\u5e8f\u6743\u91cd"},{"location":"reference/pipelines/interceptor/retry/","title":"retry","text":"

    \u7528\u4e8e\u7ed9\u4e0b\u6e38\u53d1\u9001\u5931\u8d25\u65f6\u91cd\u8bd5\u3002 \u7cfb\u7edf\u5185\u7f6e\uff0c\u9ed8\u8ba4\u52a0\u8f7d\uff0c\u5c5e\u4e8esink interceptor\u3002

    Example

    interceptors:\n- type: retry\n
    "},{"location":"reference/pipelines/interceptor/retry/#retrymaxcount","title":"retryMaxCount","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 retryMaxCount int \u975e\u5fc5\u586b 0 \u6700\u5927\u7684\u91cd\u8bd5\u6b21\u6570"},{"location":"reference/pipelines/interceptor/schema/","title":"schema","text":"

    \u4e13\u6ce8\u4e8e\u65e5\u5fd7\u683c\u5f0f\u8f6c\u6362\u4e0e\u9002\u914d\u7684interceptor\u3002 \u5c5e\u4e8esource interceptor\u3002

    "},{"location":"reference/pipelines/interceptor/schema/#_1","title":"\u4f7f\u7528\u573a\u666f","text":"

    \u5bf9\u4e8e\u5927\u90e8\u5206\u65e5\u5fd7\u5bf9\u63a5\u7684\u573a\u666f\u4e2d\uff0c\u6211\u4eec\u8981\u6c42\u7684\u65e5\u5fd7\u683c\u5f0f\u53ef\u80fd\u6709\u4e00\u4e9b\u5dee\u5f02\uff0c\u8fd9\u4e9b\u5dee\u5f02\u4e3b\u8981\u4f53\u73b0\u5728\u65f6\u95f4\u5b57\u6bb5\u3001body\u5b57\u6bb5\u7b49\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cLoggie\u53ea\u4f1a\u628asource\u91c7\u96c6\u6216\u8005\u63a5\u6536\u5230\u7684\u539f\u59cb\u6570\u636e\u653e\u5230body\u5b57\u6bb5\u4e2d\uff0c\u4ee5\u6700\u7b80\u5355\u7684\u65b9\u5f0f\u53d1\u9001\uff1a

    {\n\"body\": \"this is raw data\"\n}\n

    \u4f46\u662f\uff0c\u4e00\u4e9b\u573a\u666f\u4e0b\u6211\u4eec\u9700\u8981\uff1a

    Example

    \u589e\u52a0@timestamp\uff0cbody\u4fee\u6539\u4e3amessage\u589e\u52a0_timestamp_\uff0c\u4fee\u6539\u65f6\u533a\u548c\u683c\u5f0f\uff0cbody\u4fee\u6539\u4e3a_log_
    interceptors:\n- type: schema\naddMeta:\ntimestamp:\nkey: \"@timestamp\"\nremap:\nbody:\nkey: message\n

    \u8f6c\u6362\u540e\u7684event:

    {\n\"message\": \"this is raw data\"\n\"@timestamp\": \"2022-08-30T06:58:49.545Z\",\n}\n

    interceptors:\n- type: schema\naddMeta:\ntimestamp:\nkey: \"_timestamp_\"\nlocation: Local\nlayout: 2006-01-02T15:04:05Z07:00\nremap:\nbody:\nkey: _log_\n
    "},{"location":"reference/pipelines/interceptor/schema/#_2","title":"\u914d\u7f6e","text":""},{"location":"reference/pipelines/interceptor/schema/#addmeta","title":"addMeta","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addMeta \u975e\u5fc5\u586b \u589e\u52a0\u7cfb\u7edf\u5143\u4fe1\u606f\u5b57\u6bb5"},{"location":"reference/pipelines/interceptor/schema/#timestamp","title":"timestamp","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addMeta.timestamp \u975e\u5fc5\u586b \u589e\u52a0\u7cfb\u7edf\u65f6\u95f4\u5b57\u6bb5\uff08source\u91c7\u96c6\u5230\u6570\u636e\u7684\u65f6\u95f4\uff09 addMeta.timestamp.key string \u5fc5\u586b \u7cfb\u7edf\u65f6\u95f4\u7684key addMeta.timestamp.location string \u975e\u5fc5\u586b \u9ed8\u8ba4\u4e3a\u7a7a\uff0c\u5373\u4e3aUTC\u65f6\u95f4 \u589e\u52a0\u7684\u65f6\u95f4\u65f6\u533a\uff0c\u53e6\u5916\u8fd8\u652f\u6301Local addMeta.timestamp.layout string \u975e\u5fc5\u586b \"2006-01-02T15:04:05.000Z\" golang\u7684\u65f6\u95f4\u7c7b\u578blayout\uff0c\u53ef\u53c2\u8003https://go.dev/src/time/format.go"},{"location":"reference/pipelines/interceptor/schema/#pipelinename","title":"pipelineName","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addMeta.pipelineName \u975e\u5fc5\u586b \u5c06pipelineName\u52a0\u5165\u5230event\u4e2d addMeta.pipelineName.key string \u5fc5\u586b \u589e\u52a0\u540e\u7684\u5b57\u6bb5\u7684key

    Example

    interceptors:\n- type: schema\naddMeta:\npipelineName:\nkey: pipeline\n
    \u8f6c\u6362\u540e\u7684event:
    {\n\"pipeline\": \"demo\"\n...\n}\n

    "},{"location":"reference/pipelines/interceptor/schema/#sourcename","title":"sourceName","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addMeta.sourceName \u975e\u5fc5\u586b \u5c06sourceName\u52a0\u5165\u5230event\u4e2d addMeta.sourceName.key string \u5fc5\u586b \u589e\u52a0\u540e\u7684\u5b57\u6bb5\u7684key

    Example

    interceptors:\n- type: schema\naddMeta:\nsourceName:\nkey: source\n
    \u8f6c\u6362\u540e\u7684event:
    {\n\"source\": \"local\"\n...\n}\n

    "},{"location":"reference/pipelines/interceptor/schema/#remap","title":"remap","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 remap map \u975e\u5fc5\u586b \u5bf9\u5b57\u6bb5\u8fdb\u884c\u8f6c\u6362\uff0c\u76ee\u524d\u652f\u6301\u91cd\u547d\u540d remap.[originKey] string \u975e\u5fc5\u586b \u539f\u59cb\u5b57\u6bb5key remap.[originKey].key string \u975e\u5fc5\u586b \u8f6c\u6362\u540e\u7684\u5b57\u6bb5key

    Example

    interceptors:\n- type: schema\nremap:\nbody:\nkey: msg\nstate:\nkey: meta\n
    \u8f6c\u6362\u524d\u7684event:
    {\n\"body\": \"this is log\"\n\"state\": \"ok\",\n}\n

    \u8f6c\u6362\u540e\u7684event:

    {\n\"msg\": \"this is log\"\n\"meta\": \"ok\",\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/","title":"transformer","text":"

    \u5e26\u6709\u6761\u4ef6\u5224\u65ad\u7684\u51fd\u6570\u5f0f\u6570\u636e\u5904\u7406interceptor\u3002 \u5c5e\u4e8esource interceptor\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#_1","title":"\u4f7f\u7528\u573a\u666f","text":"

    \u793a\u4f8b\u53c2\u8003\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#_2","title":"\u4f7f\u7528\u65b9\u5f0f","text":"

    transformer\u4f1a\u6309\u7167\u914d\u7f6e\u7684actions\u91cc\u987a\u5e8f\u6267\u884c\u6240\u6709\u7684action\u3002action\u7c7b\u4f3c\u51fd\u6570\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5199\u5165\u53c2\u6570\uff0c\u53c2\u6570\u4e00\u822c\u4e3aevent\u91cc\u7684\u5b57\u6bb5\u3002 \u540c\u65f6\uff0c\u6bcf\u4e2aaction\u91cc\u8fd8\u53ef\u80fd\u5305\u62ec\u989d\u5916\u7684\u63a7\u5236\u5b57\u6bb5\u3002\u6bd4\u5982\u4e0b\u9762regex(body)\uff0cbody\u5373\u4e3aregex\u7684\u53c2\u6570\uff0cpattern\u4e3a\u989d\u5916\u7684\u5b57\u6bb5\u3002

    interceptors:\n- type: transformer\nactions:\n- action: regex(body)\npattern: ^(?P<time>[^ ^Z]+Z) (?P<level>[^ ]*) (?P<log>.*)$\n- action: add(topic, common)\n

    \u53e6\u5916\uff0caction\u8fd8\u652f\u6301\u6761\u4ef6\u5224\u65adif-then-else\u7684\u65b9\u5f0f\uff1a

    - if: <condition>\nthen:\n- action: funcA()\nelse:\n- action: funcB()\n

    \u5176\u4e2d\uff0ccondition\u6761\u4ef6\u5224\u65ad\u4e5f\u4e3a\u51fd\u6570\u7684\u5f62\u5f0f\u3002

    interceptors:\n- type: transformer\nactions:\n- if: equal(status, 404)\nthen:\n- action: add(topic, not_found)\n- action: return()\n
    "},{"location":"reference/pipelines/interceptor/transformer/#action","title":"action","text":""},{"location":"reference/pipelines/interceptor/transformer/#_3","title":"\u516c\u5171\u5b57\u6bb5","text":""},{"location":"reference/pipelines/interceptor/transformer/#ignoreerror","title":"ignoreError","text":"

    Example

    - type: transformer\nactions:\n- action: regex(body)\npattern: (?<ip>\\S+) (?<id>\\S+) (?<u>\\S+) (?<time>\\[.*?\\]) (?<url>\\\".*?\\\") (?<status>\\S+) (?<size>\\S+)\nignoreError: true\n
    \u8fd9\u91cc\u7684ignoreError\u8bbe\u7f6e\u4e3atrue\uff0c\u8868\u793a\u4f1a\u5ffd\u7565\u8be5\u6b63\u5219\u5339\u914d\u7684\u9519\u8bef\uff0c\u5e76\u4e14\u4f1a\u7ee7\u7eed\u6267\u884c\u540e\u7eed\u7684action\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#dropiferror","title":"dropIfError","text":"

    \u8868\u793a\u5982\u679c\u51fa\u73b0\u9519\u8bef\uff0c\u76f4\u63a5\u4e22\u5f03\u8be5\u6761event\u3002

    Example

    - type: transformer\nactions:\n- action: regex(body)\npattern: (?<ip>\\S+) (?<id>\\S+) (?<u>\\S+) (?<time>\\[.*?\\]) (?<url>\\\".*?\\\") (?<status>\\S+) (?<size>\\S+)\ndropIfError: true\n
    \u8fd9\u91cc\u7684dropIfError\u8bbe\u7f6e\u4e3atrue\uff0c\u8868\u793a\u5982\u679c\u51fa\u73b0\u6b63\u5219\u5339\u914d\u7684\u9519\u8bef\uff0c\u4f1a\u76f4\u63a5\u4e22\u5f03\u8fd9\u6761\u65e5\u5fd7\uff08\u540e\u7eedaction\u4e5f\u4e0d\u4f1a\u6267\u884c\uff09\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#addkey-value","title":"add(key, value)","text":"

    \u7ed9event\u6dfb\u52a0\u989d\u5916\u7684key:value\u3002

    Example

    - action: add(topic, loggie)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"topic\": \"loggie\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#copyfrom-to","title":"copy(from, to)","text":"

    \u590d\u5236event\u91cc\u7684\u5b57\u6bb5\u3002

    \u53c2\u6570\uff1a

    Example

    - action: copy(foo, bar)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"foo\": \"loggie\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"foo\": \"loggie\",\n\"bar\": \"loggie\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#movefrom-to","title":"move(from, to)","text":"

    \u79fb\u52a8/\u91cd\u547d\u540d\u5b57\u6bb5\u3002

    \u53c2\u6570\uff1a

    Example

    - action: move(foo, bar)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"foo\": \"loggie\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"bar\": \"loggie\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#setkey-value","title":"set(key, value)","text":"

    \u66f4\u65b0\u5b57\u6bb5key\u7684\u503c\u4e3avalue\u3002

    \u53c2\u6570\uff1a

    Example

    - action: set(foo, test)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"foo\": \"loggie\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"foo\": \"test\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#delkey1-key2","title":"del(key1, key2...)","text":"

    \u5220\u9664\u5b57\u6bb5\u3002\u53ef\u586b\u5199\u591a\u4e2a\u5b57\u6bb5key\u3002

    Example

    - action: del(foo)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"foo\": \"loggie\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#underrootkey","title":"underRoot(key)","text":"

    \u5c06\u5d4c\u5957\u7684\u5b57\u6bb5\u653e\u5728\u6839\u90e8\uff08\u6700\u5916\u5c42\uff09\u3002

    Example

    - action: underRoot(state)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"state\": {\n\"node\": \"127.0.0.1\",\n\"phase\": \"running\"\n}\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"node\": \"127.0.0.1\",\n\"phase\": \"running\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#fmtkey","title":"fmt(key)","text":"

    \u5c06\u67d0\u4e2a\u5b57\u6bb5\u7684\u503c\u91cd\u65b0\u6e32\u67d3\uff0c\u53ef\u6839\u636e\u5176\u4ed6\u7684\u5b57\u6bb5\u503c\u7ec4\u6210\u4e00\u4e2a\u503c\u3002\u5982\u679ckey\u4e0d\u5b58\u5728\u5219\u4f1a\u65b0\u589e\u8be5\u5b57\u6bb5\u3002

    \u989d\u5916\u5b57\u6bb5\uff1a

    Example

    - action: fmt(status)\npattern: ${state.node} is ${state.phase}\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"state\": {\n\"node\": \"127.0.0.1\",\n\"phase\": \"running\"\n}\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"state\": {\n\"node\": \"127.0.0.1\",\n\"phase\": \"running\"\n}\uff0c\n\"status\": \"127.0.0.1 is running\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#timestampkey","title":"timestamp(key)","text":"

    \u5b57\u6bb5\u7684\u65f6\u95f4\u683c\u5f0f\u8f6c\u6362\u3002

    \u989d\u5916\u5b57\u6bb5\uff1a

    Example

    - action: timestamp(time)\nfromLayout: \"2006-01-02 15:04:05\"\nfromLocation: Asia/Shanghai\ntoLayout: unix_ms\ntoLocation: Local\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"time\": \"2022-06-28 11:24:35\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"time\": 1656386675000\n}\n

    \u4ee5\u4e0a\u7684layout\u53c2\u6570\u9700\u8981\u586b\u5199golang\u5f62\u5f0f\uff0c\u53ef\u53c2\u8003\uff1a

    const (\n    Layout      = \"01/02 03:04:05PM '06 -0700\" // The reference time, in numerical order.\n    ANSIC       = \"Mon Jan _2 15:04:05 2006\"\n    UnixDate    = \"Mon Jan _2 15:04:05 MST 2006\"\n    RubyDate    = \"Mon Jan 02 15:04:05 -0700 2006\"\n    RFC822      = \"02 Jan 06 15:04 MST\"\n    RFC822Z     = \"02 Jan 06 15:04 -0700\" // RFC822 with numeric zone\n    RFC850      = \"Monday, 02-Jan-06 15:04:05 MST\"\n    RFC1123     = \"Mon, 02 Jan 2006 15:04:05 MST\"\n    RFC1123Z    = \"Mon, 02 Jan 2006 15:04:05 -0700\" // RFC1123 with numeric zone\n    RFC3339     = \"2006-01-02T15:04:05Z07:00\"\n    RFC3339Nano = \"2006-01-02T15:04:05.999999999Z07:00\"\n    Kitchen     = \"3:04PM\"\n    // Handy time stamps.\n    Stamp      = \"Jan _2 15:04:05\"\n    StampMilli = \"Jan _2 15:04:05.000\"\n    StampMicro = \"Jan _2 15:04:05.000000\"\n    StampNano  = \"Jan _2 15:04:05.000000000\"\n)\n
    \u8fd8\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#regexkey","title":"regex(key)","text":"

    \u4f7f\u7528\u6b63\u5219\u7684\u65b9\u5f0f\u5207\u5206\u65e5\u5fd7\uff0c\u63d0\u53d6\u5b57\u6bb5\u3002 \u53e6\u5916\u4e5f\u53ef\u4ee5\u4e3aregex(key, to)\u3002

    \u53c2\u6570\uff1a

    \u989d\u5916\u5b57\u6bb5\uff1a

    Example

    - action: regex(body)\npattern: (?<ip>\\S+) (?<id>\\S+) (?<u>\\S+) (?<time>\\[.*?\\]) (?<url>\\\".*?\\\") (?<status>\\S+) (?<size>\\S+)\n

    input:

    {\n\"body\": \"10.244.0.1 - - [13/Dec/2021:12:40:48 +0000] 'GET / HTTP/1.1' 404 683\",\n}\n

    output:

    {\n\"ip\":     \"10.244.0.1\",\n\"id\":     \"-\",\n\"u\":      \"-\",\n\"time\":   \"[13/Dec/2021:12:40:48 +0000]\",\n\"url\":    \"GET / HTTP/1.1\",\n\"status\": \"404\",\n\"size\":   \"683\",\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#grokkey","title":"grok(key)","text":"

    \u4f7f\u7528grok\u7684\u65b9\u5f0f\u5207\u5206\u65e5\u5fd7\uff0c\u63d0\u53d6\u5b57\u6bb5\u3002 \u53e6\u5916\u4e5f\u53ef\u4ee5\u4e3agrok(key, to)\u3002

    \u53c2\u6570\uff1a

    \u989d\u5916\u5b57\u6bb5\uff1a

    Example

    - action: grok(body)\nmatch: \"^%{DATESTAMP:datetime} %{FILE:file}:%{INT:line}: %{IPV4:ip} %{PATH:path} %{UUID:uuid}(?P<space>[a-zA-Z]?)\"\npattern: FILE: \"[a-zA-Z0-9._-]+\"\n

    input:

    {\n\"body\": \"2022/05/28 01:32:01 logTest.go:66: 192.168.0.1 /var/log/test.log 54ce5d87-b94c-c40a-74a7-9cd375289334\",\n}\n

    output:

            \"datetime\": \"2022/05/28 01:32:01\",\n            \"line\":     \"66\",\n            \"ip\":       \"192.168.0.1\",\n            \"path\":     \"/var/log/test.log\",\n            \"uuid\":     \"54ce5d87-b94c-c40a-74a7-9cd375289334\",\n

    "},{"location":"reference/pipelines/interceptor/transformer/#jsondecodekey","title":"jsonDecode(key)","text":"

    \u5c06json\u6587\u672c\u53cd\u5e8f\u5217\u5316\u3002 \u4e5f\u53ef\u4ee5\u4e3ajsonDecode(key, to)\u3002

    \u53c2\u6570\uff1a

    Example

    - action: jsonDecode(body)\n

    input:

    {\n\"body\": `{\"log\":\"I0610 08:29:07.698664 Waiting for caches to sync\", \"stream\":\"stderr\", \"time\":\"2021-06-10T08:29:07.698731204Z\"}`,\n}\n

    output:

    {\n\"log\": \"I0610 08:29:07.698664 Waiting for caches to sync\",\n\"stream\": \"stderr\", \"time\": \"2021-06-10T08:29:07.698731204Z\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#jsonencodekey","title":"jsonEncode(key)","text":"

    \u5c06\u591a\u4e2a\u5b57\u6bb5\u5e8f\u5217\u5316\u6210json string\u5f62\u5f0f\u3002 \u4e5f\u53ef\u4ee5\u4e3ajsonEncode(key, to)\u3002

    \u53c2\u6570\uff1a

    Example

    interceptors:\n- type: transformer\nactions:\n- action: jsonEncode(fields)\n

    input:

    {\n\"body\": \"this is test\",\n\"fields\":\n\"topic\": \"loggie\",\n\"foo\": \"bar\"\n}\n

    output:

     {\n\"fields\": \"{\\\"topic\\\":\\\"loggie\\\",\\\"foo\\\":\\\"bar\\\"}\",\n\"body\": \"this is test\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#splitkey","title":"split(key)","text":"

    \u5c06\u4e00\u884c\u65e5\u5fd7\u6839\u636e\u67d0\u79cd\u5206\u5272\u7b26\u5207\u5206\u3002

    \u53c2\u6570\uff1a

    \u989d\u5916\u5b57\u6bb5\uff1a

    Example

      interceptors:\n- type: transformer\nactions:\n- action: split(body)\nseparator: \"|\"\nkeys: [\"time\", \"order\", \"service\", \"price\"]\n

    input:

      \"body\": `2021-08-08|U12345|storeCenter|13.14`,\n

    output:

      \"time\": \"2021-08-08\"\n  \"order\": \"U12345\"\n  \"service\": \"storeCenter\"\n  \"price: \"13.14\"\n

    "},{"location":"reference/pipelines/interceptor/transformer/#strconvkey-type","title":"strconv(key, type)","text":"

    \u5b57\u6bb5\u503c\u7c7b\u578b\u8f6c\u6362\u3002

    \u53c2\u6570\uff1a

    Example

    - action: strconv(code, int)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"code\": \"200\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"code\": 200\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#tostrkey-type","title":"toStr(key, type)","text":"

    \u5c06\u5b57\u6bb5\u503c\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u3002

    \u53c2\u6570\uff1a

    Example

    - action: toStr(code, int)     

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"code\": 200\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"code\": \"200\"\n}   

    "},{"location":"reference/pipelines/interceptor/transformer/#print","title":"print()","text":"

    \u6253\u5370event\u3002\u4e00\u822c\u7528\u4e8e\u8c03\u8bd5\u9636\u6bb5\u4f7f\u7528\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#return","title":"return()","text":"

    \u63a7\u5236\u7c7b\u578b\u51fd\u6570\uff0c\u6267\u884c\u5230return()\u540e\u8fd4\u56de\uff0c\u4e0d\u518d\u7ee7\u7eed\u6267\u884c\u4e0b\u9762\u7684action\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#dropevent","title":"dropEvent()","text":"

    \u63a7\u5236\u7c7b\u578b\u51fd\u6570\uff0c\u6267\u884c\u5230dropEvent()\u540e\u4f1a\u5c06\u8be5event\u76f4\u63a5\u4e22\u5f03\u3002\u8fd9\u610f\u5473\u7740\u8be5\u6761\u6570\u636e\u4f1a\u4e22\u5931\uff0c\u4e5f\u4e0d\u4f1a\u7ee7\u7eed\u88ab\u540e\u7eed\u7684interceptor\u6216\u8005sink\u5904\u7406\u6d88\u8d39\u3002

    Example

    interceptors:\n- type: transformer\nactions:\n- action: regex(body)\npattern: ^(?P<time>[^ ^Z]+Z) (?P<level>[^ ]*) (?P<log>.*)$\n- if: equal(level, DEBUG)\nthen:\n- action: dropEvent()\n
    \u5047\u8bbe\u65e5\u5fd7\u4e3a\uff1a2021-02-16T09:21:20.545525544Z DEBUG this is log body\uff0c\u5219\u6ee1\u8db3level\u5b57\u6bb5\u4e3aDEBUG\uff0c\u4f1a\u76f4\u63a5\u4e22\u5f03\u8be5\u6761\u65e5\u5fd7\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#condition","title":"condition","text":"

    \u6761\u4ef6\u5224\u65ad\u7c7b\u51fd\u6570\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#_4","title":"\u64cd\u4f5c\u7b26","text":"

    Example

    interceptors:\n- type: transformer\nactions:\n- if: equal(level, DEBUG) AND equal(code, 200)\nthen:\n- action: dropEvent()\n

    Example

    interceptors:\n- type: transformer\nactions:\n- if: equal(level, DEBUG) OR equal(level, INFO)\nthen:\n- action: dropEvent()\n

    Example

    interceptors:\n- type: transformer\nactions:\n- if: NOT equal(level, DEBUG)\nthen:\n- action: dropEvent()\n
    "},{"location":"reference/pipelines/interceptor/transformer/#equalkey-target","title":"equal(key, target)","text":"

    \u76ee\u6807\u5b57\u6bb5\u503c\u662f\u5426\u548c\u53c2\u6570\u503ctarget\u76f8\u7b49\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#containkey-target","title":"contain(key, target)","text":"

    \u5b57\u6bb5\u503c\u662f\u5426\u5305\u542b\u53c2\u6570\u503ctarget\u3002

    Caution

    target\u8bf7\u76f4\u63a5\u4f7f\u7528\u5b57\u7b26\u4e32\uff0c\u65e0\u9700\u6dfb\u52a0\u53cc\u5f15\u53f7\u3002 \u6bd4\u5982contain(body, error)\uff0c\u800c\u4e0d\u662fcontain(body, \"error\")\u3002contain(body, \"error\")\u4f1a\u88ab\u5f53\u4f5c\"error\"\u6765\u5339\u914d\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#existkey","title":"exist(key)","text":"

    \u76ee\u6807\u5b57\u6bb5\u662f\u5426\u5b58\u5728\u6216\u8005\u662f\u5426\u4e3a\u7a7a\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#greaterkey-value","title":"greater(key, value)","text":"

    \u76ee\u6807\u5b57\u6bb5\u7684\u503c\u662f\u5426\u5927\u4e8e\u53c2\u6570\u503cvalue\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#lesskey-value","title":"less(key, value)","text":"

    \u76ee\u6807\u5b57\u6bb5\u7684\u503c\u662f\u5426\u5c0f\u4e8e\u53c2\u6570\u503cvalue\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#hasprefixkey-prefix","title":"hasPrefix(key, prefix)","text":"

    \u76ee\u6807\u5b57\u6bb5\u7684\u503c\u662f\u5426\u5305\u542bprefix\u524d\u7f00\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#matchkey-regex","title":"match(key, regex)","text":"

    \u76ee\u6807\u5b57\u6bb5\u7684\u503c\u662f\u5426\u548c\u53c2\u6570regex\u6b63\u5219\u5339\u914d\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#oneofkey-value1-value2","title":"oneOf(key, value1, value2...)","text":"

    \u76ee\u6807\u5b57\u6bb5\u7684\u503c\u662f\u5426\u662f\u53c2\u6570\u503cvalue1...\u5176\u4e2d\u4e4b\u4e00\u3002

    "},{"location":"reference/pipelines/queue/channel/","title":"channel","text":"

    channel queue,\u662f\u57fa\u4e8ego chan\u5b9e\u73b0\u7684\u5185\u5b58\u7f13\u51b2queue\u3002

    Example

    queue:\ntype: channel\n
    "},{"location":"reference/pipelines/queue/channel/#batchsize","title":"batchSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchSize int \u4e0d\u5fc5\u586b 2048 \u4e00\u4e2a\u6279\u6b21\u5305\u542b\u7684event\u6570\u91cf"},{"location":"reference/pipelines/queue/channel/#batchbytes","title":"batchBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchBytes int64 \u4e0d\u5fc5\u586b 33554432(32MB) \u4e00\u4e2a\u6279\u6b21\u5305\u542b\u7684\u6570\u636e\u6700\u5927\u5b57\u8282\u6570"},{"location":"reference/pipelines/queue/channel/#batchaggtimeout","title":"batchAggTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchAggTimeout time.Duration \u4e0d\u5fc5\u586b 1s \u7ec4\u88c5\u805a\u5408\u591a\u4e2aevent\u6210\u4e00\u4e2abatch\u7b49\u5f85\u7684\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/queue/memory/","title":"memory","text":"

    memory queue,\u662f\u57fa\u4e8ego-disruptor\u5b9e\u73b0\u7684\u5185\u5b58\u7f13\u51b2queue\u3002

    Note

    \u7531\u4e8ego-disruptor\u7248\u672c\u8fd8\u672arelease\uff0cmemory queue\u8fd8\u5c5e\u4e8e\u5b9e\u9a8c\u9636\u6bb5\u3002\u751f\u4ea7\u73af\u5883\u4e0d\u5efa\u8bae\u4f7f\u7528\uff01

    Example

    queue:\ntype: memory\n
    "},{"location":"reference/pipelines/queue/memory/#batchsize","title":"batchSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchSize int \u4e0d\u5fc5\u586b 2048 \u4e00\u4e2a\u6279\u6b21\u5305\u542b\u7684event\u6570\u91cf"},{"location":"reference/pipelines/queue/memory/#batchbufferfactor","title":"batchBufferFactor","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchBufferFactor int \u4e0d\u5fc5\u586b 2 queue\u7f13\u51b2\u533a\u7684\u5927\u5c0f(channel\u7684\u5bb9\u91cf)=batchSize*batchBufferFactor"},{"location":"reference/pipelines/queue/memory/#batchbytes","title":"batchBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchBytes int64 \u4e0d\u5fc5\u586b 33554432(32MB) \u4e00\u4e2a\u6279\u6b21\u5305\u542b\u7684\u6570\u636e\u6700\u5927\u5b57\u8282\u6570"},{"location":"reference/pipelines/queue/memory/#batchaggtimeout","title":"batchAggTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchAggTimeout time.Duration \u4e0d\u5fc5\u586b 1s \u7ec4\u88c5\u805a\u5408\u591a\u4e2aevent\u6210\u4e00\u4e2abatch\u7b49\u5f85\u7684\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/dev/","title":"dev","text":"

    dev sink\u5c06\u65e5\u5fd7\u6570\u636e\u6253\u5370\u5230\u63a7\u5236\u53f0\uff0c\u4e00\u822c\u53ef\u4ee5\u7528\u4e8edebug\u6216\u8005\u6392\u67e5\u95ee\u9898\u3002 \u914d\u7f6edev sink\u540e\uff0c\u53ef\u4ee5\u8bbe\u7f6eprintEvents=true\uff0c\u67e5\u770b\u5728Loggie\u4e2d\u53d1\u9001\u81f3sink\u7684\u65e5\u5fd7\u6570\u636e\uff0c\u8be5\u6570\u636e\u9664\u4e86source\u63a5\u6536\u6216\u8005\u91c7\u96c6\u7684\u539f\u59cb\u65e5\u5fd7\uff0c\u4e00\u822c\u8fd8\u5305\u542b\u5176\u4ed6\u5143\u4fe1\u606f\u3002

    Example

    sink:\ntype: dev\nprintEvents: true\ncodec:\ntype: json\npretty: true\n
    "},{"location":"reference/pipelines/sink/dev/#printevents","title":"printEvents","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 printEvents bool \u975e\u5fc5\u586b false \u662f\u5426\u6253\u5370\u91c7\u96c6\u7684\u65e5\u5fd7

    \u9ed8\u8ba4\u60c5\u51b5\u4e0bLoggie\u7684\u65e5\u5fd7\u6253\u5370\u4e3ajson\u683c\u5f0f\uff0c\u53ef\u4ee5\u914d\u7f6e\u542f\u52a8\u53c2\u6570-log.jsonFormat=false\uff0c\u4fbf\u4e8e\u5728Loggie\u65e5\u5fd7\u4e0a\u67e5\u770b\u8f93\u51fa\u7ed3\u679c\u3002

    "},{"location":"reference/pipelines/sink/dev/#printeventsinterval","title":"printEventsInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 printEventsInterval time.Duration \u975e\u5fc5\u586b \u95f4\u9694\u6253\u5370\u91c7\u96c6\u7684\u65e5\u5fd7\uff0c\u5982\u679c\u9700\u8981\u8f93\u51fa\u7684\u65e5\u5fd7\u91cf\u5f88\u5927\uff0c\u53ef\u586b\u5165\u4e00\u4e2a\u65f6\u95f4\u95f4\u9694\uff0c\u6bd4\u598210s\uff0cLoggie\u53ea\u4f1a\u5728\u6bcf10s\u6253\u5370\u4e00\u6b21\u65e5\u5fd7\uff0c\u907f\u514d\u592a\u591a\u65e5\u5fd7\u5237\u5c4f\u4e0d\u4fbf\u67e5\u770b"},{"location":"reference/pipelines/sink/dev/#printmetrics","title":"printMetrics","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 printMetrics bool \u975e\u5fc5\u586b \u662f\u5426\u6253\u5370\u53d1\u9001\u65e5\u5fd7\u7edf\u8ba1\u7684\u4e00\u4e9b\u6307\u6807\uff0c\u5305\u62ectotalCount\u548cqps"},{"location":"reference/pipelines/sink/dev/#printmetricsinterval","title":"printMetricsInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 printMetricsInterval time.Duration \u975e\u5fc5\u586b 1s printMetrics\u5f00\u542f\u540e\uff0c\u6253\u5370\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/sink/dev/#resultstatus","title":"resultStatus","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 resultStatus string \u975e\u5fc5\u586b success \u6a21\u62dfsink\u53d1\u9001\u7aef\u5bf9\u65e5\u5fd7\u7684\u5904\u7406\uff0c\u5305\u62ecsuccess\uff0cfail\uff0cdrop

    \u9664\u4e86\u5728\u914d\u7f6e\u4e2d\u586b\u5199\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u63a5\u53e3\u52a8\u6001\u7684\u8fdb\u884c\u6a21\u62df\uff0c\u6bd4\u5982\u5728Loggie\u8fd0\u884c\u65f6\u5c06sink success\u72b6\u6001\u7f6e\u4e3afail\u72b6\u6001\u3002

    # \u8bf7\u5c06\u4e0b\u9762\u7684<pipelineName>\u66ff\u6362\u4e3a\u5b9e\u9645\u914d\u7f6e\u7684pipelineName\ncurl <ip>:<port>/api/v1/pipeline/<pipelineName>/sink/dev?status=fail\n
    "},{"location":"reference/pipelines/sink/elasticsearch/","title":"elasticsearch","text":"

    \u4f7f\u7528Elasticsearch sink\u53d1\u9001\u6570\u636e\u81f3Elasticsearch\u96c6\u7fa4\u3002

    Example

    sink:\ntype: elasticsearch\nhosts: [\"elasticsearch1:9200\", \"elasticsearch2:9200\", \"elasticsearch3:9200\"]\nindex: \"log-${fields.service}-${+YYYY.MM.DD}\"\n

    Caution

    \u5982\u679celasticsearch\u7248\u672c\u4e3av6.x\uff0c\u8bf7\u52a0\u4e0a\u4ee5\u4e0betype: _doc\u53c2\u6570\u3002

    sink:\ntype: elasticsearch\netype: _doc\n...\n
    "},{"location":"reference/pipelines/sink/elasticsearch/#hosts","title":"hosts","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 hosts string\u6570\u7ec4 \u5fc5\u586b \u65e0 \u53d1\u9001\u65e5\u5fd7\u81f3Elasticsearch\u7684\u5730\u5740"},{"location":"reference/pipelines/sink/elasticsearch/#index","title":"index","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 index string \u5fc5\u586b \u65e0 \u53d1\u9001\u81f3Elasticsearch\u540e\uff0c\u65e5\u5fd7\u6570\u636e\u5b58\u50a8\u7684index

    \u53ef\u4ee5\u4f7f\u7528${a.b}\u7684\u65b9\u5f0f\u83b7\u53d6\u65e5\u5fd7\u6570\u636e\u91cc\u7684\u5b57\u6bb5\uff0c\u6216\u8005\u52a0\u4e0a${+YYYY.MM.DD.hh}\u65f6\u95f4\u6233\u7b49\u65b9\u5f0f\u6765\u52a8\u6001\u751f\u6210index\u3002

    "},{"location":"reference/pipelines/sink/elasticsearch/#username","title":"username","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 username string \u975e\u5fc5\u586b \u65e0 \u5982\u679cElasticsearch\u914d\u7f6e\u4e86\u7528\u6237\u540d\u5bc6\u7801\u9a8c\u8bc1\uff0c\u9700\u8981\u586b\u5199\u8bf7\u6c42\u7684\u7528\u6237\u540d"},{"location":"reference/pipelines/sink/elasticsearch/#password","title":"password","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 password string \u975e\u5fc5\u586b \u65e0 \u5982\u679cElasticsearch\u914d\u7f6e\u4e86\u7528\u6237\u540d\u5bc6\u7801\u9a8c\u8bc1\uff0c\u9700\u8981\u586b\u5199\u8bf7\u6c42\u7684\u5bc6\u7801"},{"location":"reference/pipelines/sink/elasticsearch/#headers","title":"headers","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 headers map \u975e\u5fc5\u586b \u65e0 \u8bf7\u6c42Elasticsearch\u643a\u5e26\u7684header"},{"location":"reference/pipelines/sink/elasticsearch/#parameters","title":"parameters","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 parameters map \u975e\u5fc5\u586b \u65e0 \u8bf7\u6c42Elasticsearch\u7684url\u53c2\u6570"},{"location":"reference/pipelines/sink/elasticsearch/#apikey","title":"apiKey","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 apiKey string \u975e\u5fc5\u586b \u7528\u4e8e\u6388\u6743\u7684base64\u7f16\u7801\u4ee4\u724c;\u5982\u679c\u8bbe\u7f6e\uff0c\u5219\u8986\u76d6\u7528\u6237\u540d/\u5bc6\u7801\u548c\u670d\u52a1\u4ee4\u724c"},{"location":"reference/pipelines/sink/elasticsearch/#servicetoken","title":"serviceToken","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 serviceToken string \u975e\u5fc5\u586b \u670d\u52a1\u4ee4\u724c\u7528\u4e8e\u6388\u6743;\u5982\u679c\u8bbe\u7f6e\uff0c\u5219\u8986\u76d6\u7528\u6237\u540d/\u5bc6\u7801"},{"location":"reference/pipelines/sink/elasticsearch/#cacertpath","title":"caCertPath","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 caCertPath string \u975e\u5fc5\u586b pem\u7f16\u7801\u7684ca\u8bc1\u4e66\u5b58\u653e\u7684\u8def\u5f84"},{"location":"reference/pipelines/sink/elasticsearch/#compress","title":"compress","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compress bool \u975e\u5fc5\u586b false \u662f\u5426\u538b\u7f29\u8bf7\u6c42\u4f53"},{"location":"reference/pipelines/sink/elasticsearch/#documentid","title":"documentId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 documentId string \u975e\u5fc5\u586b \u53d1\u9001\u81f3elasticsearch\u7684id\u503c\uff0c\u53ef\u4f7f\u7528${}\u7684\u65b9\u5f0f\u53d6\u67d0\u4e2a\u5b57\u6bb5"},{"location":"reference/pipelines/sink/elasticsearch/#optype","title":"opType","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 opType string \u975e\u5fc5\u586b index \u53c2\u8003\u5b98\u65b9\u6587\u6863, \u5982\u679c\u76ee\u6807\u4e3adatastream\uff0c\u5219\u9700\u8981\u8bbe\u7f6e\u4e3acreate"},{"location":"reference/pipelines/sink/elasticsearch/#sendbufferbytes","title":"sendBufferBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sendBufferBytes int \u975e\u5fc5\u586b 131072 \u53d1\u9001\u5199\u5165\u8bf7\u6c42\u4f53\u7684buffer\u5b57\u8282\u6570\u5927\u5c0f"},{"location":"reference/pipelines/sink/file/","title":"file","text":"

    \u5c06\u63a5\u6536\u5230\u7684\u6570\u636e\u4ee5\u6587\u4ef6\u7684\u5f62\u5f0f\u5199\u5165\u5230\u672c\u5730\u3002

    Example

    sink:\ntype: file\nworkerCount: 1024\nbaseDirs:\n- /data0\n- /data1\n- /data2\ndirHashKey: ${namespace}-${deployName}\nfilename: /${namespace}/${deployName}/${podName}/${filename}\nmaxSize: 500\nmaxAge: 7\nmaxBackups: 50\ncompress: true\n
    "},{"location":"reference/pipelines/sink/file/#workercount","title":"workerCount","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 workerCount int \u975e\u5fc5\u586b 1 \u5199\u6587\u4ef6\u7684\u5e76\u53d1\u6570"},{"location":"reference/pipelines/sink/file/#basedirs","title":"baseDirs","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 baseDirs string\u6570\u7ec4 \u975e\u5fc5\u586b \u6587\u4ef6\u7684\u57fa\u7840\u76ee\u5f55\uff0c\u53ef\u4ee5\u6309\u67d0\u4e2akey\u505a\u54c8\u5e0c\uff0c\u7136\u540e\u5b58\u50a8\u5230\u5bf9\u5e94\u7684\u57fa\u7840\u76ee\u5f55\u4e0a"},{"location":"reference/pipelines/sink/file/#dirhashkey","title":"dirHashKey","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 dirHashKey string \u975e\u5fc5\u586b \u6309\u6307\u5b9aKey\u505a\u54c8\u5e0c\uff0c\u652f\u6301\u53d8\u91cf"},{"location":"reference/pipelines/sink/file/#filename","title":"filename","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 filename string \u5fc5\u586b \u6587\u4ef6\u540d\uff0c\u652f\u6301\u53d8\u91cf"},{"location":"reference/pipelines/sink/file/#maxsize","title":"maxSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxSize int \u975e\u5fc5\u586b 1 \u6587\u4ef6\u5927\u5c0f\uff0c\u5355\u4f4d\u4e3aMiB"},{"location":"reference/pipelines/sink/file/#maxage","title":"maxAge","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxAge int \u975e\u5fc5\u586b \u65e7\u6587\u4ef6\u4fdd\u7559\u5929\u6570\uff0c\u5355\u4f4d\u300c\u5929\u300d\uff0c\u9ed8\u8ba4\u4e0d\u5220\u9664"},{"location":"reference/pipelines/sink/file/#maxbackups","title":"maxBackups","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxBackups int \u975e\u5fc5\u586b 1 \u6700\u5927\u4fdd\u7559\u7684\u5907\u4efd\u6587\u4ef6\u6570\uff0c\u9ed8\u8ba4\u4e0d\u5220\u9664\uff08\u5982\u679cmaxAge\u914d\u7f6e\u4e86\uff0c\u90a3\u4e48\u6587\u4ef6\u4f9d\u65e7\u4f1a\u88ab\u5220\u9664\uff09"},{"location":"reference/pipelines/sink/file/#localtime","title":"localTime","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 localTime bool \u975e\u5fc5\u586b false \u662f\u5426\u7528\u672c\u5730\u65f6\u95f4\u683c\u5f0f\u5316\u5907\u4efd\u6587\u4ef6\uff0c\u9ed8\u8ba4\u4f7f\u7528UTC\u65f6\u95f4"},{"location":"reference/pipelines/sink/file/#compress","title":"compress","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compress bool \u975e\u5fc5\u586b false \u662f\u5426\u538b\u7f29\uff0c\u4f7f\u7528gzip\uff0c\u9ed8\u8ba4\u4e0d\u538b\u7f29"},{"location":"reference/pipelines/sink/franzkafka/","title":"franz kafka","text":"

    \u4f7f\u7528franz-go kafka\u5e93\u5c06\u65e5\u5fd7\u6570\u636e\u53d1\u9001\u81f3\u4e0b\u6e38Kafka\uff0c\u5e76\u4e14\u80fd\u6bd4\u8f83\u597d\u7684\u652f\u6301kerberos\u8ba4\u8bc1\u3002 \uff08\u672csink\u548ckafka sink\u7684\u533a\u522b\u4e00\u822c\u53ea\u5728\u4e8e\u4f7f\u7528\u7684kafka golang\u5e93\u4e0d\u540c\uff0c\u63d0\u4f9b\u7ed9\u5bf9franz kafka\u5e93\u6709\u504f\u597d\u7684\u7528\u6237\u4f7f\u7528\uff09

    Example

    \u7b80\u5355SASL\u8ba4\u8bc1
    sink:\ntype: franzKafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\n
    sink:\ntype: franzKafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"demo\"\nsasl:\nenabled: true\nmechanism: SCRAM-SHA-512\nusername: ***\npassword: ***\n
    "},{"location":"reference/pipelines/sink/franzkafka/#brokers","title":"brokers","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 brokers string\u6570\u7ec4 \u5fc5\u586b \u65e0 \u53d1\u9001\u65e5\u5fd7\u81f3Kafka\u7684brokers\u5730\u5740"},{"location":"reference/pipelines/sink/franzkafka/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u975e\u5fc5\u586b loggie \u53d1\u9001\u65e5\u5fd7\u81f3Kafka\u7684topic

    \u53ef\u4f7f\u7528${a.b}\u7684\u65b9\u5f0f\uff0c\u83b7\u53d6event\u91cc\u7684\u5b57\u6bb5\u503c\u4f5c\u4e3a\u5177\u4f53\u7684topic\u540d\u79f0\u3002

    \u6bd4\u5982\uff0c\u4e00\u4e2aevent\u4e3a\uff1a

    {\n\"topic\": \"loggie\",\n\"hello\": \"world\"\n}\n
    \u53ef\u914d\u7f6etopic: ${topic}\uff0c\u6b64\u65f6\u8be5event\u53d1\u9001\u5230Kafka\u7684topic\u4e3a\"loggie\"\u3002

    \u540c\u65f6\u652f\u6301\u5d4c\u5957\u7684\u9009\u62e9\u65b9\u5f0f\uff1a

    {\n\"fields\": {\n\"topic\": \"loggie\"\n},\n\"hello\": \"world\"\n}\n
    \u53ef\u914d\u7f6etopic: ${fields.topic}\uff0c\u540c\u6837\u4e5f\u4f1a\u53d1\u9001\u5230topic \"loggie\"\u3002

    "},{"location":"reference/pipelines/sink/franzkafka/#ifrendertopicfailed","title":"ifRenderTopicFailed","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ifRenderTopicFailed \u975e\u5fc5\u586b \u5982\u679c\u4f7f\u7528\u52a8\u6001\u7684\u89c4\u5219\u6e32\u67d3topic\uff0c\u6bd4\u5982topic: ${fields.topic}\uff0c\u6709\u53ef\u80fd\u6e32\u67d3\u5931\u8d25\uff08\u6bd4\u5982\u65e5\u5fd7\u6ca1\u6709fields.topic\u5b57\u6bb5\uff09\uff0c\u4e0b\u9762\u914d\u7f6e\u6307\u793a\u5931\u8d25\u540e\u7684\u52a8\u4f5c\u3002 ifRenderTopicFailed.dropEvent \u975e\u5fc5\u586b true \u9ed8\u8ba4\u4e3a\u4e22\u5f03 ifRenderTopicFailed.ignoreError \u975e\u5fc5\u586b \u5ffd\u7565\u9519\u8bef\u65e5\u5fd7\uff0c\u8bf7\u6ce8\u610f\uff0c\u8fd9\u91cc\u53ea\u662f\u4e0d\u6253\u5370\u9519\u8bef\u65e5\u5fd7 ifRenderTopicFailed.defaultTopic \u975e\u5fc5\u586b \u53d1\u9001\u81f3\u8be5\u9ed8\u8ba4\u7684topic\uff0c\u914d\u7f6e\u540edropEvent\u4e0d\u751f\u6548

    Example

    12
    sink:\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\nifRenderTopicFailed:\ndropEvent: true\n
    sink:\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\nifRenderTopicFailed:\nignoreError: true\ndefaultTopic: default\n
    "},{"location":"reference/pipelines/sink/franzkafka/#ignoreunknowntopicorpartition","title":"ignoreUnknownTopicOrPartition","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ignoreUnknownTopicOrPartition \u975e\u5fc5\u586b \u7528\u4e8e\u5f53\u53d1\u9001\u7684topic\u4e0d\u5b58\u5728\u65f6\uff0c\u5ffd\u7565Kafka\u8fd4\u56deUNKNOWN_TOPIC_OR_PARTITION\u7684\u62a5\u9519 "},{"location":"reference/pipelines/sink/franzkafka/#balance","title":"balance","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 balance string \u975e\u5fc5\u586b roundRobin \u8d1f\u8f7d\u5747\u8861\u7b56\u7565\uff0c\u53ef\u586broundRobin\u3001range\u3001sticky\u3001cooperativeSticky"},{"location":"reference/pipelines/sink/franzkafka/#compression","title":"compression","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compression string \u975e\u5fc5\u586b gzip \u65e5\u5fd7\u53d1\u9001\u81f3Kafka\u7684\u538b\u7f29\u7b56\u7565\uff0c\u53ef\u586bgzip\u3001snappy\u3001lz4\u3001zstd"},{"location":"reference/pipelines/sink/franzkafka/#batchsize","title":"batchSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchSize int \u975e\u5fc5\u586b 100 \u53d1\u9001\u65f6\u6bcf\u4e2abatch\u6700\u591a\u5305\u542b\u7684\u6570\u636e\u4e2a\u6570"},{"location":"reference/pipelines/sink/franzkafka/#batchbytes","title":"batchBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchBytes int \u975e\u5fc5\u586b 1048576 \u6bcf\u4e2a\u53d1\u9001\u8bf7\u6c42\u5305\u542b\u7684\u6700\u5927\u5b57\u8282\u6570"},{"location":"reference/pipelines/sink/franzkafka/#writetimeout","title":"writeTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 writeTimeout time.Duration \u975e\u5fc5\u586b 10s \u5199\u5165\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/franzkafka/#tls","title":"tls","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 tls.enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u542f\u7528 tls.caCertFiles string \u975e\u5fc5\u586b \u8bc1\u4e66\u6587\u4ef6\u8def\u5f84 tls.clientCertFile string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1a\u5ba2\u6237\u7aefcert\u6587\u4ef6 tls.clientKeyFile string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1a\u5ba2\u6237\u7aefkey\u6587\u4ef6 tls.endpIdentAlgo bool type=scram\u65f6\u5fc5\u586b \u5ba2\u6237\u7aef\u662f\u5426\u9a8c\u8bc1\u670d\u52a1\u7aef\u7684\u8bc1\u4e66\u540d\u5b57"},{"location":"reference/pipelines/sink/franzkafka/#sasl","title":"sasl","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sasl \u975e\u5fc5\u586b SASL authentication sasl.enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u542f\u7528 sasl.mechanism string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1aPLAIN\u3001SCRAM-SHA-256\u3001SCRAM-SHA-512\u3001GSSAPI sasl.username string \u5fc5\u586b \u7528\u6237\u540d sasl.password string \u5fc5\u586b \u5bc6\u7801"},{"location":"reference/pipelines/sink/franzkafka/#gssapi","title":"gssapi","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sasl.gssapi \u975e\u5fc5\u586b SASL authentication sasl.gssapi.authType string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1a1 \u4f7f\u7528\u8d26\u53f7\u5bc6\u7801\u30012 \u4f7f\u7528keytab sasl.gssapi.keyTabPath string \u5fc5\u586b keytab \u6587\u4ef6\u8def\u5f84 sasl.gssapi.kerberosConfigPath string \u5fc5\u586b kerbeos \u6587\u4ef6\u8def\u5f84 sasl.gssapi.serviceName string \u5fc5\u586b \u670d\u52a1\u540d\u79f0 sasl.gssapi.userName string \u5fc5\u586b \u7528\u6237\u540d sasl.gssapi.password string \u5fc5\u586b \u5bc6\u7801 sasl.gssapi.realm string \u5fc5\u586b \u9886\u57df sasl.gssapi.disablePAFXFAST bool type=scram\u65f6\u5fc5\u586b DisablePAFXFAST \u7528\u4e8e\u5c06\u5ba2\u6237\u7aef\u914d\u7f6e\u4e3a\u4e0d\u4f7f\u7528 PA_FX_FAST"},{"location":"reference/pipelines/sink/franzkafka/#security","title":"security","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 security string \u975e\u5fc5\u586b java\u683c\u5f0f\u7684\u5b89\u5168\u8ba4\u8bc1\u5185\u5bb9\uff0c\u53ef\u4ee5\u81ea\u52a8\u8f6c\u5316\u6210\u4e3afranz-go\u9002\u914d\u7684\u683c\u5f0f

    Example

    pipelines:\n  - name: local\n    sources:\n      - type: file\n        name: demo\n        paths:\n          - /tmp/log/*.log\n    sink:\n      type: franzKafka\n      brokers:\n      - \"hadoop74.axrzpt.com:9092\"\n      topic: loggie\n      writeTimeout: 5s\n      sasl:\n        gssapi:\n          kerberosConfigPath: /etc/krb5-conf/krb5.conf\n      security:\n        security.protocol: \"SASL_PLAINTEXT\"\n        sasl.mechanism: \"GSSAPI\"\n        sasl.jaas.config: \"com.sun.security.auth.module.Krb5LoginModule required useKeyTab=true storeKey=true debug=true keyTab=\\\"/shylock/kerberos/zork.keytab\\\"  principal=\\\"zork@AXRZPT.COM\\\";\"\n        sasl.kerberos.service.name: \"kafka\"\n

    Kubernetes \u6302\u8f7dkeytab\u4e8c\u8fdb\u5236\u8bc1\u4e66\uff0c\u8bf7\u53c2\u8003\u5b98\u65b9\u6587\u6863\u3002

    "},{"location":"reference/pipelines/sink/franzkafka/#partitionkey","title":"partitionKey","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 partitionKey string \u975e\u5fc5\u586b \u65e0 \u63a7\u5236\u53d1\u9001\u81f3topic\u4e0b\u54ea\u4e2a\u5206\u533a

    \u4e0etopic\u76f8\u4f3c\uff0c\u53ef\u4f7f\u7528${a.b}\u7684\u65b9\u5f0f\uff0c\u83b7\u53d6event\u91cc\u7684\u5b57\u6bb5\u503c\u4f5c\u4e3a\u5177\u4f53\u7684topic\u540d\u79f0\u3002

    "},{"location":"reference/pipelines/sink/grpc/","title":"grpc","text":"

    \u4f7f\u7528grpc sink\u53d1\u9001\u81f3\u4e0b\u6e38\uff0c\u9700\u8981\u4e0b\u6e38\u652f\u6301\u76f8\u540c\u683c\u5f0f\u7684grpc\u534f\u8bae\u3002\u53ef\u4ee5\u4f7f\u7528\u8be5sink\u53d1\u9001\u81f3grpc source\u7684Loggie\u4e2d\u8f6c\u673a\u3002

    Example

    sink:\ntype: grpc\nhost: \"loggie-aggregator.loggie-aggregator:6166\"\n
    "},{"location":"reference/pipelines/sink/grpc/#host","title":"host","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 host string \u5fc5\u586b \u65e0 \u53d1\u9001\u81f3\u4e0b\u6e38\u7684host\u5730\u5740\uff0c\u591a\u4e2aip\u4f7f\u7528,\u9017\u53f7\u5206\u9694"},{"location":"reference/pipelines/sink/grpc/#loadbalance","title":"loadBalance","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 loadBalance string \u975e\u5fc5\u586b round_robin grpc\u8d1f\u8f7d\u5747\u8861\u7b56\u7565"},{"location":"reference/pipelines/sink/grpc/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 30s \u53d1\u9001\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/grpc/#grpcheaderkey","title":"grpcHeaderKey","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 grpcHeaderKey string \u975e\u5fc5\u586b \u65e0"},{"location":"reference/pipelines/sink/kafka/","title":"kafka","text":"

    \u4f7f\u7528sink kafka\u5c06\u65e5\u5fd7\u6570\u636e\u53d1\u9001\u81f3\u4e0b\u6e38Kafka\u3002

    Example

    \u7b80\u5355SASL\u8ba4\u8bc1
    sink:\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\n
    sink:\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"demo\"\nsasl:\ntype: scram\nusername: ***\npassword: ***\nalgorithm: sha512\n

    \u652f\u6301\u7684Kafka\u7248\u672c

    \u8be5kafka sink\u4f7f\u7528\u7684\u662fsegmentio/kafka-go\u5e93\u3002\u5f53\u524dLoggie\u4f7f\u7528\u7684\u5e93\u7248\u672c\u4e3av0.4.39\uff0c\u5bf9\u5e94\u7248\u672c\u6d4b\u8bd5\u652f\u6301\u7684Kafka\u7248\u672c\u4e3a\uff1a0.10.1.0 - 2.7.1

    "},{"location":"reference/pipelines/sink/kafka/#brokers","title":"brokers","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 brokers string\u6570\u7ec4 \u5fc5\u586b \u65e0 \u53d1\u9001\u65e5\u5fd7\u81f3Kafka\u7684brokers\u5730\u5740"},{"location":"reference/pipelines/sink/kafka/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u975e\u5fc5\u586b loggie \u53d1\u9001\u65e5\u5fd7\u81f3Kafka\u7684topic

    \u53ef\u4f7f\u7528${a.b}\u7684\u65b9\u5f0f\uff0c\u83b7\u53d6event\u91cc\u7684\u5b57\u6bb5\u503c\u4f5c\u4e3a\u5177\u4f53\u7684topic\u540d\u79f0\u3002

    \u6bd4\u5982\uff0c\u4e00\u4e2aevent\u4e3a\uff1a

    {\n\"topic\": \"loggie\",\n\"hello\": \"world\"\n}\n
    \u53ef\u914d\u7f6etopic: ${topic}\uff0c\u6b64\u65f6\u8be5event\u53d1\u9001\u5230Kafka\u7684topic\u4e3a\"loggie\"\u3002

    \u540c\u65f6\u652f\u6301\u5d4c\u5957\u7684\u9009\u62e9\u65b9\u5f0f\uff1a

    {\n\"fields\": {\n\"topic\": \"loggie\"\n},\n\"hello\": \"world\"\n}\n
    \u53ef\u914d\u7f6etopic: ${fields.topic}\uff0c\u540c\u6837\u4e5f\u4f1a\u53d1\u9001\u5230topic \"loggie\"\u3002

    "},{"location":"reference/pipelines/sink/kafka/#ifrendertopicfailed","title":"ifRenderTopicFailed","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ifRenderTopicFailed \u975e\u5fc5\u586b \u5982\u679c\u4f7f\u7528\u52a8\u6001\u7684\u89c4\u5219\u6e32\u67d3topic\uff0c\u6bd4\u5982topic: ${fields.topic}\uff0c\u6709\u53ef\u80fd\u6e32\u67d3\u5931\u8d25\uff08\u6bd4\u5982\u65e5\u5fd7\u6ca1\u6709fields.topic\u5b57\u6bb5\uff09\uff0c\u4e0b\u9762\u914d\u7f6e\u6307\u793a\u5931\u8d25\u540e\u7684\u52a8\u4f5c\u3002 ifRenderTopicFailed.dropEvent \u975e\u5fc5\u586b true \u9ed8\u8ba4\u4e3a\u4e22\u5f03 ifRenderTopicFailed.ignoreError \u975e\u5fc5\u586b \u5ffd\u7565\u9519\u8bef\u65e5\u5fd7\uff0c\u8bf7\u6ce8\u610f\uff0c\u8fd9\u91cc\u53ea\u662f\u4e0d\u6253\u5370\u9519\u8bef\u65e5\u5fd7 ifRenderTopicFailed.defaultTopic \u975e\u5fc5\u586b \u53d1\u9001\u81f3\u8be5\u9ed8\u8ba4\u7684topic\uff0c\u914d\u7f6e\u540edropEvent\u4e0d\u751f\u6548

    Example

    12
    sink:\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\nifRenderTopicFailed:\ndropEvent: true\n
    sink:\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\nifRenderTopicFailed:\nignoreError: true\ndefaultTopic: default\n
    "},{"location":"reference/pipelines/sink/kafka/#ignoreunknowntopicorpartition","title":"ignoreUnknownTopicOrPartition","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ignoreUnknownTopicOrPartition \u975e\u5fc5\u586b \u7528\u4e8e\u5f53\u53d1\u9001\u7684topic\u4e0d\u5b58\u5728\u65f6\uff0c\u5ffd\u7565Kafka\u8fd4\u56deUNKNOWN_TOPIC_OR_PARTITION\u7684\u62a5\u9519 "},{"location":"reference/pipelines/sink/kafka/#balance","title":"balance","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 balance string \u975e\u5fc5\u586b roundRobin \u8d1f\u8f7d\u5747\u8861\u7b56\u7565\uff0c\u53ef\u586bhash\u3001roundRobin\u3001leastBytes"},{"location":"reference/pipelines/sink/kafka/#compression","title":"compression","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compression string \u975e\u5fc5\u586b gzip \u65e5\u5fd7\u53d1\u9001\u81f3Kafka\u7684\u538b\u7f29\u7b56\u7565\uff0c\u53ef\u586bgzip\u3001snappy\u3001lz4\u3001zstd"},{"location":"reference/pipelines/sink/kafka/#maxattempts","title":"maxAttempts","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxAttempts int \u975e\u5fc5\u586b 10 \u53d1\u9001\u6700\u591a\u91cd\u8bd5\u6b21\u6570"},{"location":"reference/pipelines/sink/kafka/#batchsize","title":"batchSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchSize int \u975e\u5fc5\u586b 100 \u53d1\u9001\u65f6\u6bcf\u4e2abatch\u6700\u591a\u5305\u542b\u7684\u6570\u636e\u4e2a\u6570"},{"location":"reference/pipelines/sink/kafka/#batchbytes","title":"batchBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchBytes int \u975e\u5fc5\u586b 1048576 \u6bcf\u4e2a\u53d1\u9001\u8bf7\u6c42\u5305\u542b\u7684\u6700\u5927\u5b57\u8282\u6570"},{"location":"reference/pipelines/sink/kafka/#batchtimeout","title":"batchTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchTimeout time.Duration \u975e\u5fc5\u586b 1s \u5f62\u6210\u6bcf\u4e2a\u53d1\u9001batch\u7684\u6700\u957f\u65f6\u95f4"},{"location":"reference/pipelines/sink/kafka/#readtimeout","title":"readTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 readTimeout time.Duration \u975e\u5fc5\u586b 10s \u8bfb\u53d6\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/kafka/#writetimeout","title":"writeTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 writeTimeout time.Duration \u975e\u5fc5\u586b 10s \u5199\u5165\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/kafka/#requiredacks","title":"requiredAcks","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 requiredAcks int \u975e\u5fc5\u586b 0 \u7b49\u5f85ack\u53c2\u6570\uff0c\u53ef\u4e3a0\u30011\u3001-1 "},{"location":"reference/pipelines/sink/kafka/#sasl","title":"sasl","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sasl \u975e\u5fc5\u586b SASL authentication sasl.type string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1aplain\u3001scram sasl.username string \u5fc5\u586b \u7528\u6237\u540d\uff0c\u8bf7\u6ce8\u610f\u5728v1.4\u548c\u4e4b\u524d\u4f7f\u7528\u7684\u540d\u79f0\u4e3auserName\uff0c\u5f53\u7136\u540e\u7eed\u7248\u672c\u4e5f\u5bf9\u6b64\u8fdb\u884c\u4e86\u517c\u5bb9 sasl.password string \u5fc5\u586b \u5bc6\u7801 sasl.algorithm string type=scram\u65f6\u5fc5\u586b type=scram\u65f6\u4f7f\u7528\u7684\u7b97\u6cd5\uff0c\u53ef\u9009sha256\u3001sha512"},{"location":"reference/pipelines/sink/kafka/#partitionkey","title":"partitionKey","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 partitionKey string \u975e\u5fc5\u586b \u65e0 \u63a7\u5236\u53d1\u9001\u81f3topic\u4e0b\u54ea\u4e2a\u5206\u533a

    \u4e0etopic\u76f8\u4f3c\uff0c\u53ef\u4f7f\u7528${a.b}\u7684\u65b9\u5f0f\uff0c\u83b7\u53d6event\u91cc\u7684\u5b57\u6bb5\u503c\u4f5c\u4e3a\u5177\u4f53\u7684topic\u540d\u79f0\u3002

    "},{"location":"reference/pipelines/sink/loki/","title":"loki","text":"

    loki sink\u7528\u4e8e\u53d1\u9001\u6570\u636e\u81f3Loki\u5b58\u50a8\u3002Loki\u6587\u6863\u53ef\u53c2\u8003\u8fd9\u91cc\u3002

    Example

    sink:\ntype: loki\nurl: \"http://localhost:3100/loki/api/v1/push\"\n
    "},{"location":"reference/pipelines/sink/loki/#url","title":"url","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 url string \u5fc5\u586b push loki\u7684api"},{"location":"reference/pipelines/sink/loki/#tenantid","title":"tenantId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 tenantId string \u975e\u5fc5\u586b \u53d1\u9001\u4f7f\u7528\u7684\u79df\u6237\u540d\u79f0"},{"location":"reference/pipelines/sink/loki/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 30s \u53d1\u9001\u7684\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/loki/#entryline","title":"entryLine","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 entryLine string \u975e\u5fc5\u586b \u53d1\u9001\u81f3Loki\u7684\u65e5\u5fd7\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3aloggie event\u7684body

    Loki\u7684\u65e5\u5fd7\u6570\u636e\u7ed3\u6784\u5927\u6982\u5206\u4e3alabel\u548c\u4e3b\u4f53\u6570\u636e\uff0cloggie\u4f1a\u9ed8\u8ba4\u5c06header\u91cc\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\uff0c\u8f6c\u6210\u4ee5\u4e0b\u5212\u7ebf_\u8fde\u63a5\u7684label\u3002 \u53e6\u5916\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u7531\u4e8eloki\u7684labels key\u4e0d\u652f\u6301., /, -\uff0c\u8fd9\u91cc\u4f1a\u81ea\u52a8\u5c06header\u91cc\u5305\u542b\u8fd9\u4e9b\u7b26\u53f7\u7684key\u8f6c\u6210_\u7684\u5f62\u5f0f\u3002

    "},{"location":"reference/pipelines/sink/loki/#insecureskipverify","title":"insecureSkipVerify","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 insecureSkipVerify bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u8bc1\u4e66\u8ba4\u8bc1"},{"location":"reference/pipelines/sink/overview/","title":"Overview","text":"

    \u4e00\u4e2aPipeline\u5bf9\u5e94\u4e00\u4e2aSink\u3002

    Concurrency\u76f8\u5173\u914d\u7f6e\u4f7f\u7528\u53ef\u53c2\u7167\u81ea\u9002\u5e94sink\u6d41\u91cf\u63a7\u5236\u3002

    "},{"location":"reference/pipelines/sink/overview/#sink","title":"Sink\u901a\u7528\u914d\u7f6e","text":"

    Example

    sink:\ntype: \"dev\"\ncodec:\ntype: json\npretty: true\nparallelism: 16\nconcurrency:\nenabled: true\nrtt:\nblockJudgeThreshold: 120%\nnewRttWeigh: 0.4\ngoroutine:\ninitThreshold: 8\nmaxGoroutine: 20\nunstableTolerate: 3\nchannelLenOfCap: 0.4\nratio:\nmulti: 2\nlinear: 2\nlinearWhenBlocked: 4\nduration:\nunstable: 15\nstable: 30\n
    "},{"location":"reference/pipelines/sink/overview/#parallelism","title":"parallelism","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 parallelism int \u975e\u5fc5\u586b 1 sink\u5ba2\u6237\u7aef\u7684\u5e76\u53d1\u5ea6\uff0c\u53ef\u540c\u65f6\u542f\u52a8\u591a\u4e2a\u589e\u5927\u53d1\u9001\u541e\u5410\u91cf\uff0c\u53ef\u8bbe\u7f6e\u7684\u6700\u5927\u503c\u4e3a100"},{"location":"reference/pipelines/sink/overview/#codec","title":"codec","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 codec \u975e\u5fc5\u586b sink\u53d1\u9001\u6570\u636e\u7ed9\u4e0b\u6e38\u65f6\uff0c\u6570\u636e\u4f7f\u7528\u7684\u683c\u5f0f codec.type string \u975e\u5fc5\u586b json codec\u7c7b\u578b codec.printEvents bool \u975e\u5fc5\u586b false \u662f\u5426\u6253\u5370\u51faevents\u5230Loggie\u7684\u65e5\u5fd7\u4e2d\uff0c\u53ef\u7528\u4e8e\u4e34\u65f6\u6392\u67e5\u95ee\u9898 codec.pretty bool \u975e\u5fc5\u586b false \u6253\u5370\u51faevents\u5230Loggie\u7684\u65e5\u5fd7\u4e2d\u7684\u65f6\u5019\uff0c\u662f\u5426\u7f8e\u5316\u5c55\u793a\uff0c\u4ec5type:json\u65f6\u751f\u6548\uff0c\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u662f\u53d1\u9001\u5230Elasticsearch\u7b49\u4e0b\u6e38\uff0c\u8bf7\u52ff\u4f7f\u7528pretty\uff0c\u4f1a\u5bfc\u81f4\u53d1\u9001\u5f02\u5e38"},{"location":"reference/pipelines/sink/overview/#type-json","title":"type: json","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 codec.pretty \u975e\u5fc5\u586b false \u662f\u5426\u8fdb\u884cjson\u683c\u5f0f\u7f8e\u5316 codec.beatsFormat \u975e\u5fc5\u586b false \u65e5\u5fd7\u8f6c\u6210\u7c7bfilebeats\u683c\u5f0f\uff1a\u589e\u52a0@timestamp\u5b57\u6bb5\uff0c\u540c\u65f6body\u5b57\u6bb5\u547d\u540d\u4e3amessage"},{"location":"reference/pipelines/sink/overview/#type-raw","title":"type: raw","text":"

    \u7528\u4e8e\u53d1\u9001\u91c7\u96c6\u7684\u539f\u59cbbody\u6570\u636e\u3002

    Example

    sink:\ntype: dev\ncodec:\ntype: raw\n
    "},{"location":"reference/pipelines/sink/overview/#printevents","title":"printEvents","text":"

    \u662f\u5426\u6253\u5370\u51faevents\u5230Loggie\u7684\u65e5\u5fd7\u4e2d\uff0c\u53ef\u7528\u4e8e\u4e34\u65f6\u6392\u67e5\u95ee\u9898\u3002 \u6b64\u65f6\u65e0\u9700\u5c06\u5f53\u524d\u7684sink type\u4fee\u6539\u4e3adev\uff0c\u66f4\u52a0\u65b9\u4fbf\u3002

    Example

    sink:\ntype: kafka\n...\ncodec:\nprintEvents: true\n
    "},{"location":"reference/pipelines/sink/overview/#concurrency","title":"concurrency","text":"

    Example

    sink:\ntype: kafka\nconcurrency:\nenabled: true\n
    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542fsink\u81ea\u9002\u5e94\u5e76\u53d1\u5ea6\u63a7\u5236

    \u6ce8\uff1a\u9ed8\u8ba4\u6b64\u529f\u80fd\u4e0d\u5f00\u542f\u3002

    "},{"location":"reference/pipelines/sink/overview/#concurrencygoroutine","title":"concurrency.goroutine","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 initThreshold int \u975e\u5fc5\u586b 16 \u521d\u59cb\u9608\u503c\uff0c\u4f4e\u4e8e\u8be5\u503c\uff0c\u534f\u7a0b\u6570\u6307\u6570\u589e\u957f\uff08\u5feb\u542f\u52a8\u9636\u6bb5\uff09\uff0c\u9ad8\u4e8e\u8be5\u503c\uff0c\u7ebf\u6027\u589e\u957f maxGoroutine int \u975e\u5fc5\u586b 30 \u6700\u5927\u534f\u7a0b\u6570 unstableTolerate int \u975e\u5fc5\u586b 3 \u8fdb\u5165\u5e73\u7a33\u9636\u6bb5\u540e\uff0c\u5bf9\u7f51\u7edc\u6ce2\u52a8\u7684\u5bb9\u5fcd\uff0c\u534f\u7a0b\u6570\u9700\u51cf\u5c11\u7684\u60c5\u51b5\u5305\u62ecrtt\u589e\u5927\uff0c\u8bf7\u6c42\u5931\u8d25\uff0c\u534f\u7a0b\u6570\u9700\u589e\u5927\u7684\u60c5\u51b5\u5305\u62ec\u7f51\u7edc\u5e73\u7a33\u4e14channel\u9971\u548c\uff0c\u76f8\u540c\u60c5\u51b5\u51fa\u73b03\u6b21\u624d\u4f1a\u89e6\u53d1\u534f\u7a0b\u6570\u6539\u53d8\uff0c\u82e5\u51fa\u73b0\u7b2c\u56db\u6b21\uff0c\u5c06\u4f1a\u8ffd\u52a0\uff0c\u76f4\u5230\u76f8\u53cd\u7684\u60c5\u51b5\u89e6\u53d1\u534f\u7a0b\u6570\u6539\u53d8\u3002 channelLenOfCap float \u975e\u5fc5\u586b 0.4 channel\u9971\u548c\u9608\u503c\uff0c\u8d85\u8fc7\u8be5\u503c\u8ba4\u4e3a\u534f\u7a0b\u6570\u9700\u589e\u5927\uff0c\u4ec5\u5728rtt\u7a33\u5b9a\u60c5\u51b5\u4e0b\u624d\u4f1a\u8ba1\u7b97\u8be5\u503c"},{"location":"reference/pipelines/sink/overview/#concurrencyrtt","title":"concurrency.rtt","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 blockJudgeThreshold string \u975e\u5fc5\u586b 120% \u5224\u65adrtt\u589e\u5927\u9608\u503c\uff0c\u5f53\u65b0rtt\u8d85\u8fc7\u5f53\u524d\u5e73\u5747rtt\u7684\u5230\u8fbe\u4e00\u5b9a\u7a0b\u5ea6\uff0c\u8ba4\u4e3a\u534f\u7a0b\u6570\u9700\u51cf\u5c11 newRttWeigh float \u975e\u5fc5\u586b 0.5 \u8ba1\u7b97\u65b0\u7684\u5e73\u5747rtt\u65f6\uff0c\u65b0rtt\u7684\u6743\u91cd

    \u6ce8\uff1ablockJudgeThreshold\uff08b\uff09\u652f\u6301\u767e\u5206\u6bd4\u548c\u6d6e\u70b9\u6570\u4e24\u79cd\u3002

    \u82e5\u4e3a\u767e\u5206\u6bd4\uff0c\u5219\u5224\u65ad\u662f\u5426 (\u65b0rtt/\u5e73\u5747rtt)>b \u3002

    \u82e5\u4e3a\u6d6e\u70b9\u6570\uff0c\u5219\u5224\u65ad\u662f\u5426 (\u65b0rtt-\u5e73\u5747rtt)>b \u3002

    "},{"location":"reference/pipelines/sink/overview/#concurrencyratio","title":"concurrency.ratio","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 multi int \u975e\u5fc5\u586b 2 \u5feb\u542f\u52a8\u9636\u6bb5\uff0c\u534f\u7a0b\u6570\u6307\u6570\u589e\u957f\u901f\u7387 linear int \u975e\u5fc5\u586b 2 \uff08\u5feb\u542f\u52a8\u4e4b\u540e\uff09\u534f\u7a0b\u6570\u7ebf\u6027\u589e\u957f\u6216\u51cf\u5c11\u901f\u7387 linearWhenBlocked int \u975e\u5fc5\u586b 4 channel\u6ee1\u65f6(\u4e0a\u6e38\u963b\u585e)\uff0c\u534f\u7a0b\u6570\u7ebf\u6027\u589e\u957f\u901f\u7387"},{"location":"reference/pipelines/sink/overview/#concurrencyduration","title":"concurrency.duration","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 unstable int \u975e\u5fc5\u586b 15 \u975e\u5e73\u7a33\u9636\u6bb5\uff0c\u6536\u96c6\u6570\u636e\u8ba1\u7b97\u534f\u7a0b\u6570\u7684\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\u79d2 stable int \u975e\u5fc5\u586b 30 \u5e73\u7a33\u9636\u6bb5\uff0c\u6536\u96c6\u6570\u636e\u8ba1\u7b97\u534f\u7a0b\u6570\u7684\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\u79d2"},{"location":"reference/pipelines/sink/pulsar/","title":"pulsar","text":"

    pulsar sink\u7528\u4e8e\u53d1\u9001\u6570\u636e\u81f3pulsar\u5b58\u50a8\u3002 \u8be5sink\u4e3abeta\u8bd5\u7528\u72b6\u6001\uff0c\u8bf7\u8c28\u614e\u4f7f\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u3002

    Example

    sink:\ntype: pulsar\nurl: pulsar://localhost:6650\ntopic: my-topic\n
    "},{"location":"reference/pipelines/sink/pulsar/#url","title":"url","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 url string \u5fc5\u586b \u65e0 \u65e5\u5fd7\u53d1\u9001\u7aefpulsar\u8fde\u63a5\u5730\u5740"},{"location":"reference/pipelines/sink/pulsar/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u5fc5\u586b \u65e0 \u53d1\u9001\u65e5\u5fd7\u81f3pulsar\u7684topic"},{"location":"reference/pipelines/sink/pulsar/#producername","title":"producerName","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 producerName string \u975e\u5fc5\u586b \u65e0 specifies a name for the producer"},{"location":"reference/pipelines/sink/pulsar/#properties","title":"properties","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 producerName map \u975e\u5fc5\u586b \u65e0 Properties specifies a set of application defined properties for the producer"},{"location":"reference/pipelines/sink/pulsar/#operationtimeoutseconds","title":"operationTimeoutSeconds","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 operationTimeoutSeconds time.Duration \u975e\u5fc5\u586b 30s Producer-create, subscribe and unsubscribe operations will be retried until this interval, after which the operation will be marked as failed"},{"location":"reference/pipelines/sink/pulsar/#connectiontimeout","title":"connectionTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 connectionTimeout time.Duration \u975e\u5fc5\u586b 5s Timeout for the establishment of a TCP connection"},{"location":"reference/pipelines/sink/pulsar/#sendtimeout","title":"sendTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sendTimeout time.Duration \u975e\u5fc5\u586b 30s SendTimeout set the timeout for a message that is not acknowledged by the server 30s"},{"location":"reference/pipelines/sink/pulsar/#maxpendingmessages","title":"maxPendingMessages","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sendTimeout time.Duration \u975e\u5fc5\u586b \u65e0 MaxPendingMessages specifies the max size of the queue holding the messages pending to receive an acknowledgment from the broker"},{"location":"reference/pipelines/sink/pulsar/#hashingschema","title":"hashingSchema","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 hashingSchema int \u975e\u5fc5\u586b 0 HashingScheme is used to define the partition on where to publish a particular message. 0:JavaStringHash\uff0c1:Murmur3_32Hash"},{"location":"reference/pipelines/sink/pulsar/#compressiontype","title":"compressionType","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compressionType int \u975e\u5fc5\u586b 0 0:NoCompression, 1:LZ4, 2:ZLIB, 3:ZSTD"},{"location":"reference/pipelines/sink/pulsar/#compressionlevel","title":"compressionLevel","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compressionLevel int \u975e\u5fc5\u586b 0 0:Default, 1:Faster, 2:Better"},{"location":"reference/pipelines/sink/pulsar/#loglevel","title":"logLevel","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 logLevel string \u975e\u5fc5\u586b 0 \u65e5\u5fd7\u7ea7\u522b: \"info\",\"debug\", \"error\""},{"location":"reference/pipelines/sink/pulsar/#batchingmaxsize","title":"batchingMaxSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchingMaxSize int \u975e\u5fc5\u586b 2048(KB) BatchingMaxSize specifies the maximum number of bytes permitted in a batch"},{"location":"reference/pipelines/sink/pulsar/#batchingmaxmessages","title":"batchingMaxMessages","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchingMaxMessages int \u975e\u5fc5\u586b 1000 BatchingMaxMessages specifies the maximum number of messages permitted in a batch"},{"location":"reference/pipelines/sink/pulsar/#batchingmaxpublishdelay","title":"batchingMaxPublishDelay","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchingMaxPublishDelay time.Duration \u975e\u5fc5\u586b 10ms BatchingMaxPublishDelay specifies the time period within which the messages sent will be batched"},{"location":"reference/pipelines/sink/pulsar/#usetls","title":"useTLS","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 useTLS bool \u975e\u5fc5\u586b false \u662f\u5426\u4f7f\u7528TLS\u8ba4\u8bc1"},{"location":"reference/pipelines/sink/pulsar/#tlstrustcertsfilepath","title":"tlsTrustCertsFilePath","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 tlsTrustCertsFilePath string \u975e\u5fc5\u586b \u65e0 the path to the trusted TLS certificate file"},{"location":"reference/pipelines/sink/pulsar/#tlsallowinsecureconnection","title":"tlsAllowInsecureConnection","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 tlsAllowInsecureConnection bool \u975e\u5fc5\u586b false Configure whether the Pulsar client accept untrusted TLS certificate from broker"},{"location":"reference/pipelines/sink/pulsar/#certificatepath","title":"certificatePath","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 certificatePath string \u975e\u5fc5\u586b \u65e0 TLS\u8bc1\u4e66\u8def\u5f84"},{"location":"reference/pipelines/sink/pulsar/#privatekeypath","title":"privateKeyPath","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 privateKeyPath string \u975e\u5fc5\u586b \u65e0 TLS privateKey\u8def\u5f84"},{"location":"reference/pipelines/sink/pulsar/#token","title":"token","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 token string \u975e\u5fc5\u586b \u65e0 \u5982\u679c\u4f7f\u7528token\u8ba4\u8bc1\u9274\u6743pulsar\uff0c\u8bf7\u586b\u5199\u6b64\u9879"},{"location":"reference/pipelines/sink/pulsar/#tokenfilepath","title":"tokenFilePath","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 tokenFilePath string \u975e\u5fc5\u586b \u65e0 auth token from a file"},{"location":"reference/pipelines/sink/rocketmq/","title":"rocketmq","text":"

    rocketmq sink \u53ef\u4ee5\u5c06\u65e5\u5fd7\u6570\u636e\u53d1\u9001\u81f3\u4e0b\u6e38 RocketMQ \u3002

    Example

    sink:\ntype: rocketmq\nnameServer: - 127.0.0.1:9876\ntopic: \"log-${fields.topic}\"\n
    "},{"location":"reference/pipelines/sink/rocketmq/#nameserver","title":"nameServer","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 nameServer string \u6570\u7ec4 \u975e\u5fc5\u586b \u65e0 RocketMQ nameserver addr \u5217\u8868"},{"location":"reference/pipelines/sink/rocketmq/#nsresolver","title":"nsResolver","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 nsResolver string \u6570\u7ec4 \u975e\u5fc5\u586b \u65e0 \u7528\u4e8e\u83b7\u53d6 nameserver addr \u7684 reslover \u5217\u8868

    \u6ce8\u610f\uff1anameServer \u548c nsResolver \u4e8c\u9009\u4e00\uff0c\u5fc5\u987b\u8981\u8bbe\u7f6e\u4e00\u4e2a

    "},{"location":"reference/pipelines/sink/rocketmq/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u5fc5\u586b loggie \u53d1\u9001\u65e5\u5fd7\u81f3 RocketMQ \u7684 topic

    \u53ef\u4f7f\u7528 ${a.b} \u7684\u65b9\u5f0f\uff0c\u83b7\u53d6 event \u91cc\u7684\u5b57\u6bb5\u503c\u4f5c\u4e3a\u5177\u4f53\u7684 topic \u540d\u79f0\u3002

    \u6bd4\u5982\uff0c\u4e00\u4e2a event \u4e3a\uff1a

    {\n\"topic\": \"loggie\",\n\"hello\": \"world\"\n}\n
    \u53ef\u914d\u7f6e topic: ${topic}\uff0c\u6b64\u65f6\u8be5 event \u53d1\u9001\u5230 RocketMQ \u7684 topic \u4e3a \"loggie\"\u3002

    \u540c\u65f6\u652f\u6301\u5d4c\u5957\u7684\u9009\u62e9\u65b9\u5f0f\uff1a

    {\n\"fields\": {\n\"topic\": \"loggie\"\n},\n\"hello\": \"world\"\n}\n

    \u53ef\u914d\u7f6e topic: ${fields.topic}\uff0c\u540c\u6837\u4e5f\u4f1a\u53d1\u9001\u5230 topic \"loggie\"\u3002

    "},{"location":"reference/pipelines/sink/rocketmq/#ifrendertopicfailed","title":"ifRenderTopicFailed","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ifRenderTopicFailed object \u975e\u5fc5\u586b \u914d\u7f6e topic \u52a8\u6001\u6e32\u67d3\u5931\u8d25\u7684\u52a8\u4f5c\u53c2\u6570 ifRenderTopicFailed.dropEvent bool \u975e\u5fc5\u586b true \u662f\u5426\u4e22\u5f03\u6b64\u6d88\u606f ifRenderTopicFailed.ignoreError bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u9519\u8bef ifRenderTopicFailed.defaultValue string \u975e\u5fc5\u586b \u65e0 \u6e32\u67d3\u5931\u8d25\u65f6\u4f7f\u7528\u7684\u9ed8\u8ba4\u914d\u7f6e\u7684 topic \u503c"},{"location":"reference/pipelines/sink/rocketmq/#group","title":"group","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 group string \u975e\u5fc5\u586b DEFAULT_PRODUCER \u540c\u4e00\u7c7b Producer \u7684\u96c6\u5408\uff0c\u8fd9\u7c7b Producer \u53d1\u9001\u540c\u4e00\u7c7b\u6d88\u606f\u4e14\u53d1\u9001\u903b\u8f91\u4e00\u81f4"},{"location":"reference/pipelines/sink/rocketmq/#tag","title":"tag","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 tag string \u975e\u5fc5\u586b \u65e0 \u4e3a\u6d88\u606f\u8bbe\u7f6e\u7684\u6807\u5fd7\uff0c\u7528\u4e8e\u540c\u4e00\u4e3b\u9898\u4e0b\u533a\u5206\u4e0d\u540c\u7c7b\u578b\u7684\u6d88\u606f\uff0c\u53ef\u7406\u89e3\u4e3a\u4e8c\u7ea7\u6d88\u606f\u7c7b\u578b\uff0c\u7528\u6765\u8fdb\u4e00\u6b65\u533a\u5206\u67d0\u4e2a Topic \u4e0b\u7684\u6d88\u606f\u5206\u7c7b

    RocketMQ \u6709\u5bf9 tag \u80fd\u529b\u7684\u652f\u6301\uff0c\u56e0\u6b64\uff0c\u7c7b\u4f3c topic\uff0ctag \u4e5f\u53ef\u4f7f\u7528 ${a.b} \u7684\u65b9\u5f0f\uff0c\u83b7\u53d6 event \u91cc\u7684\u5b57\u6bb5\u503c\u4f5c\u4e3a\u5177\u4f53\u7684 tag \u540d\u79f0\u3002

    \u6bd4\u5982\uff0c\u4e00\u4e2a event \u4e3a\uff1a

    {\n\"tag\": \"loggie\",\n\"hello\": \"world\"\n}\n
    \u53ef\u914d\u7f6e tag: ${tag}\uff0c\u6b64\u65f6\u8be5 RocketMQ \u7684\u6d88\u606f\u7684 tag \u4e3a \"loggie\"\u3002

    \u540c\u65f6\u652f\u6301\u5d4c\u5957\u7684\u9009\u62e9\u65b9\u5f0f\uff1a

    {\n\"fields\": {\n\"tag\": \"loggie\"\n},\n\"hello\": \"world\"\n}\n

    \u53ef\u914d\u7f6e tag: ${fields.tag}\uff0c\u540c\u6837\u4e5f\u4f1a\u914d\u7f6e\u6d88\u606f\u7684 tag \u4e3a \"loggie\"\u3002

    "},{"location":"reference/pipelines/sink/rocketmq/#ifrendertagfailed","title":"ifRenderTagFailed","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ifRenderTagFailed object \u975e\u5fc5\u586b \u914d\u7f6e tag \u52a8\u6001\u6e32\u67d3\u5931\u8d25\u7684\u52a8\u4f5c\u53c2\u6570 ifRenderTagFailed.dropEvent bool \u975e\u5fc5\u586b true \u662f\u5426\u4e22\u5f03\u6b64\u6d88\u606f ifRenderTagFailed.ignoreError bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u9519\u8bef ifRenderTagFailed.defaultValue string \u975e\u5fc5\u586b \u65e0 \u6e32\u67d3\u5931\u8d25\u65f6\u4f7f\u7528\u7684\u9ed8\u8ba4\u914d\u7f6e\u7684 tag \u503c

    \u6ce8\u610f\uff1a\u56e0\u4e3a tag \u662f\u975e\u5fc5\u987b\u53c2\u6570\uff0c\u9ed8\u8ba4\u4e3a\u7a7a\uff0c\u56e0\u6b64\uff0c\u53ea\u6709\u914d\u7f6e\u4e86 tag \u5e76\u4e14\u6e32\u67d3\u5931\u8d25\u65f6\uff0cifRenderTagFailed \u53c2\u6570\u624d\u4f1a\u751f\u6548

    "},{"location":"reference/pipelines/sink/rocketmq/#messagekeys","title":"messageKeys","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 messageKeys string \u6570\u7ec4 \u975e\u5fc5\u586b \u65e0 \u6d88\u606f\u7684\u4e1a\u52a1\u6807\u8bc6\uff0c\u7531\u6d88\u606f\u751f\u4ea7\u8005\uff08Producer\uff09\u8bbe\u7f6e\uff0c\u552f\u4e00 \u6807\u8bc6\u67d0\u4e2a\u4e1a\u52a1\u903b\u8f91\uff0c\u6bd4\u5982\u4ee5\u8ba2\u5355 ID \u4e3a key"},{"location":"reference/pipelines/sink/rocketmq/#retry","title":"retry","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 retry int \u975e\u5fc5\u586b 2 \u91cd\u8bd5\u6b21\u6570"},{"location":"reference/pipelines/sink/rocketmq/#sendmsgtimeout","title":"sendMsgTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sendMsgTimeout time.Duration \u975e\u5fc5\u586b 3s \u6d88\u606f\u53d1\u9001\u7684\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/rocketmq/#compresslevel","title":"compressLevel","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compressLevel int \u975e\u5fc5\u586b 5 \u6d88\u606f\u7684\u538b\u7f29\u767b\u8bb0\uff0c\u53d6\u503c\u8303\u56f4\uff1a0 1 2 3 4 5 6 7 8 9"},{"location":"reference/pipelines/sink/rocketmq/#compressmsgbodyoverhowmuch","title":"compressMsgBodyOverHowmuch","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compressMsgBodyOverHowmuch int \u975e\u5fc5\u586b 4096 \u6d88\u606fBody\u8d85\u8fc7\u591a\u5927\u5f00\u59cb\u538b\u7f29\uff08Consumer\u6536\u5230\u6d88\u606f\u4f1a\u81ea\u52a8\u89e3\u538b\u7f29\uff09\uff0c\u5355\u4f4d\u5b57\u8282"},{"location":"reference/pipelines/sink/rocketmq/#topicqueuenums","title":"topicQueueNums","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topicQueueNums int \u975e\u5fc5\u586b 4 \u5728\u53d1\u9001\u6d88\u606f\uff0c\u81ea\u52a8\u521b\u5efa\u670d\u52a1\u5668\u4e0d\u5b58\u5728\u7684topic\u65f6\uff0c\u9ed8\u8ba4\u521b\u5efa\u7684\u961f\u5217\u6570"},{"location":"reference/pipelines/sink/rocketmq/#credentials","title":"credentials","text":"

    credentials \u7528\u4e8e RocketMQ \u5f00\u542f\u4e86 ACL \u6743\u9650\u63a7\u5236\u7684\u573a\u666f

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 credentials object \u975e\u5fc5\u586b \u65e0 \u5ba2\u6237\u7aef\u7528\u4e8e\u8eab\u4efd\u9a8c\u8bc1\u7684\u51ed\u8bc1\u4fe1\u606f\uff0c\u4ec5\u5728\u670d\u52a1\u7aef\u5f00\u542f\u8eab\u4efd\u8bc6\u522b\u548c\u8ba4\u8bc1\u65f6\u9700\u8981\u4f20\u8f93 credentials.accessKey string \u5fc5\u586b \u65e0 accessKey credentials.accessKey string \u5fc5\u586b \u65e0 secretKey credentials.securityToken string \u975e\u5fc5\u586b \u65e0 secretKey"},{"location":"reference/pipelines/sink/sls/","title":"sls","text":"

    sls sink\u7528\u4e8e\u5c06\u65e5\u5fd7\u53d1\u9001\u81f3\u963f\u91cc\u4e91\u53ef\u89c2\u6d4b\u7edf\u4e00\u5b58\u50a8SLS\u3002

    Example

    sink:\ntype: sls\nname: demo\nendpoint: cn-hangzhou.log.aliyuncs.com\naccessKeyId: ${id}\naccessKeySecret: ${secret}\nproject: test\nlogstore: test1\ntopic: myservice\n
    "},{"location":"reference/pipelines/sink/sls/#endpoint","title":"endpoint","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 endpoint string \u5fc5\u586b SLS\u5b58\u50a8\u7684\u8bbf\u95ee\u57df\u540d

    \u4f60\u53ef\u4ee5\u5728\u5177\u4f53project\u9875\u9762\u7684\u9879\u76ee\u6982\u89c8\u4e2d\u67e5\u770b\u5230\u3002

    "},{"location":"reference/pipelines/sink/sls/#accesskeyid","title":"accessKeyId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 accessKeyId string \u5fc5\u586b \u8bbf\u95ee\u7684accessKeyId\uff0c\u8bf7\u67e5\u770b\u963f\u91cc\u4e91\u8d26\u53f7\u7684\u8bbf\u95ee\u51ed\u8bc1\u7ba1\u7406

    \u5efa\u8bae\u4f7f\u7528\u963f\u91cc\u4e91\u7684\u5b50\u8d26\u53f7\uff0c\u5b50\u8d26\u53f7\u9700\u8981\u6709\u5bf9\u5e94project\u3001logstore\u7684\u6743\u9650\u3002

    "},{"location":"reference/pipelines/sink/sls/#accesskeysecret","title":"accessKeySecret","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 accessKeySecret string \u5fc5\u586b \u8bbf\u95ee\u7684accessKeySecret\uff0c\u8bf7\u67e5\u770b\u963f\u91cc\u4e91\u8d26\u53f7\u7684\u8bbf\u95ee\u51ed\u8bc1\u7ba1\u7406"},{"location":"reference/pipelines/sink/sls/#project","title":"project","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 project string \u5fc5\u586b SLS\u5b58\u50a8\u7684project\u540d\u79f0"},{"location":"reference/pipelines/sink/sls/#logstore","title":"logstore","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 logstore string \u5fc5\u586b SLS\u5b58\u50a8\u7684logstore\u540d\u79f0"},{"location":"reference/pipelines/sink/sls/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u975e\u5fc5\u586b \u65e5\u5fd7\u4e3b\u9898\uff08Topic\uff09\u662f\u65e5\u5fd7\u670d\u52a1\u7684\u57fa\u7840\u7ba1\u7406\u5355\u5143\u3002\u60a8\u53ef\u5728\u91c7\u96c6\u65e5\u5fd7\u65f6\u6307\u5b9aTopic\uff0c\u7528\u4e8e\u533a\u5206\u65e5\u5fd7"},{"location":"reference/pipelines/sink/webhook/","title":"alertWebhook","text":"

    alertWebhook sink\u5c06\u65e5\u5fd7\u6570\u636e\u53d1\u9001\u81f3http\u63a5\u6536\u65b9\u3002 \u4f7f\u7528\u793a\u4f8b\u8bf7\u53c2\u8003\u65e5\u5fd7\u62a5\u8b66

    Example

    sink:\ntype: alertWebhook\naddr: http://localhost:8080/loggie\nheaders:\napi: test1\nlineLimit: 10\ntemplate: |\n******\n
    "},{"location":"reference/pipelines/sink/webhook/#webhook","title":"webhook","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addr string \u975e\u5fc5\u586b \u53d1\u9001alert\u7684http\u5730\u5740\uff0c\u82e5\u4e3a\u7a7a\uff0c\u5219\u4e0d\u4f1a\u53d1\u9001 template string \u975e\u5fc5\u586b \u7528\u6765\u6e32\u67d3\u7684\u6a21\u677f timeout time.Duration \u975e\u5fc5\u586b 30s \u53d1\u9001alert\u7684http timeout headers map \u975e\u5fc5\u586b \u53d1\u9001alert\u7684http header method string \u975e\u5fc5\u586b POST \u53d1\u9001alert\u7684http method, \u5982\u679c\u4e0d\u586bput(\u4e0d\u533a\u5206\u5927\u5c0f\u5199)\uff0c\u90fd\u8ba4\u4e3a\u662fPOST lineLimit int \u975e\u5fc5\u586b 10 \u591a\u884c\u65e5\u5fd7\u91c7\u96c6\u60c5\u51b5\u4e0b\uff0c\u6bcf\u4e2aalert\u4e2d\u5305\u542b\u7684\u6700\u5927\u65e5\u5fd7\u884c\u6570"},{"location":"reference/pipelines/sink/zinc/","title":"zinc","text":"

    zinc sink\u7528\u4e8e\u53d1\u9001\u6570\u636e\u81f3zinc\u5b58\u50a8\u3002

    Example

    sink:\ntype: zinc\nhost: \"http://127.0.0.1:4080\"\nusername: admin\npassword: Complexpass#123\nindex: \"demo\"    
    "},{"location":"reference/pipelines/sink/zinc/#host","title":"host","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 host string \u975e\u5fc5\u586b http://127.0.0.1:4080 zinc\u7684url\u5730\u5740"},{"location":"reference/pipelines/sink/zinc/#username","title":"username","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 username string \u975e\u5fc5\u586b \u53d1\u9001\u81f3zinc\u7684\u7528\u6237\u540d"},{"location":"reference/pipelines/sink/zinc/#password","title":"password","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 password string \u975e\u5fc5\u586b \u53d1\u9001\u81f3zinc\u7684\u5bc6\u7801"},{"location":"reference/pipelines/sink/zinc/#index","title":"index","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 index string \u975e\u5fc5\u586b default \u53d1\u9001\u81f3zinc\u7684index"},{"location":"reference/pipelines/sink/zinc/#skipsslverify","title":"skipSSLVerify","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 skipSSLVerify bool \u975e\u5fc5\u586b true \u662f\u5426\u5ffd\u7565SSL\u6821\u9a8c"},{"location":"reference/pipelines/source/dev/","title":"dev","text":"

    \u7528\u4e8e\u5f00\u53d1\u6216\u8005\u538b\u6d4b\u573a\u666f\u4e0b\uff0c\u81ea\u52a8\u751f\u6210\u6570\u636e\u3002

    Example

    sources:\n- type: dev\nname: benchmark\nqps: 100\nbyteSize: 1024\neventsTotal: 10000\n
    "},{"location":"reference/pipelines/source/dev/#qps","title":"qps","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 qps int \u975e\u5fc5\u586b 1000 \u751f\u6210event\u7684QPS"},{"location":"reference/pipelines/source/dev/#bytesize","title":"byteSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 byteSize int \u975e\u5fc5\u586b 1024 \u5355\u6761event\u7684\u5b57\u8282\u6570"},{"location":"reference/pipelines/source/dev/#eventstotal","title":"eventsTotal","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 eventsTotal int \u975e\u5fc5\u586b -1\uff0c\u65e0\u9650\u4e2a \u53d1\u9001\u7684\u6240\u6709event\u603b\u6570\uff0c\u4e4b\u540e\u4f1a\u505c\u6b62\u53d1\u9001"},{"location":"reference/pipelines/source/elasticsearch/","title":"elasticsearch","text":"

    \u6d88\u8d39elasticsearch\u7684\u6570\u636e\u3002

    Example

    \u5e38\u89c4\u9ad8\u7ea7
    pipelines:\n- name: local\nsources:\n- type: elasticsearch\nname: elastic\nhosts: [\"localhost:9200\"]\nindices: [\"blog*\"]\nsize: 10 # data size per fetch\ninterval: 30s # pull data frequency\n
    pipelines:\n- name: local\nsources:\n- type: elasticsearch\nname: elastic\nhosts:\n- \"localhost:9200\"\n- \"localhost:9201\"\nindices: [\"blog*\"]\nusername: \"bob\"\npassword: \"bob\"\nschema: \"\"\nsniff: false\ngzip: true\nincludeFields: # pull selected field\n- Title\n- Content\n- Author\nexcludeFields: # exclude selected field\n- Content\nquery: | # elastic query phrases\n{\n\"match\": {\"Title\": \"bob\"}\n}\nsize: 10 # data size per fetch\ninterval: 30s # pull data frequency\ntimeout: 5s # pull timeout\ndb: flushTimeout: 2s # persistent the elastic pull location frequency\ncleanInactiveTimeout: 24h # delete the db record after the time\ncleanScanInterval: 1h # check the expired db record frequency\n
    "},{"location":"reference/pipelines/source/elasticsearch/#hosts","title":"hosts","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 hosts string\u6570\u7ec4 \u5fc5\u586b \u6d88\u8d39\u7684elasticsearch url\u5730\u5740"},{"location":"reference/pipelines/source/elasticsearch/#indices","title":"indices","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 index string\u6570\u7ec4 \u5fc5\u586b \u67e5\u8be2elasticsearch\u7684index\u540d\u79f0"},{"location":"reference/pipelines/source/elasticsearch/#username","title":"username","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 username string \u975e\u5fc5\u586b \u6d88\u8d39elasticsearch\u7684\u7528\u6237\u540d"},{"location":"reference/pipelines/source/elasticsearch/#password","title":"password","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 password string \u5fc5\u586b \u6d88\u8d39elasticsearch\u7684\u5bc6\u7801"},{"location":"reference/pipelines/source/elasticsearch/#schema","title":"schema","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 schema string \u975e\u5fc5\u586b http HTTP scheme(http/https)\uff0csniff\u7684\u65f6\u5019\u4f7f\u7528"},{"location":"reference/pipelines/source/elasticsearch/#gzip","title":"gzip","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 gzip bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542fgzip\u538b\u7f29"},{"location":"reference/pipelines/source/elasticsearch/#includefields","title":"includeFields","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 includeFields string\u6570\u7ec4 \u975e\u5fc5\u586b \u53ea\u8fd4\u56de\u6307\u5b9a\u7684_source\u5b57\u6bb5"},{"location":"reference/pipelines/source/elasticsearch/#excludefields","title":"excludeFields","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 excludeFields string\u6570\u7ec4 \u975e\u5fc5\u586b \u6392\u9664\u6307\u5b9a\u7684_source\u5b57\u6bb5"},{"location":"reference/pipelines/source/elasticsearch/#query","title":"query","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 query string \u975e\u5fc5\u586b \u67e5\u8be2elasticsearch\u7684\u8868\u8fbe\u5f0f"},{"location":"reference/pipelines/source/elasticsearch/#size","title":"size","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 size int \u975e\u5fc5\u586b 100 \u6bcf\u6b21\u8bf7\u6c42\u5f97\u5230hits\u8fd4\u56de\u7684\u4e2a\u6570"},{"location":"reference/pipelines/source/elasticsearch/#sortby","title":"sortBy","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sortBy \u5fc5\u586b \u6570\u7ec4 \u7528\u4e8e\u67e5\u8be2\u7684\u6392\u5e8f sortBy.fields string \u5fc5\u586b \u6392\u5e8f\u7684\u5b57\u6bb5 sortBy.ascending bool \u975e\u5fc5\u586b true \u662f\u5426\u6309\u7167\u5347\u5e8f\u6392\u5e8f

    Example

            sortBy:\n        - fields: \"@timestamp\"\n          ascending: true\n        - fields: \"_id\"\n          ascending: true\n
    "},{"location":"reference/pipelines/source/elasticsearch/#interval","title":"interval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 interval time.Duration \u975e\u5fc5\u586b 30s \u5b9a\u65f6\u8bf7\u6c42elasticsearch\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/source/elasticsearch/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 5s \u8bf7\u6c42\u7684\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/source/elasticsearch/#db","title":"db","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 db \u975e\u5fc5\u586b \u6301\u4e45\u5316\u8bb0\u5f55\u67e5\u8be2elasticsearch\u8bf7\u6c42\u7684\u8fdb\u5ea6\uff0c\u4f1a\u5b58\u50a8\u81f3elasticsearch\u4e2d\uff0c\u907f\u514dLoggie\u91cd\u542f\u540e\u91cd\u590d\u6d88\u8d39\u6570\u636e db.indexPrefix string \u975e\u5fc5\u586b .loggie-db \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cloggie\u4f1a\u5c06\u6301\u4e45\u5316\u7684\u6570\u636e\u5b9a\u65f6\u5199\u5165\u683c\u5f0f\u4e3a${indexPrefix}-${pipelineName}-${sourceName}\u7684index\u4e2d db.flushTimeout time.Duration \u975e\u5fc5\u586b 2s \u6301\u4e45\u5316\u6570\u636e\u5199\u5165\u7684\u95f4\u9694\u65f6\u95f4 db.cleanInactiveTimeout time.Duration \u975e\u5fc5\u586b 504h (21day) \u6e05\u7406\u8fc7\u671f\u7684\u6301\u4e45\u5316\u6570\u636e\u8d85\u65f6\u65f6\u95f4 db.cleanScanInterval time.Duration \u975e\u5fc5\u586b 1h \u68c0\u67e5\u8fc7\u671f\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/source/file/","title":"file","text":"

    file source\u7528\u4e8e\u65e5\u5fd7\u91c7\u96c6\u3002

    Example

    sources:\n- type: file\nname: accesslog\n

    Tips

    \u5982\u679c\u4f60\u4f7f\u7528logconfig/clusterlogconfig\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff0cfile source\u91cc\u8fd8\u589e\u52a0\u4e86\u989d\u5916\u7684\u5b57\u6bb5\uff0c\u8bf7\u53c2\u8003\u8fd9\u91cc\u3002

    "},{"location":"reference/pipelines/source/file/#paths","title":"paths","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 paths string\u6570\u7ec4 \u5fc5\u586b \u65e0 \u91c7\u96c6\u7684path\u8def\u5f84\uff0c\u4f7f\u7528glob\u8868\u8fbe\u5f0f\u6765\u5339\u914d\u3002\u652f\u6301glob\u6269\u5c55\u8868\u8fbe\u5f0fBrace Expansion\u548cGlob Star

    Example

    \u9700\u8981\u91c7\u96c6\u7684\u76ee\u6807\u6587\u4ef6\uff1a

    /tmp/loggie/service/order/access.log\n/tmp/loggie/service/order/access.log.2022-04-11\n/tmp/loggie/service/pay/access.log\n/tmp/loggie/service/pay/access.log.2022-04-11\n

    \u5bf9\u5e94\u914d\u7f6e\uff1a

    sources:\n- type: file\npaths:\n- /tmp/loggie/**/access.log{,.[2-9][0-9][0-9][0-9]-[01][0-9]-[0123][0-9]}\n

    "},{"location":"reference/pipelines/source/file/#excludefiles","title":"excludeFiles","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 excludeFiles string\u6570\u7ec4 \u975e\u5fc5\u586b \u65e0 \u6392\u9664\u91c7\u96c6\u7684\u6587\u4ef6\u6b63\u5219\u8868\u8fbe\u5f0f

    Example

    sources:\n- type: file\npaths:\n- /tmp/*.log\nexcludeFiles:\n- \\.gz$\n
    "},{"location":"reference/pipelines/source/file/#ignoreolder","title":"ignoreOlder","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ignoreOlder time.Duration \u975e\u5fc5\u586b \u65e0 \u4f8b\u598248h\uff0c\u8868\u793a\u5ffd\u7565\u66f4\u65b0\u65f6\u95f4\u57282\u5929\u4e4b\u524d\u7684\u6587\u4ef6\uff0c\u65e0\u9700\u8fdb\u884c\u91c7\u96c6"},{"location":"reference/pipelines/source/file/#addonmeta","title":"addonMeta","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addonMeta bool \u975e\u5fc5\u586b false \u662f\u5426\u6dfb\u52a0\u9ed8\u8ba4\u7684\u65e5\u5fd7\u91c7\u96c6state\u5143\u4fe1\u606f

    event\u793a\u4f8b

    {\n\"body\": \"this is test\",\n\"state\": {\n\"pipeline\": \"local\",\n\"source\": \"demo\",\n\"filename\": \"/var/log/a.log\",\n\"timestamp\": \"2006-01-02T15:04:05.000Z\",\n\"offset\": 1024,\n\"bytes\": 4096,\n\"hostname\": \"node-1\"\n}\n}\n

    state\u542b\u4e49\u89e3\u91ca\uff1a

    "},{"location":"reference/pipelines/source/file/#multi","title":"multi","text":"

    \u591a\u884c\u91c7\u96c6\u76f8\u5173\u914d\u7f6e

    Example

    sources:\n- type: file\nname: accesslog\nmulti:\nactive: true\npattern: '^\\d{4}-\\d{2}-\\d{2}'\n
    "},{"location":"reference/pipelines/source/file/#active","title":"active","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 active bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u591a\u884c\u91c7\u96c6\u6a21\u5f0f"},{"location":"reference/pipelines/source/file/#pattern","title":"pattern","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 pattern string \u5f53multi.active=true\u7684\u65f6\u5019\u5fc5\u586b false \u5224\u65ad\u4e3a\u4e00\u6761\u5168\u65b0\u65e5\u5fd7\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u3002\u4f8b\u5982\u914d\u7f6e\u4e3a'^\\['\uff0c\u5219\u8ba4\u4e3a\u884c\u9996\u4ee5[\u5f00\u5934\u624d\u662f\u4e00\u6761\u65b0\u65e5\u5fd7\uff0c\u5426\u5219\u5c06\u8fd9\u884c\u5185\u5bb9\u5408\u5165\u4e0a\u4e00\u6761\u65e5\u5fd7\u4f5c\u4e3a\u4e0a\u4e00\u6761\u65e5\u5fd7\u7684\u4e00\u90e8\u5206

    Example

    \u5047\u8bbe\u6709\u591a\u884c\u65e5\u5fd7\u5982\u4e0b\u6240\u793a\uff1a

    2023-05-11 14:30:15 ERROR Exception in thread \"main\" java.lang.NullPointerException\n     at com.example.MyClass.myMethod(MyClass.java:25)\n     at com.example.MyClass.main(MyClass.java:10)\n
    \u914d\u7f6epattern\u6b63\u5219\uff1a^\\d{4}-\\d{2}-\\d{2} \u4f1a\u5c06\u65e5\u5fd7\u53d8\u6210\u4e00\u884c\u3002\u8fd9\u6837\u5728\u65e5\u5fd7\u67e5\u8be2\u7684\u65f6\u5019\uff0c\u4e0d\u4f1a\u4ea7\u751f\u4e0a\u9762\u7684\u591a\u884c\u5f02\u5e38\u65e5\u5fd7\u5806\u6808\u4e71\u5e8f\u7b49\u95ee\u9898\u3002

    "},{"location":"reference/pipelines/source/file/#maxlines","title":"maxLines","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxLines int \u975e\u5fc5\u586b 500 1\u6761\u65e5\u5fd7\u6700\u591a\u5305\u542b\u51e0\u884c\u5185\u5bb9\u3002\u9ed8\u8ba4500\u884c\uff0c\u8d85\u8fc7\u4e0a\u9650\u5c06\u5f3a\u5236\u53d1\u9001\u5f53\u524d\u65e5\u5fd7\uff0c\u8d85\u51fa\u90e8\u5206\u4f5c\u4e3a\u65b0\u7684\u4e00\u6761\u65e5\u5fd7"},{"location":"reference/pipelines/source/file/#maxbytes","title":"maxBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxBytes int64 \u975e\u5fc5\u586b 131072 1\u6761\u65e5\u5fd7\u6700\u591a\u5305\u542b\u51e0\u4e2a\u5b57\u8282\u3002\u9ed8\u8ba4128K\uff0c\u8d85\u8fc7\u4e0a\u9650\u5c06\u5f3a\u5236\u53d1\u9001\u5f53\u524d\u65e5\u5fd7\uff0c\u8d85\u51fa\u90e8\u5206\u4f5c\u4e3a\u65b0\u7684\u4e00\u6761\u65e5\u5fd7"},{"location":"reference/pipelines/source/file/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 5s 1\u6761\u65e5\u5fd7\u6700\u591a\u7b49\u5f85\u591a\u4e45\u91c7\u96c6\u4e3a\u5b8c\u6574\u76841\u6761\u65e5\u5fd7\u3002\u9ed8\u8ba45s\uff0c\u8d85\u8fc7\u4e0a\u9650\u5c06\u5f3a\u5236\u53d1\u9001\u5f53\u524d\u65e5\u5fd7\uff0c\u8d85\u51fa\u90e8\u5206\u4f5c\u4e3a\u65b0\u7684\u4e00\u6761\u65e5\u5fd7"},{"location":"reference/pipelines/source/file/#readfromtail","title":"readFromTail","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 readFromTail bool \u975e\u5fc5\u586b false \u662f\u5426\u4ece\u6587\u4ef6\u7684\u6700\u65b0\u4e00\u884c\u5f00\u59cb\u91c7\u96c6\uff0c\u800c\u4e0d\u7ba1\u5386\u53f2\u5199\u5165\u5230\u6587\u4ef6\u7684\u5185\u5bb9\u3002\u9002\u7528\u4e8e\u91c7\u96c6\u7cfb\u7edf\u7684\u8fc1\u79fb\u7b49\u573a\u666f"},{"location":"reference/pipelines/source/file/#cleanfiles","title":"cleanFiles","text":"

    \u6e05\u7406\u6587\u4ef6\u76f8\u5173\u914d\u7f6e\u3002\u8fc7\u671f\u4e14\u5df2\u7ecf\u91c7\u96c6\u5b8c\u6210\u7684\u6587\u4ef6\u5c06\u4f1a\u76f4\u63a5\u4ece\u78c1\u76d8\u5220\u9664\u4ee5\u91ca\u653e\u78c1\u76d8\u7a7a\u95f4

    "},{"location":"reference/pipelines/source/file/#maxhistorydays","title":"maxHistoryDays","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxHistoryDays int \u975e\u5fc5\u586b \u65e0 \uff08\u91c7\u96c6\u5b8c\u6210\u540e\u7684\uff09\u6587\u4ef6\u6700\u591a\u4fdd\u7559\u7684\u5929\u6570\u3002\u5982\u679c\u8d85\u51fa\u9650\u5236\uff0c\u5c06\u4f1a\u628a\u6587\u4ef6\u76f4\u63a5\u4ece\u78c1\u76d8\u4e2d\u5220\u9664\u3002\u4e0d\u914d\u7f6e\u5219\u6c38\u8fdc\u4e0d\u4f1a\u5220\u9664\u6587\u4ef6"},{"location":"reference/pipelines/source/file/#cleanunfinished","title":"cleanUnfinished","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cleanUnfinished bool \u975e\u5fc5\u586b false \u5373\u4f7f\u6587\u4ef6\u6ca1\u6709\u88ab\u91c7\u96c6\u5b8c\uff0c\u4f9d\u7136\u4f1a\u88ab\u6e05\u7406"},{"location":"reference/pipelines/source/file/#fdholdtimeoutwheninactive","title":"fdHoldTimeoutWhenInactive","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fdHoldTimeoutWhenInactive time.Duration \u975e\u5fc5\u586b 5m \u5f53\u6587\u4ef6\u7684\u4e0a\u6b21\u91c7\u96c6\u5230\u73b0\u5728\u7684\u65f6\u95f4\u8d85\u8fc7\u9650\u5236\uff08\u6587\u4ef6\u957f\u65f6\u95f4\u6ca1\u6709\u5199\u5165\uff0c\u8ba4\u4e3a\u5927\u6982\u7387\u4e0d\u4f1a\u518d\u5199\u5165\u5185\u5bb9\uff09\uff0c\u5c06\u4f1a\u91ca\u653e\u8be5\u6587\u4ef6\u7684\u6587\u4ef6\u53e5\u67c4\u4ee5\u91ca\u653e\u7cfb\u7edf\u8d44\u6e90"},{"location":"reference/pipelines/source/file/#fdholdtimeoutwhenremove","title":"fdHoldTimeoutWhenRemove","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fdHoldTimeoutWhenRemove time.Duration \u975e\u5fc5\u586b 5m \u5f53\u6587\u4ef6\u88ab\u5220\u9664\u4e14\u672a\u91c7\u96c6\u5b8c\u6210\uff0c\u4f1a\u7b49\u5f85\u7684\u6700\u5927\u65f6\u95f4\u6765\u91c7\u96c6\u5b8c\u6210\u3002\u8d85\u8fc7\u9650\u5236\u4e0d\u7ba1\u6587\u4ef6\u6700\u7ec8\u662f\u5426\u91c7\u96c6\u5b8c\u6210\uff0c\u90fd\u4f1a\u76f4\u63a5\u91ca\u653e\u6587\u4ef6\u53e5\u67c4\u4e0d\u518d\u91c7\u96c6"},{"location":"reference/pipelines/source/file/#workercount","title":"workerCount","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 workerCount int \u975e\u5fc5\u586b 1 \u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u7684\u5de5\u4f5c\u7ebf\u7a0b(goroutine)\u6570\u3002\u5355\u8282\u70b9\u8d85\u8fc7100\u4e2a\u6587\u4ef6\u7684\u65f6\u5019\u8003\u8651\u63d0\u9ad8"},{"location":"reference/pipelines/source/file/#readbuffersize","title":"readBufferSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 readBufferSize int \u975e\u5fc5\u586b 65536 \u5355\u6b21\u8bfb\u53d6\u6587\u4ef6\u7684\u6570\u636e\u91cf\u3002\u9ed8\u8ba464K=65536"},{"location":"reference/pipelines/source/file/#maxcontinueread","title":"maxContinueRead","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxContinueRead int \u975e\u5fc5\u586b 16 \u8fde\u7eed\u8bfb\u53d6\u540c\u4e00\u4e2a\u6587\u4ef6\u5185\u5bb9\u7684\u6b21\u6570\uff0c\u8fbe\u5230\u8fd9\u4e2a\u6b21\u6570\u5c06\u5f3a\u5236\u5207\u6362\u5230\u4e0b\u4e2a\u6587\u4ef6\u8bfb\u53d6\u3002\u4e3b\u8981\u4f5c\u7528\u662f\u7528\u6765\u907f\u514d\u6d3b\u8dc3\u6587\u4ef6\u4e00\u76f4\u5360\u636e\u8bfb\u53d6\u8d44\u6e90\uff0c\u975e\u6d3b\u8dc3\u6587\u4ef6\u957f\u65f6\u95f4\u5f97\u4e0d\u5230\u8bfb\u53d6\u91c7\u96c6"},{"location":"reference/pipelines/source/file/#maxcontinuereadtimeout","title":"maxContinueReadTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxContinueReadTimeout time.Duration \u975e\u5fc5\u586b 3s \u540c\u4e00\u4e2a\u6587\u4ef6\u6700\u957f\u8bfb\u53d6\u65f6\u95f4\uff0c\u8d85\u8fc7\u8fd9\u4e2a\u65f6\u95f4\u5c06\u5f3a\u5236\u5207\u6362\u4e0b\u4e2a\u6587\u4ef6\u8bfb\u53d6\u3002\u4f5c\u7528\u4e0emaxContinueRead\u7c7b\u4f3c"},{"location":"reference/pipelines/source/file/#inactivetimeout","title":"inactiveTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 inactiveTimeout time.Duration \u975e\u5fc5\u586b 3s \u5982\u679c\u5f53\u6587\u4ef6\u4ece\u4e0a\u4e00\u6b21\u91c7\u96c6\u5230\u73b0\u5728\u8d85\u8fc7inactiveTimeout\u7684\u8bdd\uff0c\u5219\u8ba4\u4e3a\u6587\u4ef6\u8fdb\u5165\u4e0d\u6d3b\u8dc3\u72b6\u6001(\u5373\u6700\u540e\u4e00\u6761\u65e5\u5fd7\u5df2\u7ecf\u5199\u5165\u5b8c\u6210)\uff0c\u5219\u53ef\u4ee5\u5b89\u5168\u7684\u91c7\u96c6\u6700\u540e\u4e00\u884c\u65e5\u5fd7"},{"location":"reference/pipelines/source/file/#ignoresymlink","title":"ignoreSymlink","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ignoreSymlink bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u7b26\u53f7\u94fe\u63a5\uff08\u8f6f\u94fe\u63a5\uff09\u7684\u6587\u4ef6"},{"location":"reference/pipelines/source/file/#firstnbytesforidentifier","title":"firstNBytesForIdentifier","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 firstNBytesForIdentifier int \u975e\u5fc5\u586b 128 \u4f7f\u7528\u91c7\u96c6\u76ee\u6807\u6587\u4ef6\u7684\u524dn\u4e2a\u5b57\u7b26\u6765\u751f\u6210\u6587\u4ef6\u552f\u4e00code\u3002\u5982\u679c\u6587\u4ef6\u7684\u5927\u5c0f\u5c0f\u4e8en\uff0c\u5219\u8be5\u6587\u4ef6\u6682\u65f6\u4e0d\u4f1a\u91c7\u96c6\u3002\u7528\u9014\u4e3b\u8981\u662f\uff0c\u7ed3\u5408\u6587\u4ef6inode\u4fe1\u606f\uff0c\u7528\u6765\u7cbe\u786e\u6807\u8bc6\u4e00\u4e2a\u6587\u4ef6\u3002\u8f85\u52a9\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5220\u9664\u6216\u8005\u662f\u6539\u540d"},{"location":"reference/pipelines/source/file/#charset","title":"charset","text":"

    \u7f16\u7801\u8f6c\u6362\uff0c\u7528\u4e8e\u5c06\u4e0d\u540c\u7684\u7f16\u7801\u8f6c\u6362\u4e3autf8\uff0c\u5f53\u4e0b\u652f\u6301\u7684\u7f16\u7801\u8f6c\u6362\u683c\u5f0f.

    Example

        sources:\n- type: file\nname: demo\npaths:\n- /tmp/log/*.log\nfields:\ntopic: \"loggie\"\ncharset: \"gbk\"\n
    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 charset string \u5426 utf-8 \u63d0\u53d6\u5b57\u6bb5\u7684\u5339\u914d\u6a21\u578b

    \u5f53\u524d\u652f\u6301\u7684\u8f6c\u6362\u4e3autf-8\u7684\u7f16\u7801\u683c\u5f0f\u6709

    "},{"location":"reference/pipelines/source/file/#linedelimiter","title":"lineDelimiter","text":"

    \u6362\u884c\u7b26\u76f8\u5173\u914d\u7f6e

    Example

    sources:\n- type: file\nname: demo\nlineDelimiter:\ntype: carriage_return_line_feed\nvalue: \"\\r\\n\"\ncharset: gbk\n
    "},{"location":"reference/pipelines/source/file/#type","title":"type","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 type bool \u975e\u5fc5\u586b auto \u53ea\u6709\u5728type\u662fcustome\u65f6\u5019value\u624d\u4f1a\u6709\u6548

    \u5f53\u524d\u652f\u6301\u7684type\u6709

    \u5bf9\u5e94\u7684\u6362\u884c\u7b26\u4e3a\uff1a

        ```\n        auto:                    {'\\u000A'},\n        line_feed:               {'\\u000A'},\n        vertical_tab:            {'\\u000B'},\n        form_feed:               {'\\u000C'},\n        carriage_return:         {'\\u000D'},\n        carriage_return_line_feed: []byte(\"\\u000D\\u000A\"),\n        next_line:               {'\\u0085'},\n        line_separator:          []byte(\"\\u2028\"),\n        paragraph_separator:     []byte(\"\\u2029\"),\n        null_terminator:         {'\\u0000'},\n    ```\n
    "},{"location":"reference/pipelines/source/file/#value","title":"value","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 value string \u975e\u5fc5\u586b \\n \u6362\u884c\u7b26\u7684\u5185\u5bb9"},{"location":"reference/pipelines/source/file/#charset_1","title":"charset","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 charset string \u975e\u5fc5\u586b utf-8 \u6362\u884c\u7b26\u7f16\u7801"},{"location":"reference/pipelines/source/file/#ack","title":"ack","text":"

    source\u7684\u786e\u8ba4\u673a\u5236\u76f8\u5173\u914d\u7f6e\u3002\u5982\u679c\u9700\u786e\u4fdd\u8981at least once\uff0c\u9700\u8981\u5f00\u542fack\u673a\u5236\uff0c\u4f46\u662f\u4f1a\u6709\u4e00\u5b9a\u6027\u80fd\u987a\u8017

    Caution

    \u8be5\u914d\u7f6e\u53ea\u80fd\u914d\u7f6e\u5728defaults\u4e2d

    Example

    defaults:\nsources:\n- type: file\nack:\nenable: true\n
    "},{"location":"reference/pipelines/source/file/#enable","title":"enable","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enable bool \u975e\u5fc5\u586b true \u662f\u5426\u5f00\u542f\u786e\u8ba4\u673a\u5236"},{"location":"reference/pipelines/source/file/#maintenanceinterval","title":"maintenanceInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maintenanceInterval time.Duration \u975e\u5fc5\u586b 20h \u7ef4\u62a4\u5468\u671f\u3002\u7528\u6765\u5b9a\u65f6\u6e05\u7406\u8fc7\u671f\u7684\u786e\u8ba4\u6587\u4ef6\u6570\u636e(\u4f8b\u5982\u4e0d\u518d\u91c7\u96c6\u7684\u6587\u4ef6\u7684ack\u4fe1\u606f)"},{"location":"reference/pipelines/source/file/#watcher","title":"watcher","text":"

    \u76d1\u63a7\u6587\u4ef6\u53d8\u5316\u7684\u76f8\u5173\u914d\u7f6e

    Caution

    \u8be5\u914d\u7f6e\u53ea\u80fd\u914d\u7f6e\u5728defaults\u4e2d

    Example

    defaults:\nsources:\n- type: file\nwatcher:\nmaxOpenFds: 8000\n
    "},{"location":"reference/pipelines/source/file/#scantimeinterval","title":"scanTimeInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 scanTimeInterval time.Duration \u975e\u5fc5\u586b 10s \u5468\u671f\u6027\u7684\u68c0\u67e5\u6587\u4ef6\u7684\u72b6\u6001\u53d8\u66f4\uff08\u4f8b\u5982\u6587\u4ef6\u7684\u65b0\u5efa\u3001\u5220\u9664\u7b49\uff09\u3002\u9ed8\u8ba4\u6bcf\u969410s\u68c0\u67e5\u4e00\u6b21"},{"location":"reference/pipelines/source/file/#maintenanceinterval_1","title":"maintenanceInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maintenanceInterval time.Duration \u975e\u5fc5\u586b 5m \u5468\u671f\u6027\u7684\u7ef4\u62a4\u5de5\u4f5c\uff08\u4f8b\u5982\u4e0a\u62a5\u91c7\u96c6\u7edf\u8ba1\u4fe1\u606f\u3001\u6e05\u7406\u6587\u4ef6\u7b49\uff09"},{"location":"reference/pipelines/source/file/#maxopenfds","title":"maxOpenFds","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxOpenFds int \u975e\u5fc5\u586b 4096 \u6700\u5927\u6253\u5f00\u7684\u6587\u4ef6\u53e5\u67c4\u6570\u91cf\uff0c\u8d85\u51fa\u540e\u7684\u6587\u4ef6\u5c06\u6682\u65f6\u4e0d\u4f1a\u91c7\u96c6"},{"location":"reference/pipelines/source/file/#maxeofcount","title":"maxEofCount","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxEofCount int \u975e\u5fc5\u586b 3 \u6700\u5927\u8fde\u7eed\u8bfb\u53d6\u6587\u4ef6\u9047\u5230eof\u7684\u6b21\u6570\u3002\u8d85\u8fc7\u9650\u5236\u8ba4\u4e3a\u6587\u4ef6\u6682\u65f6\u4e0d\u6d3b\u8dc3\uff0c\u5c06\u8fdb\u5165\u201c\u50f5\u5c38\u201d\u961f\u5217\u7b49\u5f85\u66f4\u65b0\u4e8b\u4ef6\u88ab\u6fc0\u6d3b"},{"location":"reference/pipelines/source/file/#cleanwhenremoved","title":"cleanWhenRemoved","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cleanWhenRemoved bool \u975e\u5fc5\u586b true \u5f53\u6587\u4ef6\u88ab\u5220\u9664\u540e\uff0c\u662f\u5426\u540c\u6b65\u5220\u9664db\u4e2d\u7684\u91c7\u96c6\u76f8\u5173\u4fe1\u606f"},{"location":"reference/pipelines/source/file/#taskstoptimeout","title":"taskStopTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 taskStopTimeout time.Duration \u975e\u5fc5\u586b 30s \u91c7\u96c6\u4efb\u52a1\u9000\u51fa\u7684\u8d85\u65f6\u65f6\u95f4\u3002\u662f\u4e00\u4e2a\u515c\u5e95\u65b9\u6848\uff0c\u653e\u5728\u91c7\u96c6\u4efb\u52a1\u5047\u6b7b\u5bfc\u81f4\u65e0\u6cd5reload"},{"location":"reference/pipelines/source/file/#db","title":"db","text":"

    v1.5\u7248\u672c\u53ca\u4ee5\u540e\u5df2\u5220\u9664\uff0c\u8bf7\u4f7f\u7528\u5168\u5c40\u914d\u7f6e\u7684db\u66ff\u6362\u3002

    "},{"location":"reference/pipelines/source/franzkafka/","title":"franz kafka","text":"

    \u4f7f\u7528franz-go kafka\u5e93\u6d88\u8d39Kafka\u3002

    \uff08\u672csink\u548ckafka sink\u7684\u533a\u522b\u4e00\u822c\u53ea\u5728\u4e8e\u4f7f\u7528\u7684kafka golang\u5e93\u4e0d\u540c\uff0c\u63d0\u4f9b\u7ed9\u5bf9franz kafka\u5e93\u6709\u504f\u597d\u7684\u7528\u6237\u4f7f\u7528\uff09

    Example

    sources:\n- type: kafka\nbrokers: [\"kafka1.kafka.svc:9092\"]\ntopic: log-*\n

    \u652f\u6301\u7684Kafka\u7248\u672c

    \u8be5kafka sink\u4f7f\u7528\u7684\u662fsegmentio/kafka-go\u5e93\u3002\u5f53\u524dLoggie\u4f7f\u7528\u7684\u5e93\u7248\u672c\u4e3av0.4.39\uff0c\u5bf9\u5e94\u7248\u672c\u6d4b\u8bd5\u652f\u6301\u7684Kafka\u7248\u672c\u4e3a\uff1a0.10.1.0 - 2.7.1

    "},{"location":"reference/pipelines/source/franzkafka/#brokers","title":"brokers","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 brokers string\u6570\u7ec4 \u5fc5\u586b \u65e0 Kafka broker\u5730\u5740"},{"location":"reference/pipelines/source/franzkafka/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u5fc5\u586b \u65e0 \u63a5\u6536\u7684topic\uff0c\u53ef\u4f7f\u7528\u6b63\u5219\u6765\u5339\u914d\u591a\u4e2atopic"},{"location":"reference/pipelines/source/franzkafka/#topics","title":"topics","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topics \u6570\u7ec4 \u5fc5\u586b \u65e0 \u63a5\u6536\u7684topics\uff0c\u53ef\u586b\u591a\u4e2atopic\uff0c\u6216\u8005\u4f7f\u7528\u6b63\u5219\u6765\u5339\u914d\u591a\u4e2atopic"},{"location":"reference/pipelines/source/franzkafka/#groupid","title":"groupId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 groupId string \u975e\u5fc5\u586b loggie Loggie\u6d88\u8d39kafka\u7684groupId"},{"location":"reference/pipelines/source/franzkafka/#clientid","title":"clientId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 clientId string \u975e\u5fc5\u586b loggie Loggie\u6d88\u8d39kafka\u7684clientId"},{"location":"reference/pipelines/source/franzkafka/#worker","title":"worker","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 worker int \u975e\u5fc5\u586b 1 Loggie\u6d88\u8d39Kafka\u7684worker\u7ebf\u7a0b\u4e2a\u6570"},{"location":"reference/pipelines/source/franzkafka/#addonmeta","title":"addonMeta","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addonMeta bool \u975e\u5fc5\u586b true \u662f\u5426\u589e\u52a0\u6d88\u8d39Kafka\u7684\u4e00\u4e9b\u5143\u4fe1\u606f

    \u589e\u52a0\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\u5305\u62ec\uff1a

    "},{"location":"reference/pipelines/source/franzkafka/#fetchmaxwait","title":"fetchMaxWait","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fetchMaxWait time.Duration \u975e\u5fc5\u586b 5s \u5728\u8fd4\u56de\u4e4b\u524d\u7b49\u5f85\u83b7\u53d6\u54cd\u5e94\u8fbe\u5230\u6240\u9700\u7684\u6700\u5c0f\u5b57\u8282\u6570\u7684\u6700\u5927\u65f6\u95f4"},{"location":"reference/pipelines/source/franzkafka/#fetchmaxbytes","title":"fetchMaxBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fetchMaxBytes int \u975e\u5fc5\u586b 50 << 20 \uff0850MiB\uff09 \u83b7\u53d6\u7684\u6700\u5927\u5b57\u8282\u6570\u91cf"},{"location":"reference/pipelines/source/franzkafka/#fetchminbytes","title":"fetchMinBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fetchMinBytes int \u975e\u5fc5\u586b 1 \u83b7\u53d6\u7684\u6700\u5c0f\u5b57\u8282\u6570\u91cf"},{"location":"reference/pipelines/source/franzkafka/#fetchmaxpartitionbytes","title":"fetchMaxPartitionBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fetchMaxPartitionBytes int \u975e\u5fc5\u586b 50 << 20 \uff0850MiB\uff09 \u4ece\u5355\u4e2a\u5206\u533a\u83b7\u53d6\u7684\u6700\u5927\u5b57\u8282\u6570\u91cf"},{"location":"reference/pipelines/source/franzkafka/#enableautocommit","title":"enableAutoCommit","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enableAutoCommit bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u81ea\u52a8commit\u5230kafka"},{"location":"reference/pipelines/source/franzkafka/#autocommitinterval","title":"autoCommitInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 autoCommitInterval time.Duration \u975e\u5fc5\u586b 1s \u81ea\u52a8commit\u5230kafka\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/source/franzkafka/#autooffsetreset","title":"autoOffsetReset","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 autoOffsetReset string \u975e\u5fc5\u586b latest \u5982\u679c\u6ca1\u6709\u5bf9\u5e94\u7684offset\uff0c\u5219\u4e00\u5f00\u59cb\u4ece\u4ec0\u4e48\u5730\u65b9\u6d88\u8d39topic\u6570\u636e\uff0c\u53ef\u4e3a\uff1alatest\u6216\u8005earliest"},{"location":"reference/pipelines/source/franzkafka/#sasl","title":"sasl","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sasl \u975e\u5fc5\u586b SASL authentication sasl.enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u542f\u7528 sasl.mechanism string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1aPLAIN\u3001SCRAM-SHA-256\u3001SCRAM-SHA-512\u3001GSSAPI sasl.username string \u5fc5\u586b \u7528\u6237\u540d sasl.password string \u5fc5\u586b \u5bc6\u7801"},{"location":"reference/pipelines/source/franzkafka/#gssapi","title":"gssapi","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sasl.gssapi \u975e\u5fc5\u586b SASL authentication sasl.gssapi.authType string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1a1 \u4f7f\u7528\u8d26\u53f7\u5bc6\u7801\u30012 \u4f7f\u7528keytab sasl.gssapi.keyTabPath string \u5fc5\u586b keytab \u6587\u4ef6\u8def\u5f84 sasl.gssapi.kerberosConfigPath string \u5fc5\u586b kerbeos \u6587\u4ef6\u8def\u5f84 sasl.gssapi.serviceName string \u5fc5\u586b \u670d\u52a1\u540d\u79f0 sasl.gssapi.userName string \u5fc5\u586b \u7528\u6237\u540d sasl.gssapi.password string \u5fc5\u586b \u5bc6\u7801 sasl.gssapi.realm string \u5fc5\u586b \u9886\u57df sasl.gssapi.disablePAFXFAST bool type=scram\u65f6\u5fc5\u586b DisablePAFXFAST \u7528\u4e8e\u5c06\u5ba2\u6237\u7aef\u914d\u7f6e\u4e3a\u4e0d\u4f7f\u7528 PA_FX_FAST"},{"location":"reference/pipelines/source/grpc/","title":"grpc","text":"

    Grpc source\u7528\u4e8e\u63a5\u6536Loggie Grpc\u683c\u5f0f\u7684\u6570\u636e\u8bf7\u6c42\u3002 \u4e00\u822c\u7528\u5728\u4e2d\u8f6c\u673a\u573a\u666f\uff0c\u63a5\u6536\u5176\u4ed6Loggie\u96c6\u7fa4\u53d1\u9001\u7684\u65e5\u5fd7\u3002

    Example

    sources:\n- type: grpc\nname: aggre\nport: 6066\n
    "},{"location":"reference/pipelines/source/grpc/#bind","title":"bind","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 bind string \u975e\u5fc5\u586b 0.0.0.0 \u63d0\u4f9bserver\u7ed1\u5b9a\u7684host"},{"location":"reference/pipelines/source/grpc/#port","title":"port","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 port string \u975e\u5fc5\u586b 6066 \u63d0\u4f9b\u670d\u52a1\u7684\u7aef\u53e3\u53f7"},{"location":"reference/pipelines/source/grpc/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 20s \u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/source/kafka/","title":"kafka","text":"

    Kafka source\u7528\u4e8e\u63a5\u6536Kafka\u6570\u636e\u3002

    Example

    sources:\n- type: kafka\nbrokers: [\"kafka1.kafka.svc:9092\"]\ntopic: log-*\n

    \u652f\u6301\u7684Kafka\u7248\u672c

    \u8be5kafka sink\u4f7f\u7528\u7684\u662fsegmentio/kafka-go\u5e93\u3002\u5f53\u524dLoggie\u4f7f\u7528\u7684\u5e93\u7248\u672c\u4e3av0.4.39\uff0c\u5bf9\u5e94\u7248\u672c\u6d4b\u8bd5\u652f\u6301\u7684Kafka\u7248\u672c\u4e3a\uff1a0.10.1.0 - 2.7.1

    "},{"location":"reference/pipelines/source/kafka/#brokers","title":"brokers","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 brokers string\u6570\u7ec4 \u5fc5\u586b \u65e0 Kafka broker\u5730\u5740"},{"location":"reference/pipelines/source/kafka/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u5fc5\u586b \u65e0 \u63a5\u6536\u7684topic\uff0c\u53ef\u4f7f\u7528\u6b63\u5219\u6765\u5339\u914d\u591a\u4e2atopic"},{"location":"reference/pipelines/source/kafka/#topics","title":"topics","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topics \u6570\u7ec4 \u5fc5\u586b \u65e0 \u63a5\u6536\u7684topics\uff0c\u53ef\u586b\u591a\u4e2atopic\uff0c\u6216\u8005\u4f7f\u7528\u6b63\u5219\u6765\u5339\u914d\u591a\u4e2atopic"},{"location":"reference/pipelines/source/kafka/#groupid","title":"groupId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 groupId string \u975e\u5fc5\u586b loggie Loggie\u6d88\u8d39kafka\u7684groupId"},{"location":"reference/pipelines/source/kafka/#clientid","title":"clientId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 clientId string \u975e\u5fc5\u586b loggie Loggie\u6d88\u8d39kafka\u7684clientId"},{"location":"reference/pipelines/source/kafka/#worker","title":"worker","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 worker int \u975e\u5fc5\u586b 1 Loggie\u6d88\u8d39Kafka\u7684worker\u7ebf\u7a0b\u4e2a\u6570"},{"location":"reference/pipelines/source/kafka/#addonmeta","title":"addonMeta","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addonMeta bool \u975e\u5fc5\u586b true \u662f\u5426\u589e\u52a0\u6d88\u8d39Kafka\u7684\u4e00\u4e9b\u5143\u4fe1\u606f

    \u589e\u52a0\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\u5305\u62ec\uff1a

    "},{"location":"reference/pipelines/source/kafka/#queuecapacity","title":"queueCapacity","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 queueCapacity int \u975e\u5fc5\u586b 100 \u5185\u90e8\u53d1\u9001\u7684\u961f\u5217\u5bb9\u91cf"},{"location":"reference/pipelines/source/kafka/#minacceptedbytes","title":"minAcceptedBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 minAcceptedBytes int \u975e\u5fc5\u586b 1 \u6700\u5c0f\u63a5\u6536\u7684batch\u5b57\u8282\u6570"},{"location":"reference/pipelines/source/kafka/#maxacceptedbytes","title":"maxAcceptedBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxAcceptedBytes int \u975e\u5fc5\u586b 1e6\uff081MB) \u6700\u5927\u63a5\u6536\u7684\u6d88\u606f\u5b57\u8282\u6570\uff0c\u5982\u679c\u8d85\u8fc7\u4f1a\u88abtruncate\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e3a\u4e00\u4e2a\u80fd\u5bb9\u5fcd\u7684\u8f83\u5927\u7684\u503c"},{"location":"reference/pipelines/source/kafka/#readmaxattempts","title":"readMaxAttempts","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 readMaxAttempts int \u975e\u5fc5\u586b 3 \u6700\u5927\u7684\u91cd\u8bd5\u6b21\u6570"},{"location":"reference/pipelines/source/kafka/#maxpollwait","title":"maxPollWait","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxPollWait time.Duration \u975e\u5fc5\u586b 10s \u63a5\u6536\u7684\u6700\u957f\u7b49\u5f85\u65f6\u95f4"},{"location":"reference/pipelines/source/kafka/#readbackoffmin","title":"readBackoffMin","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 readBackoffMin time.Duration \u975e\u5fc5\u586b 100ms \u5728\u63a5\u6536\u65b0\u7684\u6d88\u606f\u524d\uff0c\u6700\u5c0f\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/source/kafka/#readbackoffmax","title":"readBackoffMax","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 readBackoffMax time.Duration \u975e\u5fc5\u586b 1s \u5728\u63a5\u6536\u65b0\u7684\u6d88\u606f\u524d\uff0c\u6700\u5927\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/source/kafka/#enableautocommit","title":"enableAutoCommit","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enableAutoCommit bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542fautoCommit"},{"location":"reference/pipelines/source/kafka/#autocommitinterval","title":"autoCommitInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 autoCommitInterval time.Duration \u975e\u5fc5\u586b 1s autoCommit\u7684\u95f4\u9694\u65f6\u95f4"},{"location":"reference/pipelines/source/kafka/#autooffsetreset","title":"autoOffsetReset","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 autoOffsetReset string \u975e\u5fc5\u586b latest \u6ca1\u6709offset\u65f6\uff0c\u521d\u59cb\u7684offset\u91c7\u7528\u65b9\u5f0f\uff0c\u53ef\u4e3aearliest\u548clatest"},{"location":"reference/pipelines/source/kafka/#sasl","title":"sasl","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sasl \u975e\u5fc5\u586b SASL authentication sasl.type string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1aplain\u3001scram sasl.usename string \u5fc5\u586b \u7528\u6237\u540d\uff0c\u8bf7\u6ce8\u610f\u5728v1.4\u548c\u4e4b\u524d\u4f7f\u7528\u7684\u540d\u79f0\u4e3auserName\uff0c\u5f53\u7136\u540e\u7eed\u7248\u672c\u4e5f\u5bf9\u6b64\u8fdb\u884c\u4e86\u517c\u5bb9 sasl.password string \u5fc5\u586b \u5bc6\u7801 sasl.algorithm string type=scram\u65f6\u5fc5\u586b type=scram\u65f6\u4f7f\u7528\u7684\u7b97\u6cd5\uff0c\u53ef\u9009sha256\u3001sha512"},{"location":"reference/pipelines/source/kube-event/","title":"kubeEvent","text":"

    \u63a5\u6536Kubernetes events\u7684source\u3002

    \u4f7f\u7528\u65b9\u5f0f\u53ef\u53c2\u8003\u91c7\u96c6Kubernetes Events\u3002

    Example

    sources:\n- type: kubeEvent\nname: event\n
    "},{"location":"reference/pipelines/source/kube-event/#kubeconfig","title":"kubeconfig","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 kubeconfig string \u975e\u5fc5\u586b \u8bf7\u6c42Kubernetes\u7684kubeconfig\u6587\u4ef6\uff0c\u5f53Loggie\u90e8\u7f72\u5728Kubernetes\u96c6\u7fa4\u4e2d\u65f6\uff0c\u65e0\u9700\u586b\u5199\uff0c\u4f1a\u8fdb\u5165in cluster\u6a21\u5f0f"},{"location":"reference/pipelines/source/kube-event/#master","title":"master","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 master string \u975e\u5fc5\u586b \u8bf7\u6c42Kubernetes\u7684master\u5730\u5740\uff0c\u5f53Loggie\u90e8\u7f72\u5728Kubernetes\u96c6\u7fa4\u4e2d\u65f6\uff0c\u65e0\u9700\u586b\u5199"},{"location":"reference/pipelines/source/kube-event/#buffersize","title":"bufferSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 bufferSize int \u975e\u5fc5\u586b 1000 \u76d1\u542c\u7684\u961f\u5217\u5927\u5c0f\uff0c\u6700\u5c0f\u4e3a1"},{"location":"reference/pipelines/source/kube-event/#watchlatestevents","title":"watchLatestEvents","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 watchLatestEvents bool \u975e\u5fc5\u586b false \u662f\u5426\u53ea\u76d1\u542c\u6700\u65b0\u7684events

    \u7531\u4e8eLoggie\u91cd\u542f\u540e\u4f1a\u91cd\u65b0list\u6240\u6709\u7684events\uff0c\u4f1a\u5bfc\u81f4\u91cd\u590d\u53d1\u9001\uff0c\u5982\u679c\u4e0d\u5e0c\u671b\u91cd\u590d\u53d1\u9001\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e3atrue\uff0c\u5f53\u7136\u53ef\u80fd\u5bfc\u81f4\u91cd\u542f\u65f6\u95f4\u6bb5\u5185\u65b0\u4ea7\u751f\u7684events\u4e22\u5931\u3002

    "},{"location":"reference/pipelines/source/kube-event/#blacklistnamespaces","title":"blackListNamespaces","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 blackListNamespaces string\u6570\u7ec4 \u975e\u5fc5\u586b \u4e0d\u63a5\u6536\u5176\u4e2d\u5b9a\u4e49\u7684namespaces\u4e2d\u4ea7\u751f\u7684events"},{"location":"reference/pipelines/source/overview/","title":"Overview","text":"

    sources\u5b57\u6bb5\u4e3a\u6570\u7ec4\uff0c\u4e00\u4e2aPipeline\u4e2d\u53ef\u586b\u5199\u591a\u4e2asource\u7ec4\u4ef6\u914d\u7f6e\u3002

    \u56e0\u6b64\uff0c\u8bf7\u6ce8\u610f\u6240\u6709\u7684source\u4e2dname\u5fc5\u586b\uff0c\u4f5c\u4e3apipeline\u4e2dsource\u7684\u552f\u4e00\u6807\u8bc6\u3002

    "},{"location":"reference/pipelines/source/overview/#source","title":"Source\u901a\u7528\u914d\u7f6e","text":"

    \u6240\u6709Source\u5747\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u914d\u7f6e\u3002

    "},{"location":"reference/pipelines/source/overview/#enabled","title":"enabled","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b true \u8868\u793a\u662f\u5426\u5f00\u542f\u8be5source"},{"location":"reference/pipelines/source/overview/#name","title":"name","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 name string \u5fc5\u586b \u8868\u793asource\u7684\u540d\u79f0\uff0c\u5efa\u8bae\u586b\u5199\u6709\u6807\u8bc6\u610f\u4e49\u7684\u8bcd"},{"location":"reference/pipelines/source/overview/#fields","title":"fields","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fields map \u975e\u5fc5\u586b \u81ea\u5b9a\u4e49\u989d\u5916\u6dfb\u52a0\u5230event\u4e2d\u7684\u5b57\u6bb5

    \u6bd4\u5982\u5982\u4e0b\u914d\u7f6e:

    Example

    sources:\n- type: file\n  name: access\n  paths:\n  - /var/log/*.log\n  fields:\n    service: demo\n

    \u4f1a\u7ed9\u91c7\u96c6\u7684\u6240\u6709\u65e5\u5fd7\u4e0a\uff0c\u90fd\u52a0\u4e0aservice: demo\u5b57\u6bb5\u3002

    "},{"location":"reference/pipelines/source/overview/#fieldsfromenv","title":"fieldsFromEnv","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fieldsFromEnv map \u975e\u5fc5\u586b \u989d\u5916\u6dfb\u52a0\u5230event\u4e2d\u7684\u5b57\u6bb5\uff0cvalue\u4e3aenv\u73af\u5883\u53d8\u91cf\u7684key

    \u6bd4\u5982\u5982\u4e0b\u914d\u7f6e:

    Example

    sources:\n- type: file\n  name: access\n  paths:\n  - /var/log/*.log\n  fieldsFromEnv:\n    service: SVC_NAME\n

    \u4f1a\u4eceLoggie\u6240\u5728\u7684\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u83b7\u53d6SVC_NAME\u7684\u503c${SVC_NAME}\uff0c\u7136\u540e\u7ed9\u6240\u6709\u7684\u65e5\u5fd7event\u4e0a\u6dfb\u52a0\u5b57\u6bb5\uff1aservice: ${SVC_NAME}\u3002

    "},{"location":"reference/pipelines/source/overview/#fieldsfrompath","title":"fieldsFromPath","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fieldsFromPath map \u975e\u5fc5\u586b \u989d\u5916\u6dfb\u52a0\u5230event\u4e2d\u7684\u5b57\u6bb5\uff0cvalue\u4e3apath\u6307\u5b9a\u6587\u4ef6\u91cc\u7684\u5185\u5bb9

    \u6bd4\u5982\u5982\u4e0b\u914d\u7f6e:

    Example

    sources:\n- type: file\nname: access\npaths:\n- /var/log/*.log\nfieldsFromPath:\ntest: /tmp/foo\n

    \u5047\u8bbe\u6587\u4ef6/tmp/foo\u7684\u5185\u5bb9\u4e3abar\uff1a

    cat /tmp/foo\n---\nbar\n

    Loggie\u4f1a\u7ed9\u6240\u6709\u7684\u65e5\u5fd7event\u4e0a\u6dfb\u52a0\u5b57\u6bb5\uff1atest: bar\u3002

    "},{"location":"reference/pipelines/source/overview/#fieldsunderroot","title":"fieldsUnderRoot","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fieldsUnderRoot bool \u975e\u5fc5\u586b false \u989d\u5916\u6dfb\u52a0\u7684fields\u662f\u5426\u653e\u5728event\u7684\u6839\u90e8

    \u6bd4\u5982\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f93\u51fa\u7684\u65e5\u5fd7\u683c\u5f0f\u4e3a\uff1a

    {\n\"body\": \"hello world\",\n\"fields\": {\n\"service\": \"demo\"\n}\n}\n

    \u5982\u679c\u8bbe\u7f6efieldsUnderRoot=true\uff0c\u8f93\u51fa\u7684\u65e5\u5fd7\u683c\u5f0f\u4e3a\uff1a

    {\n\"body\": \"hello world\",\n\"service\": \"demo\"\n}\n
    "},{"location":"reference/pipelines/source/overview/#fieldsunderkey","title":"fieldsUnderKey","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fieldsUnderKey string \u975e\u5fc5\u586b fields \u5f53fieldsUnderRoot=false\u65f6\uff0c\u5b57\u6bb5\u7684\u540d\u79f0

    \u6bd4\u5982\u53ef\u4ee5\u4fee\u6539\u9ed8\u8ba4\u7684\u5b57\u6bb5fields\u4e3atag\uff0c\u8f93\u51fa\u7684\u65e5\u5fd7\u4e3a\uff1a

    {\n\"body\": \"hello world\",\n\"tag\": {\n\"service\": \"demo\"\n}\n}\n
    "},{"location":"reference/pipelines/source/overview/#codec","title":"codec","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 codec \u975e\u5fc5\u586b source\u63a5\u6536\u5230\u6570\u636e\u7684\u65f6\u5019\u7528\u4e8e\u89e3\u6790\u9884\u5904\u7406 codec.type string \u975e\u5fc5\u586b \u65e0

    \u8bf7\u6ce8\u610f\uff1a\u76ee\u524d\u4ec5file source\u652f\u6301source codec\u3002

    "},{"location":"reference/pipelines/source/overview/#type-json","title":"type: json","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 codec.bodyFields \u5fc5\u586b \u4f7f\u7528\u89e3\u6790\u8bfb\u53d6\u5230\u7684json\u6570\u636e\u4e2d\u7684\u8be5\u5b57\u6bb5\u4f5c\u4e3abody

    \u914d\u7f6e\u793a\u4f8b\uff1a

    type: json

      sources:\n- type: file\nname: nginx\npaths:\n- /var/log/*.log\ncodec:\ntype: json\nbodyFields: log\n

    \u5982\u679c\u91c7\u96c6\u5230\u7684\u65e5\u5fd7\u4e3a\uff1a

    {\"log\":\"I0610 08:29:07.698664 Waiting for caches to sync\\n\", \"stream\":\"stderr\", \"time:\"2021-06-10T08:29:07.698731204Z\"}\n
    \u5219codec\u540e\u5f97\u5230\u7684event\u4e3a\uff1a
    body: \"I0610 08:29:07.698664 Waiting for caches to sync\"\n

    \u8bf7\u6ce8\u610f\uff1a\u76ee\u524d\u975ebodyFields\u7684\u5b57\u6bb5\u5747\u4f1a\u88ab\u4e22\u5f03\u3002

    "},{"location":"reference/pipelines/source/overview/#type-regex","title":"type: regex","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 codec.pattern \u5fc5\u586b \u6b63\u5219\u8868\u8fbe\u5f0f codec.bodyFields \u5fc5\u586b \u4f7f\u7528\u6b63\u5219\u63d0\u53d6\u5230\u7684\u8be5\u5b57\u6bb5\u4f5c\u4e3abody

    \u914d\u7f6e\u793a\u4f8b\uff1a

    type: regex

      sources:\n- type: file\nname: nginx\npaths:\n- /var/log/*.log\ncodec:\ntype: regex\npattern: ^(?P<time>[^ ^Z]+Z) (?P<stream>stdout|stderr) (?P<logtag>[^ ]*) (?P<log>.*)$\nbodyFields: log\n

    \u5982\u679c\u91c7\u96c6\u5230\u7684\u65e5\u5fd7\u4e3a\uff1a

    2021-12-01T03:13:58.298476921Z stderr F INFO [main] Starting service [Catalina]\n
    \u5219codec\u540e\u5f97\u5230\u7684event\u4e3a\uff1a
    body: \"INFO [main] Starting service [Catalina]\"\n

    \u8bf7\u6ce8\u610f\uff1a\u76ee\u524d\u975ebodyFields\u7684\u5b57\u6bb5\u5747\u4f1a\u88ab\u4e22\u5f03\u3002

    "},{"location":"reference/pipelines/source/prometheus-exporter/","title":"prometheusExporter","text":"

    \u91c7\u96c6Prometheus Metrics\u7684\u6307\u6807\u6570\u636e\u3002

    Example

    sources:\n- type: prometheusExporter\nname: metric\nendpoints:\n- \"http://127.0.0.1:9196/metrics\"\n
    "},{"location":"reference/pipelines/source/prometheus-exporter/#endpoints","title":"endpoints","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 endpoints string\u6570\u7ec4 \u5fc5\u586b \u6293\u53d6\u7684\u8fdc\u7aefexporter\u5730\u5740\uff0c\u8bf7\u6ce8\u610fLoggie\u4e0d\u4f1a\u9ed8\u8ba4\u5728\u8bf7\u6c42\u8def\u5f84\u4e2d\u6dfb\u52a0/metrics"},{"location":"reference/pipelines/source/prometheus-exporter/#interval","title":"interval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 interval time.Duration \u975e\u5fc5\u586b 30s \u5b9a\u65f6\u6293\u53d6\u8fdc\u7aefexporter\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/source/prometheus-exporter/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 5s \u6293\u53d6\u8bf7\u6c42\u7684\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/source/prometheus-exporter/#tojson","title":"toJson","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 toJson bool \u975e\u5fc5\u586b false \u662f\u5426\u5c06\u6293\u53d6\u5230\u7684prometheus\u539f\u751f\u6307\u6807\uff0c\u8f6c\u6362\u6210JSON\u683c\u5f0f"},{"location":"reference/pipelines/source/prometheus-exporter/#labels","title":"labels","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 labels map \u975e\u5fc5\u586b \u7ed9\u6240\u6709metrics\u6307\u6807\u589e\u52a0\u989d\u5916\u7684label

    labels\u652f\u6301\u914d\u7f6e${_env.XX}\u7684\u65b9\u5f0f\u83b7\u53d6\u73af\u5883\u53d8\u91cf\u3002 \u4f8b\u5982\uff0c\u914d\u7f6e\uff1a

    labels

        sources:\n- type: prometheusExporter\nname: metric\nendpoints:\n- \"http://127.0.0.1:9196/metrics\"\nlabels:\nsvc: ${_env.SVC}\n

    \u5047\u8bbe\u73af\u5883\u53d8\u91cfSVC=test\uff0c\u4f1a\u5c06\u6240\u6709\u7684metrics\u52a0\u4e0asvc=test\u7684label\u3002

    "},{"location":"reference/pipelines/source/unix/","title":"unix","text":"

    \u901a\u8fc7unix socket\u63a5\u6536\u6570\u636e\u3002

    Example

    sources:\n- type: unix\nname: demo\npath: \"/tmp/loggie.sock\"\n
    "},{"location":"reference/pipelines/source/unix/#path","title":"path","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 path string \u5fc5\u586b \u63a5\u6536\u7684\u8def\u5f84\u540d"},{"location":"reference/pipelines/source/unix/#maxbytes","title":"maxBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxBytes int \u975e\u5fc5\u586b 40960 \u63a5\u6536\u7684\u6700\u5927\u5b57\u8282\u6570"},{"location":"reference/pipelines/source/unix/#maxconnections","title":"maxConnections","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxConnections int \u975e\u5fc5\u586b 512 \u540c\u65f6\u4fdd\u6301\u6700\u591a\u7684\u8fde\u63a5\u6570"},{"location":"reference/pipelines/source/unix/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 5m \u8fde\u63a5\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/source/unix/#mode","title":"mode","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 mode string \u975e\u5fc5\u586b 0755"},{"location":"user-guide/","title":"\u7528\u6237\u6307\u5357","text":"

    \u5728\u672c\u300c\u7528\u6237\u6307\u5357\u300d\u90e8\u5206\uff0c\u6211\u4eec\u4e3b\u8981\u4ecb\u7ecdLoggie\u7684\u4e3b\u8981\u529f\u80fd\u548c\u7279\u6027\uff0c\u540c\u65f6\u5c55\u793a\u5728\u5404\u79cd\u4e0d\u540c\u7684\u573a\u666f\u4e0b\uff0c\u5982\u4f55\u4f7f\u7528Loggie\u6ee1\u8db3\u5404\u7c7b\u9700\u6c42\u3002

    \u5982\u679c\u5e0c\u671b\u67e5\u8be2\u5177\u4f53\u7ec4\u4ef6\u7684\u4f7f\u7528\u4e0e\u914d\u7f6e\u65b9\u5f0f\uff0c\u8bf7\u6233\u300c\u7ec4\u4ef6\u914d\u7f6e\u300d\u3002

    "},{"location":"user-guide/#_2","title":"\u843d\u5730\u4e00\u5957\u65e5\u5fd7\u7cfb\u7edf\u4f1a\u9047\u5230\u54ea\u4e9b\u95ee\u9898\uff1f","text":"

    \u5728\u4f01\u4e1a\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u600e\u4e48\u53bb\u6784\u5efa\u4e00\u5957\u5b8c\u6574\u7684\u65e5\u5fd7\u7cfb\u7edf\uff1f\u5982\u4f55\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u9009\u578b\uff0c\u5176\u4e2d\u53c8\u4f1a\u78b0\u5230\u54ea\u4e9b\u95ee\u9898\uff1f \u5728\u4e0d\u540c\u7684\u4e1a\u52a1\u7c7b\u578b\u3001\u4e0d\u540c\u7684\u4f7f\u7528\u573a\u666f\u3001\u4e0d\u540c\u7684\u65e5\u5fd7\u89c4\u6a21\u4e0b\uff0c\u6211\u4eec\u53ef\u4ee5\u91c7\u7528\u54ea\u4e9b\u65e5\u5fd7\u7cfb\u7edf\u67b6\u6784\uff1f

    \u8bf7\u770b\u300c\u4f01\u4e1a\u5b9e\u6218\u300d\u3002

    \u5728\u6211\u4eec\u5bf9\u843d\u5730\u4e00\u5957\u529f\u80fd\u5b8c\u5584\u3001\u67b6\u6784\u5b8c\u6574\u7684\u65e5\u5fd7\u7cfb\u7edf\u6709\u521d\u6b65\u4e86\u89e3\u540e\uff0c\u60f3\u8981\u77e5\u9053\uff1a

    "},{"location":"user-guide/#loggie","title":"\u4e3a\u4ec0\u4e48Loggie\u80fd\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff1f","text":"

    \u5e02\u9762\u4e0a\u5f00\u6e90\u7684\u65e5\u5fd7\u91c7\u96c6Agent\u5df2\u7ecf\u5f88\u591a\u4e86\uff0c\u6211\u4eec\u4e3a\u4ec0\u4e48\u53c8\u9009\u62e9\u7814\u53d1Loggie\u5462\uff1f Loggie\u7684\u8bde\u751f\u662f\u4e3a\u4e86\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\u5462\uff1f Loggie\u548c\u5176\u4ed6\u7684\u5f00\u6e90\u65e5\u5fd7Agent\u533a\u522b\u662f\u4ec0\u4e48\uff1f

    \u8bf7\u770b\u300c\u67b6\u6784\u4e0e\u7279\u6027\u300d\u3002

    "},{"location":"user-guide/#loggie_1","title":"\u5982\u4f55\u4f7f\u7528Loggie\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff1f","text":"

    \u5982\u4f55\u5728Kubernetes\u96c6\u7fa4\u4e0b\u4f7f\u7528Loggie\uff1f \u8bf7\u770b\u300cKubernetes\u300d\u3002

    \u5982\u4f55\u914d\u7f6e\u5404\u79cd\u4e0d\u540c\u7684\u65e5\u5fd7\u67b6\u6784\uff1f\u5982\u4f55\u63a5\u5165\u73b0\u6709\u7684\u670d\u52a1\uff1f\u5982\u4f55\u914d\u7f6e\u65e5\u5fd7\u7684\u5904\u7406\u548c\u5207\u5206\uff1fLoggie\u8fd8\u63d0\u4f9b\u4e86\u54ea\u4e9b\u6709\u7528\u53c8\u597d\u7528\u7684\u529f\u80fd\uff1f \u8bf7\u770b\u300c\u6700\u4f73\u5b9e\u8df5\u300d\u3002

    \u5982\u4f55\u914d\u7f6e\u6574\u4f53\u7684\u76d1\u63a7\u548c\u62a5\u8b66\uff0c\u4fdd\u8bc1Loggie\u6b63\u5e38\u8fd0\u884c\uff1f\u5982\u4f55\u76d1\u63a7\u662f\u5426\u91c7\u96c6\u5230ERROR\u65e5\u5fd7\uff1f \u8bf7\u770b\u300c\u76d1\u63a7\u62a5\u8b66\u300d\u3002

    "},{"location":"user-guide/architecture/advantages/","title":"Loggie\u7684\u4f18\u52bf\u4e0e\u7279\u6027","text":"

    Loggie\u652f\u6301\u591a\u4e2aPipeline\uff0c\u6bcf\u4e2aPipeline\u90fd\u57fa\u4e8e\u7b80\u5355\u76f4\u89c2\u7684source->interceptor->sink\u7684\u67b6\u6784\u3002 \u8fd9\u6837\u8bbe\u8ba1\u5e26\u6765\u7684\u597d\u5904\u6709\uff1a

    "},{"location":"user-guide/architecture/advantages/#_1","title":"\u5f3a\u9694\u79bb","text":"

    \u591aPipeline\u8bbe\u8ba1\uff0c\u51cf\u5c11\u4e92\u76f8\u5e72\u6270\u3002\u6bd4\u5982\u6211\u4eec\u53ef\u4ee5\u5c06\u91cd\u8981\u7684\u4e1a\u52a1\u65e5\u5fd7\u653e\u5728\u4e00\u4e2aPipeline\u4e2d\uff0c\u5176\u4ed6\u7684\u4e0d\u91cd\u8981\u7684\u65e5\u5fd7\u914d\u7f6e\u4e3a\u53e6\u5916\u7684Pipeline\uff0c\u4e0d\u91cd\u8981\u7684\u65e5\u5fd7\u914d\u7f6e\u53d8\u52a8\u3001\u53d1\u751f\u4e0b\u6e38\u5835\u585e\u65f6\uff0c\u4e0d\u4f1a\u5f71\u54cd\u91cd\u8981\u65e5\u5fd7\u7684\u91c7\u96c6\u548c\u53d1\u9001\u3002

    "},{"location":"user-guide/architecture/advantages/#_2","title":"\u901a\u7528\u6027\u66f4\u597d","text":"

    \u5728\u4e00\u4e9b\u573a\u666f\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u5c06\u4e0d\u540c\u7c7b\u578b\u7684\u670d\u52a1\u6df7\u5408\u90e8\u7f72\u5728\u4e00\u4e2a\u8282\u70b9\u4e0a\uff0c\u5f88\u53ef\u80fd\u4ed6\u4eec\u7684\u65e5\u5fd7\u4f1a\u53d1\u9001\u5230\u4e0d\u540c\u7684Kafka\u96c6\u7fa4\u4e2d\uff0c\u5982\u679c\u53ea\u6709\u4e00\u4e2a\u5168\u5c40\u7684\u8f93\u51fa\u6e90\uff0c\u9700\u8981\u5728\u8282\u70b9\u4e0a\u90e8\u7f72\u4e24\u4e2aAgent\uff0c\u5982\u679c\u4f7f\u7528Loggie\u5219\u53ea\u9700\u8981\u4f7f\u7528\u4e0d\u540c\u7684Pipeline\u5373\u53ef\uff0c\u6bcf\u4e2aPipeline\u914d\u7f6e\u4e0d\u540c\u7684Sink\uff0c\u51cf\u5c11\u90e8\u7f72\u6210\u672c\u3002 \u6211\u4eec\u751a\u81f3\u53ef\u4ee5\u91c7\u96c6\u76f8\u540c\u7684\u65e5\u5fd7\uff0c\u53d1\u9001\u5230\u4e0d\u540c\u7684\u540e\u7aef\u8f93\u51fa\u6e90\uff0c\u6839\u636e\u5b9e\u9645\u9700\u6c42\u7075\u6d3b\u914d\u7f6e\u3002

    "},{"location":"user-guide/architecture/advantages/#_3","title":"\u7075\u6d3b\u3001\u70ed\u63d2\u62d4\u3001\u53ef\u6269\u5c55","text":"

    \u672c\u8d28\u4e0asource->interceptor->sink\u67b6\u6784\u662f\u4e00\u4e2a\u6570\u636e\u6d41\u5f0f\u7684\u8bbe\u8ba1\uff0c\u4e0d\u540c\u7c7b\u578b\u7684source/interceptor/sink\u7684\u6392\u5217\u7ec4\u5408\uff0c\u53ef\u4ee5\u6ee1\u8db3\u65e5\u5fd7\u7684\u4e0d\u540c\u9700\u6c42\uff0c Loggie\u5e76\u6ca1\u6709\u5c06interceptor\u66f4\u7ec6\u5316\u7684\u5206\u7c7b\u6210\u6bd4\u5982Filter/Formater\u7b49\u7c7b\u578b\uff0cinterceptor\u627f\u62c5\u4e86\u9664\u4e86source\u8bfb\u53d6\uff0csink\u53d1\u9001\u4e4b\u5916\u7684\u5927\u90e8\u5206\u5de5\u4f5c\uff0c\u53ea\u9700\u8981\u914d\u7f6e\u4e0d\u540c\u7684interceptor\u5c31\u53ef\u4ee5\u62e5\u6709\u4e2d\u8f6c\u3001\u8fc7\u6ee4\u3001\u89e3\u6790\u3001\u5207\u5206\u3001\u65e5\u5fd7\u62a5\u8b66\u7b49\u80fd\u529b\u3002 \u4e8e\u662f\uff0cLoggie\u53ef\u4ee5\uff1a

    \u5728\u90e8\u7f72\u548c\u7ef4\u62a4\u5c42\u9762\u5e26\u6765\u7684\u597d\u5904\u662f\uff1a \u5982\u679c\u4e4b\u524d\u91c7\u7528\u5e38\u89c4\u7684ELK\u67b6\u6784\uff0c\u4f7f\u7528Filebeat\u91c7\u96c6\u65e5\u5fd7\u3001Logstash\u4e2d\u8f6c\u548c\u89e3\u6790\u65e5\u5fd7\uff0c\u7531\u4e8eFilebeat\u548cLogstash\u662f\u4e24\u4e2a\u4e0d\u540c\u7684\u8bed\u8a00\u6808\uff0c\u5e26\u6765\u6392\u67e5\u95ee\u9898\u548c\u6269\u5c55\u5f00\u53d1\u6210\u672c\u5747\u8f83\u9ad8\u3002 \u6539\u7528Loggie\u540e\u6211\u4eec\u65e0\u9700\u7ef4\u62a4\u4e24\u4e2a\u9879\u76ee\uff0c\u751a\u81f3\u5982\u679c\u6ca1\u6709\u4e2d\u8f6c\u673a\u7684\u9700\u6c42\uff0c\u53ef\u4ee5\u9009\u62e9\u5728Agent\u7aef\u914d\u7f6e\u65e5\u5fd7\u89e3\u6790\u3002

    \u53e6\u5916\uff0c\u76ee\u524d\u9488\u5bf9\u65e5\u5fd7\u62a5\u8b66\uff0c\u5f00\u6e90\u7684\u65b9\u6848\u4e00\u822c\u4e3a\u4f7f\u7528elastAlert\uff0c\u4f46\u662felastAlert\u65e0\u6cd5\u76f4\u63a5\u5bf9\u63a5AlertManager\uff0c\u5e76\u4e14\u5728\u9ad8\u53ef\u7528\u7b49\u65b9\u9762\u5b58\u5728\u95ee\u9898\uff0c\u540c\u65f6\u4f1a\u5f3a\u4f9d\u8d56Elasticsearch\u3002\u6240\u4ee5\u5982\u679c\u4f7f\u7528Loggie\uff0c\u53ef\u4ee5\u65e0\u9700\u5f15\u5165\u989d\u5916\u7684\u7ec4\u4ef6\uff0c\u76f4\u63a5\u4f7f\u7528Loggie\u6765\u68c0\u6d4b\u5f02\u5e38\u65e5\u5fd7\u5e76\u63a5\u5165\u62a5\u8b66\u3002

    "},{"location":"user-guide/architecture/advantages/#_4","title":"\u53ef\u5feb\u901f\u65b9\u4fbf\u7684\u5199\u4e00\u4e2a\u7ec4\u4ef6","text":"

    Loggie\u57fa\u4e8e\u5fae\u5185\u6838\u7684\u67b6\u6784\uff0c\u6240\u6709\u7684source/interceptor/sink/queue\u90fd\u88ab\u62bd\u8c61\u6210component\uff0c\u53ea\u9700\u8981\u5728\u4ee3\u7801\u4e2d\u5b9e\u73b0Golang\u63a5\u53e3\uff0c\u5373\u53ef\u65b9\u4fbf\u7684\u7814\u53d1\u4e00\u4e2acomponent\u3002 \u5982\u679cLoggie\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\uff0c\u65e0\u6cd5\u6ee1\u8db3\u4f60\u7684\u9700\u6c42\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5199\u4e00\u4e2a\u81ea\u5df1\u7684component\u3002 \u6bd4\u5982\u9700\u8981Loggie\u8f6c\u6362\u6210\u7279\u5b9a\u7684\u65e5\u5fd7\u683c\u5f0f\uff0c\u53ef\u4ee5\u5199\u4e00\u4e2ainterceptor\u53bb\u5904\u7406\uff1b\u9700\u8981Loggie\u5c06\u91c7\u96c6\u7684\u65e5\u5fd7\u53d1\u9001\u81f3\u5c1a\u672a\u652f\u6301\u7684\u670d\u52a1\uff0c\u53ef\u4ee5\u5199\u4e00\u4e2asink\u3002 \u5f53\u7136\uff0cLoggie\u4f7f\u7528Golang\u7f16\u5199\uff0c\u6240\u4ee5\u4f60\u76ee\u524d\u9700\u8981\u7528Golang\u6765\u5199component\u3002Golang\u548cJava\u6216\u8005C/C++\u76f8\u6bd4\uff0c\u5728\u6027\u80fd\u548c\u7814\u53d1\u6548\u7387\u4e0a\u6709\u4e00\u4e2a\u6298\u4e2d\uff0c\u66f4\u9002\u5408\u7c7b\u4f3c\u65e5\u5fd7Agent\u7684\u573a\u666f\u3002

    "},{"location":"user-guide/architecture/advantages/#kubernetes","title":"\u66f4\u65b9\u4fbf\u7684Kubernetes\u5bb9\u5668\u65e5\u5fd7\u91c7\u96c6\uff0c\u66f4\u597d\u7684\u4e91\u539f\u751f\u652f\u6301","text":"

    \u5982\u679c\u4f60\u5c1d\u8bd5\u8fc7\u5728Kubernetes\u73af\u5883\u4e0b\u91c7\u96c6\u65e5\u5fd7\uff0c\u5e94\u8be5\u9047\u5230\u8fc7\u8fd9\u4e9b\u95ee\u9898\uff1a

    \u5982\u679c\u4f60\u4f7f\u7528Loggie\uff0c\u4f60\u53ef\u4ee5\uff1a

    1. \u5feb\u901f\u90e8\u7f72\uff0c\u652f\u6301\u5404\u79cd\u90e8\u7f72\u67b6\u6784
    2. \u53ea\u9700\u8981\u4f7f\u7528ClusterLogConfig/LogConfig CRD\u914d\u7f6e\u7ba1\u7406\u65e5\u5fd7\u914d\u7f6e\uff0c\u66f4\u65b9\u4fbf\u7684\u63a5\u5165\u5404\u7c7b\u5bb9\u5668\u4e91\u5e73\u53f0\uff0c\u5bf9\u4e1a\u52a1\u65e0\u4fb5\u5165\uff0c\u65e0\u9700\u5173\u5fc3Pod\u8fc1\u79fb\u7b49\uff0c\u65e0\u9700\u624b\u52a8\u5728\u8282\u70b9\u4e0a\u64cd\u4f5c\u914d\u7f6e\u65e5\u5fd7\u6587\u4ef6\uff0c\u540c\u65f6\u53ef\u914d\u7f6e\u6ce8\u5165Namespace/PodName/NodeName\u7b49\u5143\u4fe1\u606f\u4f9b\u67e5\u8be2\u4f7f\u7528
    "},{"location":"user-guide/architecture/advantages/#_5","title":"\u66f4\u597d\u7684\u7a33\u5b9a\u6027\u3001\u66f4\u8be6\u7ec6\u7684\u76d1\u63a7\u6307\u6807\u3001\u66f4\u65b9\u4fbf\u7684\u6392\u969c\u65b9\u5f0f","text":"

    \u5728\u5b9e\u9645\u7684\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u65e5\u5fd7Agent\u672c\u8eab\u7684\u7a33\u5b9a\u6027\u5f88\u91cd\u8981\uff0c\u540c\u65f6\u4e0d\u5f71\u54cd\u4e1a\u52a1\u4e5f\u5f88\u91cd\u8981\u3002 Loggie\u53ef\u914d\u7f6e\u9650\u6d41interceptor\uff0c\u5728\u65e5\u5fd7\u91cf\u592a\u5927\u65f6\uff0c\u53ef\u4ee5\u907f\u514d\u53d1\u9001\u65e5\u5fd7\u6570\u636e\u5360\u636e\u4e86\u592a\u591a\u7f51\u7edc\u5e26\u5bbd\u3002 Loggie\u6709\u5408\u7406\u7684\u6587\u4ef6\u53e5\u67c4\u5904\u7406\u673a\u5236\uff0c\u907f\u514dfd\u88ab\u5360\u7528\u7684\u5404\u79cd\u5f02\u5e38\u573a\u666f\u5bfc\u81f4\u8282\u70b9\u4e0d\u7a33\u5b9a\u3002

    \u53e6\u5916\uff0cLoggie\u7ed3\u5408\u6211\u4eec\u5728\u5404\u79cd\u73af\u5883\u4e2d\u9047\u5230\u7684\u5404\u79cd\u95ee\u9898\uff0c\u9488\u5bf9\u6027\u7684\u68c0\u6d4b\u66b4\u9732\u51fa\u76f8\u5e94\u7684\u6307\u6807\u3002 \u6bd4\u5982\u6307\u6807\u652f\u6301\u91c7\u96c6\u548c\u53d1\u9001\u5ef6\u8fdf\u68c0\u6d4b\u3002\u6bd4\u5982\u9488\u5bf9\u6587\u4ef6size\u589e\u957f\u592a\u5feb\uff0c\u6216\u8005\u6587\u4ef6size\u592a\u5927\u7b49\u573a\u666f\uff0c\u652f\u6301\u8be5\u7c7bmetric\u4e0a\u62a5\u3002

    \u540c\u65f6Loggie\u652f\u6301\u539f\u751fPrometheus metric\uff0c\u53ef\u907f\u514d\u989d\u5916\u90e8\u7f72exporter\u5e26\u6765\u7684\u90e8\u7f72\u6210\u672c\u548c\u8d44\u6e90\u6d88\u8017\u3002Loggie\u8fd8\u63d0\u4f9b\u4e86\u5b8c\u5584\u7684Grafana\u76d1\u63a7\u56fe\u8868\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5feb\u901f\u63a5\u5165\u4f7f\u7528\u3002

    "},{"location":"user-guide/architecture/advantages/#_6","title":"\u66f4\u4f4e\u7684\u8d44\u6e90\u5360\u7528\uff0c\u66f4\u597d\u7684\u6027\u80fd","text":"

    Loggie\u57fa\u4e8eGolang\u7f16\u5199\uff0c\u5728\u4ee3\u7801\u5c42\u9762\u6211\u4eec\u6709\u5f88\u591a\u4f18\u5316\uff0c\u5728\u8f83\u5c11\u8d44\u6e90\u5360\u7528\u7684\u540c\u65f6\uff0c\u8fd8\u53ef\u63d0\u4f9b\u5f3a\u5927\u7684\u541e\u5410\u6027\u80fd\u3002

    "},{"location":"user-guide/architecture/background/","title":"Loggie\u7684\u8bde\u751f\u80cc\u666f","text":"

    \u4e3a\u4ec0\u4e48\u6211\u4eec\u4f1a\u9009\u62e9\u7814\u53d1Loggie\uff0c\u5f53\u65f6\u7684\u80cc\u666f\u548c\u539f\u56e0\u662f\u4ec0\u4e48\uff1f

    "},{"location":"user-guide/architecture/background/#_1","title":"\u4e00\u3001\u90a3\u4e9b\u5e74\u6211\u4eec\u9047\u5230\u7684\u95ee\u9898","text":"

    \u5728\u7814\u53d1Loggie\u4e4b\u524d\uff0c\u6211\u4eec\u7684\u65e5\u5fd7\u670d\u52a1\u91c7\u96c6\u7aef\u90fd\u662f\u4f7f\u7528Filebeat\uff0c\u5f53\u65f6\u4e3a\u4ec0\u4e48\u9009\u62e9Filebeat\u5462\uff1f

    Filebeat\u662fElastic\u516c\u53f8\u7684\u4ea7\u54c1\uff0c\u4e3b\u6253\u8f7b\u91cf\u7ea7\uff0c\u7528\u4e8e\u66ff\u6362\u539f\u6709Logstash\u53bb\u5b9e\u73b0\u65e5\u5fd7\u91c7\u96c6\u7684\u5de5\u4f5c\uff0c\u76f8\u6bd4\u4ed6\u4eec\u81ea\u5bb6\u57fa\u4e8eJRuby\u8bed\u8a00\u7684Logstash\uff0cFilebeat\u786e\u5b9e\u662f\u76f8\u5bf9\u8f7b\u91cf\u3001\u8d44\u6e90\u5360\u7528\u5c11\u3002\u548c\u5176\u4ed6\u7684\u5f00\u6e90\u65e5\u5fd7\u91c7\u96c6Agent\u76f8\u6bd4\uff0c\u57fa\u4e8eGolang\u5f00\u53d1\u7684Filebeat\uff0c\u4e5f\u6709\u5f88\u591a\u4f18\u52bf\u3002 \u4f8b\u5982\uff0c\u76f8\u6bd4\u57fa\u4e8eJava\u7684Flume\uff0c\u6027\u80fd\u66f4\u597d\uff0c\u8d44\u6e90\u5360\u7528\u66f4\u5c11\uff1b\u76f8\u6bd4\u57fa\u4e8eRuby\u7684Fluentd\uff0c\u6027\u80fd\u66f4\u597d\uff0c\u4e8c\u6b21\u5f00\u53d1\u66f4\u65b9\u4fbf\uff1b\u76f8\u6bd4\u57fa\u4e8eC\u7684Fluentd-bit\uff0c\u529f\u80fd\u66f4\u5b8c\u5584\uff0c\u5f00\u53d1\u66f4\u53cb\u597d\u3002 \u6240\u4ee5\uff0c\u603b\u4f53\u6765\u8bf4\uff0cFilebeat\u662f\u4e00\u4e2a\u76f8\u5bf9\u6bd4\u8f83\u5e73\u8861\u7684\u65e5\u5fd7\u91c7\u96c6Agent\uff0c\u8fd9\u4e5f\u662f\u6211\u4eec\u5f53\u521d\u9009\u62e9Filebeat\u4f5c\u4e3a\u9ed8\u8ba4\u65e5\u5fd7\u91c7\u96c6Agent\u7684\u539f\u56e0\u3002

    \u4f46\u662f\u968f\u7740\u6211\u4eec\u5bf9Filebeat\u66f4\u52a0\u6df1\u5ea6\u7684\u4f7f\u7528\uff0c\u5728\u516c\u53f8\u96c6\u56e2\u5185\u90e8\u5b9e\u8df5\u548c\u5916\u90e8\u5ba2\u6237\u7684\u4ea4\u4ed8\u4e2d\uff0c\u4e5f\u78b0\u5230\u4e86\u4e00\u4e9b\u95ee\u9898\u3002

    \u7531\u4e8eFilebeat\u8bbe\u8ba1\u5f53\u521d\u8bbe\u8ba1\u65f6\uff0c\u4e3a\u4e86\u533a\u5206\u4e8eLogstash\uff0c\u7a81\u51fa\u8f7b\u91cf\u7ea7\uff0c\u727a\u7272\u4e86\u5f88\u591a\u53ef\u6269\u5c55\u6027\u7684\u8bbe\u8ba1\u3002 \u6700\u660e\u663e\u7684\u5c31\u662f\uff0cFilebeat\u53ea\u6709\u4e00\u4e2aQueue\u548c\u4e00\u4e2aOutput\u3002\u8fd9\u6837\u4e5f\u5bfc\u81f4\u4e86\uff1a

    "},{"location":"user-guide/architecture/background/#_2","title":"\u9694\u79bb\u6027\u5f31","text":"

    \u7531\u4e8e\u6240\u6709\u7684\u670d\u52a1\u65e5\u5fd7\u90fd\u4f1a\u53d1\u9001\u5230\u5168\u5c40\u552f\u4e00\u7684Queue\u91cc\uff0c\u5bfc\u81f4\u670d\u52a1\u65e5\u5fd7\u6570\u636e\u6df7\u5728\u4e00\u8d77\uff0c\u5728\u5f02\u5e38\u573a\u666f\u53d1\u751f\u65f6\uff0c\u65e0\u6cd5\u6709\u9694\u79bb\u6027\u7684\u4fdd\u969c\u3002 \u6bd4\u5982Filebeat\u5168\u5c40\u7684Queue\u5806\u79ef\uff0c\u4f1a\u5bfc\u81f4\u8282\u70b9\u7684\u6240\u6709\u670d\u52a1\u65e5\u5fd7\u5747\u65e0\u6cd5\u53d1\u9001\uff0c\u5982\u679c\u6211\u4eec\u5bf9\u4e0d\u540c\u670d\u52a1\u7684\u65e5\u5fd7\u7684\u7ea7\u522b\u548c\u8981\u6c42\u4e0d\u4e00\u6837\uff0c\u4e0d\u7ba1\u91cd\u8981\u8fd8\u662f\u4e0d\u91cd\u8981\u7684\u65e5\u5fd7\u90fd\u4f1a\u53d7\u5230\u5f71\u54cd\u3002

    "},{"location":"user-guide/architecture/background/#output","title":"\u4e0d\u652f\u6301\u591a\u4e2aOutput","text":"

    \u6709\u4e00\u4e9b\u573a\u666f\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5c06\u4e0d\u540c\u670d\u52a1\u7684\u4e0d\u540c\u7c7b\u578b\u65e5\u5fd7\u53d1\u9001\u81f3\u4e0d\u540c\u7684\u540e\u7aef\uff0c\u4f46Filebeat\u65e0\u6cd5\u4f7f\u7528\u540c\u4e00\u4e2aAgent\u53bb\u53d1\u9001\u5230\u4e0d\u540c\u7684Kafka\u96c6\u7fa4\uff0c\u53ea\u80fd\u5728\u8282\u70b9\u4e0a\u90e8\u7f72\u591a\u4e2aAgent\uff0c\u5bfc\u81f4\u7ef4\u62a4\u548c\u8d44\u6e90\u6210\u672c\u4e0a\u5347\u3002

    "},{"location":"user-guide/architecture/background/#_3","title":"\u53ef\u6269\u5c55\u6027\u6709\u9650","text":"

    \u76f8\u6bd4Logstash/Flume\u7b49\uff0cFilebeat\u5e76\u975e\u4f7f\u7528\u7c7b\u4f3c\u7684input->queue->output\u7684\u7075\u6d3b\u591a\u4e2apipeline\u8bbe\u8ba1\uff0c\u5728\u5bf9\u4e8e\u65e5\u5fd7\u6570\u636e\u7684\u5904\u7406/\u8fc7\u6ee4/\u589e\u5f3a\u4e0a\uff0c\u4f9d\u8d56\u7684\u662fFilebeat\u6709\u9650\u7684\u4e00\u4e9bprocessor\uff0c\u53ef\u6269\u5c55\u6027\u4e0d\u8db3\u3002 \u540c\u65f6Filebeat\u4e5f\u65e0\u6cd5\u4f5c\u4e3a\u4e2d\u8f6c\u805a\u5408\u4f7f\u7528\uff0c\u5728\u4f7f\u7528\u573a\u666f\u4e0b\u5927\u5927\u53d7\u9650\uff0c\u9700\u8981\u989d\u5916\u5f15\u5165\u5176\u4ed6\u7ec4\u4ef6\u3002\u53e6\u5916\u7c7b\u4f3c\u65e5\u5fd7\u62a5\u8b66\u7b49\u573a\u666f\uff0cFilebeat\u4e5f\u65e0\u6cd5\u6ee1\u8db3\u3002 \u6211\u4eec\u4e5f\u5c1d\u8bd5\u8fc7\u5b9a\u5236\u5316\u5f00\u53d1\uff0c\u4f46Filebeat\u672c\u8eab\u7684\u67b6\u6784\u8bbe\u8ba1\u4e0a\u96be\u4ee5\u5b9e\u73b0\u66f4\u591a\u7684\u6269\u5c55\u80fd\u529b\uff0c\u5e76\u4e14\u957f\u671f\u4f1a\u5e26\u6765\u5347\u7ea7\u4e0e\u4e0a\u6e38\u793e\u533a\u4ee3\u7801\u540c\u6b65\u7684\u95ee\u9898\u3002

    "},{"location":"user-guide/architecture/background/#_4","title":"\u65e5\u5fd7\u6392\u969c\u8fd0\u7ef4\u56f0\u5883","text":"

    Filebeat\u7684metrics\u6bd4\u8f83\u6709\u9650\uff0c\u5f88\u591a\u65f6\u5019\u6211\u4eec\u60f3\u8981\u6392\u67e5\u8bf8\u5982\u5e38\u89c1\u7684\u65e5\u5fd7\u662f\u5426\u6709\u91c7\u96c6\u3001\u91c7\u96c6\u7684\u65e5\u5fd7\u662f\u5426\u5b8c\u6574\u3001\u53d1\u9001\u662f\u5426\u6709\u5ef6\u8fdf\u7b49\u7b49\u6392\u969c\u573a\u666f\uff0cFilebeat\u6ca1\u6709\u63d0\u4f9b\u76f8\u5e94\u7684\u529f\u80fd\uff0c\u5341\u5206\u5f71\u54cd\u7ebf\u4e0a\u7684\u95ee\u9898\u6392\u67e5\u6548\u7387\u3002\u800c\u4e14Filebeat\u672a\u63d0\u4f9bPrometheus\u683c\u5f0f\u7684\u76d1\u63a7\u6307\u6807\uff0c\u9700\u8981\u989d\u5916\u6ce8\u5165exporter\u3002

    "},{"location":"user-guide/architecture/background/#_5","title":"\u6027\u80fd\u4e0d\u591f","text":"

    \u867d\u7136Filebeat\u6027\u80fd\u5c1a\u53ef\uff0c\u4f46\u662f\u5728\u6211\u4eec\u7684\u5b9e\u9645\u4f7f\u7528\u65f6\uff0c\u9047\u5230\u65e5\u5fd7\u573a\u666f\u590d\u6742\u3001\u65e5\u5fd7\u91cf\u5927\u7684\u60c5\u51b5\u65f6\uff0c\u5b58\u5728\u541e\u5410\u91cf\u7684\u74f6\u9888\uff0c\u65e0\u6cd5\u6ee1\u8db3\u5b9e\u65f6\u6027\u7684\u9700\u6c42\u3002

    "},{"location":"user-guide/architecture/background/#_6","title":"\u4e8c\u3001\u4e3a\u4ec0\u4e48\u73b0\u6709\u7684\u5176\u4ed6\u5f00\u6e90\u65e5\u5fd7\u9879\u76ee\u4e0d\u80fd\u6ee1\u8db3\u9700\u6c42\uff1f","text":"

    Fluentd/Fluent-bit

    Fluentd\u57fa\u4e8eRuby\u6027\u80fd\u4e00\u822c\uff0c\u5355\u7ebf\u7a0b\uff1bFluent-bit\u57fa\u4e8eC\uff0c\u5bf9\u4e8e\u6211\u4eec\u7684\u6280\u672f\u6808\u6765\u8bf4\uff0cRuby\u548cC\u7684\u7ef4\u62a4\u548c\u4e8c\u6b21\u5f00\u53d1\u6210\u672c\u6bd4\u8f83\u5927\u3002

    Logstash

    Logstash\u6027\u80fd\u8f83\u5dee\uff0c\u57fa\u4e8eJRuby\u7684\u8d44\u6e90\u5360\u7528\u548c\u635f\u8017\u90fd\u6bd4\u8f83\u5927\u3002

    Flume

    \u8d44\u6e90\u5360\u7528\u8f83\u5927\uff0c\u6027\u80fd\u4e00\u822c\uff0c\u4e4b\u524d\u6709\u5185\u90e8\u90e8\u95e8\u4f7f\u7528\u8fc7Flume\uff0c\u5bf9\u6bd4\u7684\u538b\u6d4b\u7ed3\u8bba\u8bc1\u5b9e\u786e\u5b9e\u4e0d\u5982Filebeat\u3002

    \u6700\u91cd\u8981\u7684\u662f\uff0c\u76ee\u524d\u6240\u6709\u7684\u5f00\u6e90Agent\uff0c\u5747\u6ca1\u6709\u5bf9K8s\u6709\u5f88\u597d\u7684\u539f\u751f\u652f\u6301\uff0c\u4e2a\u522b\u652f\u6301\u7684\u4e5f\u53ea\u80fd\u91c7\u96c6stdout\u7684\u65e5\u5fd7\u3002 \u6b63\u662f\u7531\u4e8e\u76ee\u524d\u5f00\u6e90\u7684Agent\u5b58\u5728\u4e00\u4e9b\u95ee\u9898\uff0c\u4e0d\u80fd\u6ee1\u8db3\u957f\u671f\u7684\u9700\u6c42\uff0c\u6240\u4ee5\u6211\u4eec\u51b3\u5b9a\u5f00\u59cb\u81ea\u7814\u3002

    "},{"location":"user-guide/architecture/background/#agent","title":"\u4e09\u3001\u4ec0\u4e48\u624d\u662f\u6211\u4eec\u7406\u60f3\u4e2d\u7684\u65e5\u5fd7Agent\uff1f","text":"

    \u6574\u4f53\u7684\u76ee\u6807\uff1a \u9ad8\u6027\u80fd\u3001\u8d44\u6e90\u5360\u7528\u4f4e\u3001\u9ad8\u53ef\u7528\u3001\u7a33\u5b9a\u6027\u5f3a\u3001\u53ef\u6269\u5c55\u6027\u5f3a\u3001\u66f4\u9002\u5408\u4e91\u539f\u751f\u3002

    \u6027\u80fd\u4e0e\u8d44\u6e90\uff1a \u6027\u80fd\u76f8\u540c\u7684\u60c5\u51b5\u4e0b\uff0cCPU\u6bd4\u793e\u533aFilebeat\u5927\u5927\u964d\u4f4e\uff0c\u541e\u5410\u91cf\u4e0a\u9650\u8981\u8fdc\u9ad8\u4e8eFilebeat\u3002

    \u9ad8\u53ef\u7528\u3001\u7a33\u5b9a\u6027\u5f3a\uff1a \u8d44\u6e90\u9694\u79bb\uff0c\u4f5c\u4e3a\u57fa\u7840\u8bbe\u65bd\u4e00\u5b9a\u8981\u7a33\u5b9a\u53ef\u9760\uff0c\u540c\u65f6\u9ed8\u8ba4\u652f\u6301\u5927\u91cf\u76d1\u63a7\u6307\u6807\uff0c\u5bf9\u5e38\u89c1\u7684\u8fd0\u7ef4\u7c7b\u95ee\u9898\u6709\u826f\u597d\u7684\u652f\u6491\uff0c\u51cf\u5c11\u8fd0\u7ef4\u8d1f\u62c5\u3002

    \u53ef\u6269\u5c55\u6027\uff1a \u6574\u4f53\u8bbe\u8ba1\u4e0a\uff0c\u65b9\u4fbf\u7528\u6237\u6269\u5c55\uff0c\u5b9e\u73b0\u8fc7\u6ee4\u3001\u8def\u7531\u3001\u7f16\u7801\u7b49\u80fd\u529b\u3002\u6bd4\u5982\u53ef\u4ee5\u5f88\u5feb\u901f\u7684\u5199\u4e00\u4e2a\u5904\u7406\u903b\u8f91\uff0c\u5c31\u53ef\u4ee5\u8fdb\u884c\u6570\u636e\u5904\u7406\u3002

    \u603b\u7ed3\u4e00\u4e0b\uff0c\u6211\u4eec\u7406\u60f3\u4e2d\u7684\u65e5\u5fd7Agent\u662f\u4e00\u4e2a\uff1a

    1. \u5f00\u7bb1\u5373\u7528\uff1a\u53ef\u5feb\u901f\u90e8\u7f72\u5bb9\u5668\u5316\u573a\u666f\u4e0b\u7684\u65e5\u5fd7\u91c7\u96c6\u670d\u52a1\uff1b\u6709\u5b8c\u5584\u7684\u6587\u6863\u4e0e\u7ecf\u9a8c\u4ecb\u7ecd\uff1b
    2. \u9ad8\u6027\u80fd\uff1a\u6bd4\u539f\u751fFilebeat\u6027\u80fd\u9ad8\uff0c\u8d44\u6e90\u5360\u7528\u5c11\uff1b
    3. \u9ad8\u53ef\u9760\uff1a\u9694\u79bb\u6027\u7a33\u5b9a\u6027\u66f4\u5f3a\uff1b\u9ed8\u8ba4\u96c6\u6210\u66f4\u591a\u7684\u76d1\u63a7\u6307\u6807\uff0c\u65b9\u4fbf\u8fd0\u7ef4\u6392\u969c\uff1b
    4. \u53ef\u6269\u5c55\uff1a\u57fa\u4e8e\u5fae\u5185\u6838\u7684\u67b6\u6784\uff0c\u7528\u6237\u53ef\u65b9\u4fbf\u5feb\u6377\u7684\u5199\u81ea\u5df1\u7684\u63d2\u4ef6\uff0c\u6ee1\u8db3\u5404\u79cd\u5b9a\u5236\u5316\u9700\u6c42\uff1b
    "},{"location":"user-guide/architecture/compare/","title":"\u5f00\u6e90\u9879\u76ee\u5bf9\u6bd4","text":"Loggie Filebeat Fluentd Logstash Flume \u5f00\u53d1\u8bed\u8a00 Golang Golang Ruby JRuby Java \u591aPipeline \u652f\u6301 \u5355\u961f\u5217 \u5355\u961f\u5217 \u652f\u6301 \u652f\u6301 \u591a\u8f93\u51fa\u6e90 \u652f\u6301 \u4e0d\u652f\u6301\uff0c\u4ec5\u4e00\u4e2aOutput \u914d\u7f6ecopy \u652f\u6301 \u652f\u6301 \u4e2d\u8f6c\u673a \u652f\u6301 \u4e0d\u652f\u6301 \u652f\u6301 \u652f\u6301 \u652f\u6301 \u65e5\u5fd7\u62a5\u8b66 \u652f\u6301 \u4e0d\u652f\u6301 \u4e0d\u652f\u6301 \u4e0d\u652f\u6301 \u4e0d\u652f\u6301 Kubernetes\u5bb9\u5668\u65e5\u5fd7\u91c7\u96c6 \u652f\u6301\u5bb9\u5668\u7684stdout\u548c\u5bb9\u5668\u5185\u90e8\u65e5\u5fd7\u6587\u4ef6 \u53ea\u652f\u6301\u5bb9\u5668stdout \u53ea\u652f\u6301\u5bb9\u5668stdout \u4e0d\u652f\u6301 \u4e0d\u652f\u6301 \u914d\u7f6e\u4e0b\u53d1 Kubernetes\u4e0b\u53ef\u901a\u8fc7CRD\u914d\u7f6e\uff0c\u4e3b\u673a\u573a\u666f\u914d\u7f6e\u4e2d\u5fc3\u9646\u7eed\u652f\u6301\u4e2d \u624b\u52a8\u914d\u7f6e \u624b\u52a8\u914d\u7f6e \u624b\u52a8\u914d\u7f6e \u624b\u52a8\u914d\u7f6e \u76d1\u63a7 \u539f\u751f\u652f\u6301Prometheus metrics\uff0c\u540c\u65f6\u53ef\u914d\u7f6e\u5355\u72ec\u8f93\u51fa\u6307\u6807\u65e5\u5fd7\u6587\u4ef6\u3001\u53d1\u9001metrics\u7b49\u65b9\u5f0f API\u63a5\u53e3\u66b4\u9732\uff0c\u63a5\u5165Prometheus\u9700\u4f7f\u7528\u989d\u5916\u7684exporter \u652f\u6301API\u548cPrometheus metrics \u9700\u4f7f\u7528\u989d\u5916\u7684exporter \u9700\u4f7f\u7528\u989d\u5916\u7684exporter \u8d44\u6e90\u5360\u7528 \u4f4e \u4f4e \u4e00\u822c \u8f83\u9ad8 \u8f83\u9ad8"},{"location":"user-guide/architecture/compare/#_2","title":"\u57fa\u51c6\u6027\u80fd\u6d4b\u8bd5\u4e0e\u5bf9\u6bd4","text":"

    \u6d4b\u8bd5\u73af\u5883\uff1a

    \u6d4b\u8bd5\u76ee\u7684\uff1a

    Filebeat\u548cLoggie\u7684\u6027\u80fd\u5bf9\u6bd4

    \u6d4b\u8bd5\u601d\u8def\uff1a

    Filebeat\u548cLoggie\uff0c\u5747\u91c7\u96c6\u65e5\u5fd7\u53d1\u9001\u81f3Kafka\uff0c\u89c2\u5bdf\u76f8\u5e94\u7684\u8d44\u6e90\u5360\u7528\u548c\u53d1\u9001\u541e\u5410\u91cf

    \u6d4b\u8bd5\u8be6\u60c5\uff1a

    \u5355\u6587\u4ef6\u81ea\u52a8\u751f\u62105000000\u884c\u65e5\u5fd7\uff0c\u6bcf\u884c\u5185\u5bb9\u5982\u4e0b\u6240\u793a\uff1a

    [13/May/2021:10:20:29 +0800] 0.015 10.200.170.107 \"GET /static/3tJHS3Ubrf.html?activity_channel_id=22=1_00000&fromMiniapp=1&miniapp_uuid=uEd93lG2eG8Qj5fRXuiJwNt4bmiylkmg HTTP/1.1\" 200 138957 \"110.183.45.54, 10.200.151.37\" act.you.163.com \"\" \"Mozilla/5.0 (Linux; Android 8.1.0; PADM00Build/O11019; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 XWEB/568 MMWEBSDK/190102 Mobile Safari/537.36 MMWEBID/6881 MicroMessenger/7.0.3.1400(0x2700033B) Process/appbrand0 NetType/WIFI Language/zh_CN miniProgram\" \"\" [127.0.0.1:8990] [0.014] [] [] immsg={\"st\":1553307293614,\"sb\":138963,\"rc\":200,\"cf\":{\"sr\":1},\"if\":\"default\",\"ut\":14,\"sv\":\"static\",\"pd\":\"activity\",\"qb\":764}\n

    \u914d\u7f6eFilebeat\u548cLoggie\u91c7\u96c6\u65e5\u5fd7\uff0c\u5e76\u53d1\u9001\u81f3Kafka\u67d0\u4e2aTopic\uff0c\u4e0d\u4f7f\u7528\u5ba2\u6237\u7aef\u538b\u7f29\uff0cKafka Topic\u914d\u7f6ePartition\u4e3a3\u3002

    \u5728\u4fdd\u8bc1Agent\u89c4\u683c\u8d44\u6e90\u5145\u8db3\u7684\u60c5\u51b5\u4e0b\uff0c\u4fee\u6539\u91c7\u96c6\u7684\u6587\u4ef6\u4e2a\u6570\u3001\u53d1\u9001\u5ba2\u6237\u7aef\u5e76\u53d1\u5ea6\uff08\u914d\u7f6eFilebeat worker\u548cLoggie parallelism)\uff0c\u89c2\u5bdf\u5404\u81ea\u7684CPU\u3001Memory\u548cPod\u7f51\u5361\u53d1\u9001\u901f\u7387\u3002

    \u6d4b\u8bd5\u5f97\u5230\u5982\u4e0b\u6570\u636e\uff1a

    Agent \u6587\u4ef6\u5927\u5c0f \u65e5\u5fd7\u6587\u4ef6\u6570 \u53d1\u9001\u5e76\u53d1\u5ea6 CPU MEM (rss) \u7f51\u5361\u53d1\u5305\u901f\u7387 Filebeat 3.2G 1 3 7.5~8.5c 63.8MiB 75.9MiB/s Filebeat 3.2G 1 8 10c 65MiB 70MiB/s Filebeat 3.2G 10 8 11c 65MiB 80MiB/s Loggie 3.2G 1 3 2.1c 60MiB 120MiB/s Loggie 3.2G 1 8 2.4c 68.7MiB 120MiB/s Loggie 3.2G 10 8 3.5c 70MiB 210MiB/s

    \u6d4b\u8bd5\u7ed3\u8bba\uff1a

    \u76f8\u540c\u538b\u6d4b\u6761\u4ef6\u548c\u573a\u666f\u4e0b\uff1a

    "},{"location":"user-guide/architecture/core-arch/","title":"\u8bbe\u8ba1\u67b6\u6784","text":""},{"location":"user-guide/architecture/core-arch/#_2","title":"\u5185\u90e8\u8bbe\u8ba1","text":"

    Loggie\u8be6\u7ec6\u7684\u8bbe\u8ba1\u5982\u4e0b\u56fe\u6240\u793a\uff1a

    \u6570\u636e\u94fe\u8def:

    \u63a7\u5236\u94fe\u8def:

    "},{"location":"user-guide/architecture/core-arch/#_3","title":"\u4f7f\u7528\u5f62\u6001","text":"

    \u672c\u8d28\u4e0aLoggie\u662f\u4e00\u4e2a\u6570\u636e\u4f20\u8f93\u6d41\u5f0f\u8bbe\u8ba1\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u7075\u6d3b\u7684\u4f7f\u7528Loggie\u7684Pipeline\u3002\u4ece\u4f7f\u7528\u5f62\u6001\u4e0a\u53ef\u5206\u4e3a\uff1a

    \u9664\u4e86\u65e5\u5fd7\u91c7\u96c6\uff0c\u5f88\u591a\u6d89\u53ca\u5230\u6570\u636e\u4f20\u8f93\u3001\u8f6c\u6362\u7684\u573a\u666f\uff0c\u90fd\u53ef\u4ee5\u8003\u8651\u4f7f\u7528Loggie\uff0c\u5373\u4f7fLoggie\u6ca1\u6709\u4f60\u60f3\u8981\u7684\u7ec4\u4ef6\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5feb\u901f\u5f00\u53d1\u4e00\u4e2asource\u3001sink\u6216interceptor\uff0c\u540c\u65f6\u590d\u7528Loggie\u7684\u5f88\u591a\u80fd\u529b\uff0c\u907f\u514d\u91cd\u590d\u7684\u5f00\u53d1\u5de5\u4f5c\uff0c\u6bd4\u5982\uff1a

    "},{"location":"user-guide/architecture/core-arch/#_4","title":"\u5e94\u7528\u573a\u666f","text":""},{"location":"user-guide/architecture/schema/","title":"\u6570\u636e\u683c\u5f0f","text":"

    Info

    \u4e86\u89e3Loggie\u5185\u90e8\u6570\u636e\u683c\u5f0f\u7684\u8bbe\u8ba1\uff0c\u80fd\u5e2e\u52a9\u6211\u4eec\u914d\u7f6e\u5408\u9002\u7684\u65e5\u5fd7\u5904\u7406\u548c\u65e5\u5fd7\u683c\u5f0f\u8f6c\u6362

    "},{"location":"user-guide/architecture/schema/#_2","title":"\u7ed3\u6784\u8bbe\u8ba1","text":"

    \u5728Loggie\u5185\u90e8\u7684\u65e5\u5fd7\u6570\u636e\uff0c\u5305\u62ec\uff1a

    "},{"location":"user-guide/architecture/schema/#_3","title":"\u683c\u5f0f\u8f6c\u6362","text":"

    \u5982\u679c\u4ee5\u4e0a\u7684\u683c\u5f0f\u4e0d\u6ee1\u8db3\u9700\u6c42\uff0c\u53ef\u4ee5\u53c2\u8003\uff1a

    "},{"location":"user-guide/architecture/schema/#_4","title":"\u65e5\u5fd7\u5207\u5206","text":"

    \u5bf9\u4e8e\u539f\u59cb\u65e5\u5fd7\u6570\u636e\u7684\u5207\u5206\u4e0e\u5904\u7406\uff0c\u8bf7\u4f7f\u7528 normalize interceptor\uff0c\u8bf7\u53c2\u8003\uff1a

    "},{"location":"user-guide/best-practice/aggregator/","title":"\u4f7f\u7528Loggie\u4e2d\u8f6c\u673a","text":"

    Loggie\u53ef\u4ee5\u90e8\u7f72\u4e3aAgent\uff0c\u540c\u65f6\u652f\u6301\u72ec\u7acb\u90e8\u7f72\uff0c\u8fdb\u884c\u805a\u5408\u3001\u8f6c\u53d1\u548c\u5904\u7406\u3002

    "},{"location":"user-guide/best-practice/aggregator/#_1","title":"\u51c6\u5907\uff1a\u9009\u62e9\u67b6\u6784","text":"

    \u4f7f\u7528\u4e2d\u8f6c\u673a\u67b6\u6784\u7684\u65b9\u5f0f\u4e00\u822c\u6709\u591a\u79cd\uff0c\u5e38\u89c1\u7684\u6709\uff1a

    \u662f\u5426\u5f15\u5165Kafka\u7b49\u6d88\u606f\u961f\u5217\uff0c\u4e3b\u8981\u53d6\u51b3\u4e8e\u81ea\u8eab\u7684\u573a\u666f\u9700\u6c42\u548c\u6570\u636e\u7684\u91cf\u7ea7\u3002

    "},{"location":"user-guide/best-practice/aggregator/#_2","title":"\u51c6\u5907\uff1a\u90e8\u7f72","text":"
    1. \u90e8\u7f72Agent

    2. \u90e8\u7f72Aggregator

    \u90e8\u7f72\u4e3aAggregator\u7c7b\u578b\u65f6\uff0c\u8bf7\u52a1\u5fc5\u5728Kubernetes\u914d\u7f6e\u4e2d\u6307\u5b9acluster\u96c6\u7fa4\u540d\u79f0\u3002

    "},{"location":"user-guide/best-practice/aggregator/#_3","title":"\u914d\u7f6e\u4f7f\u7528","text":""},{"location":"user-guide/best-practice/aggregator/#agent","title":"Agent","text":"

    \u91c7\u96c6\u65e5\u5fd7\u7684LogConfig\u914d\u7f6e\u65e0\u533a\u522b\uff0c\u53ea\u9700\u8981\u4fee\u6539sink\u53d1\u9001\u81f3Loggie Aggregator\u6216\u8005Kafka\u5373\u53ef\u3002

    \u88ab\u91c7\u96c6\u7684\u5bb9\u5668\u521b\u5efa\u4ee5\u53ca\u5339\u914d\u7684LogConfig\uff0c\u8bf7\u53c2\u8003Loggie\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\u3002

    \u8fd9\u91cc\u6211\u4eec\u5c06\u5176\u4e2d\u7684sink\u4fee\u6539\u4e3a\u4ee5\u4e0b\u793a\u4f8b\uff1a

    Example

    AggregatorKafka
    apiVersion: loggie.io/v1beta1\nkind: Sink\nmetadata:\nname: aggregator\nspec:\nsink: |\ntype: grpc\nhost: \"loggie-aggregator.loggie-aggregator:6066\"\n
    apiVersion: loggie.io/v1beta1\nkind: Sink\nmetadata:\nname: kafka\nspec:\nsink: |\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\n
    "},{"location":"user-guide/best-practice/aggregator/#aggregator","title":"Aggregator","text":"

    \u914d\u7f6eLogConfig\u4e0b\u53d1\u81f3Aggregator\u672c\u8d28\u4e0a\u548cAgent\u4fa7\u65e0\u533a\u522b\uff0c\u53ea\u9700\u8981\u4fee\u6539\u5176\u4e2dselector\u90e8\u5206\u3002

    \u7c7b\u4f3c\u5982\u4e0b\uff1a

    Example

    apiVersion: loggie.io/v1beta1\nkind: ClusterLogConfig\nmetadata:\nname: aggre\nspec:\nselector:\ntype: cluster\ncluster: aggregator\npipeline:\nsources: |\n- type: grpc\nname: rec1\nport: 6066\nsinkRef: dev\n
    apiVersion: loggie.io/v1beta1\nkind: Sink\nmetadata:\nname: dev\nspec:\nsink: |\ntype: dev\nprintEvents: true\ncodec:\ntype: json\npretty: true\n

    type: cluster\u8868\u793a\u9009\u62e9\u4e0b\u53d1\u914d\u7f6e\u5230cluster\u6307\u5b9a\u7684Loggie\u96c6\u7fa4\uff0c\u5373\u6211\u4eec\u521a\u90e8\u7f72\u7684\u4e2d\u8f6c\u673a\u96c6\u7fa4\uff0c\u5982\u679c\u4e0d\u586b\u5199\u4f1a\u5c06\u914d\u7f6e\u6307\u5b9a\u5230\u9ed8\u8ba4\u7684Agent\u96c6\u7fa4\uff0c\u5bfc\u81f4\u65e0\u6cd5\u751f\u6548\u3002

    \u8fd9\u91cc\u7684source\u4e3aGrpc\uff0c\u63a5\u6536Agent Grpc sink\u53d1\u51fa\u7684\u6570\u636e\uff0c\u7136\u540e\u8f6c\u53d1\u81f3\u81ea\u8eabsinkRef\u6307\u5b9a\u7684sink\u4e2d\u3002\u8fd9\u91cc\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2adev sink\u7528\u4e8e\u67e5\u770b\u4e2d\u8f6c\u673a\u8f93\u51fa\u7684\u6570\u636e\u3002

    "},{"location":"user-guide/best-practice/aggregator/#_4","title":"\u67e5\u770b\u65e5\u5fd7","text":"

    \u901a\u8fc7kubectl -nloggie-aggregator logs -f <podName> --tail=200\u547d\u4ee4\u3002 \u53ef\u4ee5\u5728\u4e2d\u8f6c\u673a\u8282\u70b9\u4e0a\u67e5\u770b\u5230\u7c7b\u4f3c\u5982\u4e0b\u65e5\u5fd7\uff1a

    events

    2021-12-20 09:58:50 INF go/src/loggie.io/loggie/pkg/sink/dev/sink.go:98 > event: {\n\"body\": \"14-Dec-2021 06:19:58.306 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [141] milliseconds\",\n\"fields\": {\n\"podname\": \"tomcat-684c698b66-gkrfs\",\n\"containername\": \"tomcat\",\n\"logconfig\": \"tomcat\",\n\"namespace\": \"default\",\n\"nodename\": \"kind-control-plane\"\n},\n}\n
    "},{"location":"user-guide/best-practice/concurrency/","title":"\u81ea\u9002\u5e94sink\u6d41\u91cf\u63a7\u5236","text":"

    \u5728\u65e5\u5fd7\u88ab\u53d1\u9001\u81f3\u4e0b\u6e38\u670d\u52a1\u65f6\uff0c\u5e76\u53d1\u5ea6\u53ef\u4ee5\u88ab\u63a7\u5236\u3002\u4f46\u8d77\u7801\u6709\u4ee5\u4e0b\u4e24\u70b9\u4f1a\u5bf9\u5b9e\u9645\u60c5\u51b5\u9020\u6210\u5f71\u54cd\uff1a\u4e0b\u6e38\u670d\u52a1\u5668\u662f\u5426\u6709\u538b\u529b\uff0c\u6570\u636e\u53d1\u9001\u662f\u5426\u6709\u538b\u529b\u3002\u8fd9\u4e24\u70b9\u662f\u5b9e\u65f6\u53d8\u5316\u7684\uff0c\u4e00\u4e2a\u5b9a\u503c\u5f88\u96be\u957f\u671f\u6ee1\u8db3\u5b9e\u9645\u9700\u6c42\u3002

    \u81ea\u9002\u5e94sink\u6d41\u91cf\u63a7\u5236\u529f\u80fd\u53ef\u4ee5\uff1a

    \u914d\u7f6e\u7ec6\u8282\u53ef\u53c2\u8003sink concurrency\u3002

    "},{"location":"user-guide/best-practice/concurrency/#_1","title":"\u5173\u952e\u8bcd","text":""},{"location":"user-guide/best-practice/concurrency/#_2","title":"\u5b9e\u73b0\u601d\u8def","text":"

    \u6838\u5fc3\u662f\u6a21\u4efftcp\u6d41\u91cf\u63a7\u5236\uff0c\u5e76\u6839\u636eloggie\u81ea\u8eab\u505a\u8c03\u6574\u3002

    1. \u5feb\u901f\u542f\u52a8\u9636\u6bb5

    2. \u5feb\u901f\u542f\u52a8\u7ed3\u675f

    3. \u5e73\u7a33\u9636\u6bb5

    4. \u5176\u4ed6\u7ec6\u8282

    "},{"location":"user-guide/best-practice/concurrency/#_3","title":"\u4f7f\u7528\u6848\u4f8b\u4e0e\u89e3\u8bfb","text":""},{"location":"user-guide/best-practice/concurrency/#_4","title":"\u4e0b\u6e38\u670d\u52a1\u5668","text":"

    \u4e0b\u6e38\u989d\u5916\u642d\u5efa\u4e86\u672c\u5730\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u81ea\u7531\u8c03\u6574rtt\u503c\uff0c\u7528\u6765\u6a21\u62df\u7f51\u7edc\u6ce2\u52a8\u3002

    \u52a0\u5165\u4e86\u968f\u673a\u7684\u5931\u8d25\u8fd4\u56de\uff0c\u6982\u7387\u53ef\u4ee5\u8bbe\u5b9a\u3002

    \u963b\u585e\u60c5\u51b5\u7528\u5927\u5e45\u589e\u5927rtt\u60c5\u51b5\u6765\u6a21\u62df\uff0c\u7531\u4e8erttT\u7684\u4e0d\u662f\u56fa\u5b9a\u7684\u503c\uff0c\u6240\u4ee5\u5f53rtt\u7a33\u5b9a\u540e\uff0c\u4e0d\u4f1a\u5bf9\u5224\u65ad\u903b\u8f91\u6709\u5f71\u54cd\u3002

    "},{"location":"user-guide/best-practice/concurrency/#_5","title":"\u914d\u7f6e","text":"

    Config

    concurrency:\nenable: true\ngoroutine:\ninitThreshold: 16\nmaxGoroutine: 30\nunstableTolerate: 3\nchannelLenOfCap: 0.4\nrtt:\nblockJudgeThreshold: 120%\nnewRttWeigh: 0.5\nratio:\nmulti: 2\nlinear: 2\nlinearWhenBlocked: 4\nduration:\nunstable: 15\nstable: 30\n
    "},{"location":"user-guide/best-practice/concurrency/#_6","title":"\u6848\u4f8b\u4e00","text":"

    \u6a21\u62df\u4e0b\u6e38\u670d\u52a1\u6ca1\u6709\u8fd4\u56de\u9519\u8bef\u60c5\u51b5\uff0c\u4ec5\u8c03\u6574rtt\uff0c\u6d4b\u8bd5\u7b97\u6cd5\u5bf9\u7f51\u7edc\u5ef6\u8fdf\u7684\u54cd\u5e94\u3002

    \u89e3\u8bfb

    "},{"location":"user-guide/best-practice/concurrency/#_7","title":"\u6848\u4f8b\u4e8c","text":"

    \u5728\u6848\u4f8b\u4e00\u7684\u57fa\u7840\u4e0a\uff0c\u6a21\u62df\u4e0b\u6e38\u6709\u9519\u8bef\u8fd4\u56de\u7684\u60c5\u51b5\uff0c\u6982\u7387\u8bbe\u5b9a\u4e3a0.15%\u3002

    \u89e3\u8bfb

    Info

    \u6b64\u529f\u80fd\u5728\u8bd5\u9a8c\u9636\u6bb5\uff0c\u9ed8\u8ba4\u4e3a\u5173\u95ed\uff0c\u6b22\u8fce\u4ea4\u6d41\u8ba8\u8bba\u3002

    "},{"location":"user-guide/best-practice/log-collect-rotate/","title":"\u65e5\u5fd7rotate\u548c\u65e5\u5fd7\u91c7\u96c6","text":""},{"location":"user-guide/best-practice/log-collect-rotate/#_1","title":"\u4e24\u79cd\u5207\u5272\u6a21\u5f0f","text":""},{"location":"user-guide/best-practice/log-collect-rotate/#11create","title":"1.1\u3001create\u6a21\u5f0f","text":"

    1\u3001\u9996\u5148\u91cd\u547d\u540d\u5f53\u524d\u8fdb\u7a0b\u6b63\u5728\u8f93\u51fa\u7684\u65e5\u5fd7\u6587\u4ef6\u540d\u79f0\uff0c\u56e0\u4e3a\u8fdb\u7a0b\u662f\u6839\u636e inode \u53f7\u6765\u786e\u5b9a\u5f80\u54ea\u4e2a\u65e5\u5fd7\u6587\u4ef6\u8f93\u51fa\uff0c\u66f4\u6539\u65e5\u5fd7\u6587\u4ef6\u540d\u79f0\u5e76\u4e0d\u4f1a\u5f71\u54cdinode\u53f7\uff0c\u6240\u4ee5\u8fd9\u6b65\u884c\u4e3a\u4e2d\uff0c\u8fdb\u7a0b\u4f9d\u65e7\u4f1a\u5f80\u4fee\u6539\u4e86\u540d\u79f0\u7684\u65e5\u5fd7\u6587\u4ef6\u5185\u8f93\u51fa\u65e5\u5fd7\u3002

    2\u3001\u8fdb\u884c\u65b0\u7684\u65e5\u5fd7\u521b\u5efa\uff0c\u521b\u5efa\u65b0\u7684\u65e5\u5fd7\u540d\u79f0\u548c\u8001\u65e7\u7684\u65e5\u5fd7\u540d\u79f0\u4e00\u6837\uff0c\u4f46\u662f\u56e0\u4e3a\u662f\u65b0\u5efa\u7684\u3002\u6240\u4ee5inode\u53f7\u4e0d\u4e00\u6837\u3002\u6b64\u65f6\u8fdb\u7a0b\u65e5\u5fd7\u8fd8\u662f\u4f9d\u65e7\u8f93\u51fa\u5230\u8001\u7684\u88ab\u91cd\u547d\u540d\u4e86\u7684\u65e5\u5fd7\u6587\u4ef6\u91cc\u9762\u3002

    3\u3001\u5bf9\u8fdb\u7a0b\u53d1\u8d77\u4fe1\u53f7\u901a\u77e5\uff0c\u8ba9\u5176\u91cd\u65b0\u5199\u65e5\u5fd7\u3002

    \u5e38\u7528\u7684logback\u5c31\u662f\u57fa\u4e8e\u8be5\u6a21\u5f0f\u3002

    "},{"location":"user-guide/best-practice/log-collect-rotate/#12copytruncate","title":"1.2\u3001copytruncate\u6a21\u5f0f","text":"

    1\u3001copy\u5f53\u524d\u65e5\u5fd7\u6587\u4ef6\uff0c\u91cd\u547d\u540d\u4e3a\u65b0\u6587\u4ef6\uff0c\u8fd9\u6837\u8fdb\u7a0b\u8fd8\u662f\u5f80\u8001\u7684\u6587\u4ef6\u5199\u5165\u3002

    2\u3001\u7136\u540elogrotate\u5bf9\u8001\u6587\u4ef6\u8fdb\u884ctruncate\uff0c\u5bf9\u8001\u6587\u4ef6\u8fdb\u884c\u6e05\u7a7a\u3002\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86\u4e00\u6b21\u65e5\u5fd7\u5207\u5272\u3002

    \u8fd9\u79cd\u65e5\u5fd7\u5207\u5272\u4e0d\u9700\u8981\u5bf9\u8fdb\u7a0b\u53d1\u8d77\u91cd\u8f7d\u4fe1\u53f7\u3002

    \u98ce\u9669\uff1a

    Caution

    \u4e00\u822c\u4e0d\u5efa\u8bae\u4f7f\u7528copytruncate\u6a21\u5f0f\uff0c\u5982\u679c\u4f7f\u7528Loggie\u91c7\u96c6copytruncate\u6a21\u5f0f\u5207\u5272\u7684\u65e5\u5fd7\uff0cfile source\u7684path\u8bf7\u914d\u7f6e\u5177\u4f53\u5199\u5165\u7684\u6587\u4ef6\u540d\u79f0\u3002

    \u6bd4\u5982\u4e00\u76f4\u5199\u5165app.log\uff0c\u5207\u5272\u540e\u7684\u6587\u4ef6\u4e3aapp-1.log\uff0capp-2.log\u7b49\uff0c\u8bf7\u914d\u7f6epath\u4e3aapp.log\uff0c\u800c\u4e0d\u662f*.log\uff0c\u56e0\u4e3acopy\u4e4b\u540e\u662f\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\uff0c\u7531\u4e8eLoggie\u6839\u636einode+deviceId\u7b49\u6765\u8bc6\u522b\u6587\u4ef6\u7684\u552f\u4e00\u6027\u800c\u4e0d\u662f\u6587\u4ef6\u540d\uff0c\u5982\u679c\u5339\u914d\u5230\u5207\u5272\u540e\u7684\u6587\u4ef6\uff0c\u4f1a\u91cd\u590d\u91c7\u96c6\u8fd9\u90e8\u5206\u7684\u65e5\u5fd7\u3002

    "},{"location":"user-guide/best-practice/log-enrich/","title":"\u65e5\u5fd7\u683c\u5f0f\u4e0e\u5143\u4fe1\u606f\u5b57\u6bb5","text":"

    \u5efa\u8bae\u5148\u4e86\u89e3Loggie\u5185\u90e8\u65e5\u5fd7\u6570\u636eschema\u8bbe\u8ba1\u3002

    Loggie\u90e8\u7f72\u5728\u4e0d\u540c\u7684\u73af\u5883\u4e2d\uff0c\u5982\u679c\u9700\u8981\u5728\u539f\u59cb\u7684\u65e5\u5fd7\u6570\u636e\u91cc\uff0c\u589e\u52a0\u4e00\u4e9b\u5143\u4fe1\u606f\uff0c\u540c\u65f6\u517c\u5bb9\u5df2\u6709\u7684\u683c\u5f0f\uff0c\u53ef\u4ee5\u53c2\u8003\u5982\u4e0b\u7684\u529e\u6cd5\u3002

    "},{"location":"user-guide/best-practice/log-enrich/#_2","title":"\u5b57\u6bb5\u683c\u5f0f\u8f6c\u6362","text":""},{"location":"user-guide/best-practice/log-enrich/#schema-interceptor","title":"\u4f7f\u7528schema interceptor","text":"

    \u4f7f\u7528schema interceptor\u53ef\u4ee5\u589e\u52a0\u65f6\u95f4\u5b57\u6bb5\uff0c\u4ee5\u53capipelineName\u4e0esourceName\u5b57\u6bb5\u3002\u53e6\u5916\u8fd8\u53ef\u4ee5\u5bf9\u5b57\u6bb5\u8fdb\u884c\u91cd\u547d\u540d\uff0c\u6bd4\u5982\u4fee\u6539body\u4e3amessage\u3002 \u8bf7\u53c2\u8003schema interceptor\u3002

    \u7531\u4e8e\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u9700\u8981\u5168\u5c40\u751f\u6548\uff0c\u800c\u4e0d\u662f\u4ec5\u4ec5\u53ea\u5728\u67d0\u4e2apipeline\u91cc\u6dfb\u52a0\u8be5interceptor\uff0c\u6240\u4ee5\u5efa\u8bae\u5728\u7cfb\u7edf\u914d\u7f6e\u7684defaults\u4e2d\u6dfb\u52a0schema interceptor\uff0c \u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u6bcf\u4e2apipeline\u5747\u9700\u914d\u7f6e\u8be5interceptor\u3002

    loggie.yml

    loggie:\ndefaults:\ninterceptors:\n- type: schema\nname: global\norder: 700\naddMeta:\ntimestamp:\nkey: \"@timestamp\"\nremap:\nbody:\nkey: message\n

    \u8fd9\u91cc\u7684name\u662f\u4e3a\u4e86\u589e\u52a0\u6807\u8bc6\uff0c\u907f\u514d\u5982\u679c\u5728pipeline\u4e2d\u53c8\u65b0\u589eschema interceptor\u4f1a\u5bfc\u81f4\u6821\u9a8c\u4e0d\u901a\u8fc7\u3002\u53e6\u5916\u589e\u52a0order\u5b57\u6bb5\u4e3a\u4e00\u4e2a\u8f83\u5c0f\u7684\u503c\uff08\u9ed8\u8ba4\u4e3a900)\uff0c\u8fd9\u6837default\u91cc\u7684interceptor\u4f1a\u4f18\u5148\u4e8epipeline\u91cc\u5b9a\u4e49\u7684\u5176\u4ed6interceptor\u6267\u884c\u3002

    "},{"location":"user-guide/best-practice/log-enrich/#transformer-interceptor","title":"\u4f7f\u7528transformer interceptor","text":"

    tranformer\u63d0\u4f9b\u4e86\u66f4\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u5e94\u5bf9\u590d\u6742\u65e5\u5fd7\u7684\u573a\u666f\u3002 \u5177\u4f53\u8bf7\u53c2\u8003transformer interceptor\u3002

    "},{"location":"user-guide/best-practice/log-enrich/#_3","title":"\u6dfb\u52a0\u5143\u4fe1\u606f","text":""},{"location":"user-guide/best-practice/log-enrich/#fields","title":"\u6dfb\u52a0fields\u81ea\u5b9a\u4e49\u5143\u4fe1\u606f","text":"

    \u5982\u679c\u6211\u4eec\u5728source\u4e0a\u914d\u7f6e\u4e86\u4e00\u4e9b\u81ea\u5b9a\u4e49\u7684fields\u3002

    pipelines.yml

    pipelines:\n- name: local\nsources:\n- type: file\nname: demo\npaths:\n- /tmp/log/*.log\nfields:\ntopic: \"loggie\"\n\nsink:\ntype: dev\nprintEvents: true\ncodec:\npretty: true\n

    \u90a3\u4e48sink\u8f93\u51fa\u7684\u4e3a\uff1a

    {\n\"fields\": {\n\"topic\": \"loggie\",\n},\n\"body\": \"01-Dec-2021 03:13:58.298 INFO [main] Starting service [Catalina]\"\n}\n

    \u5f53\u7136\u6211\u4eec\u4e5f\u53ef\u4ee5\u914d\u7f6efieldsUnderRoot: true\uff0c\u8ba9fields\u91cc\u7684key:value\u548cbody\u540c\u4e00\u5c42\u7ea7\u3002

    pipelines.yml

    pipelines:\n- name: local\nsources:\n- type: file\nfields:\ntopic: \"loggie\"\nfieldsUnderRoot: true\n...\n
    {\n\"topic\": \"loggie\",\n\"body\": \"01-Dec-2021 03:13:58.298 INFO [main] Starting service [Catalina]\"\n}\n
    "},{"location":"user-guide/best-practice/log-enrich/#file-source","title":"\u6dfb\u52a0\u65e5\u5fd7\u91c7\u96c6file source\u7684\u72b6\u6001\u4fe1\u606f","text":"

    \u5728\u6211\u4eec\u4f7f\u7528file source\u65f6\uff0c\u53ef\u80fd\u5e0c\u671b\u81ea\u52a8\u5728\u65e5\u5fd7\u539f\u59cb\u6570\u636e\u91cc\uff0c\u589e\u52a0\u4e00\u4e9b\u65e5\u5fd7\u91c7\u96c6\u7684\u72b6\u6001\uff0c\u6bd4\u5982\u91c7\u96c6\u7684\u6587\u4ef6\u540d\u79f0\u3001\u91c7\u96c6\u7684\u6587\u4ef6offsest\u7b49\uff0cfile source\u63d0\u4f9b\u4e86\u4e00\u4e2aaddonMeta\u914d\u7f6e\uff0c\u53ef\u5feb\u901fenable\u3002

    \u793a\u4f8b\uff1a\u6dfb\u52a0\u5982\u4e0baddonMeta\uff0c\u5e76\u8bbe\u7f6e\u4e3atrue\u3002

    file source

    sources:\n- type: file\npaths:\n- /var/log/*.log\naddonMeta: true\n

    \u6b64\u65f6\uff0c\u91c7\u96c6\u7684event\u4f1a\u53d8\u6210\u7c7b\u4f3c\u5982\u4e0b\uff1a

    Example

    {\n\"body\": \"this is test\",\n\"state\": {\n\"pipeline\": \"local\",\n\"source\": \"demo\",\n\"filename\": \"/var/log/a.log\",\n\"timestamp\": \"2006-01-02T15:04:05.000Z\",\n\"offset\": 1024,\n\"bytes\": 4096,\n\"hostname\": \"node-1\"\n}\n}\n

    \u5177\u4f53\u5b57\u6bb5\u542b\u4e49\u53ef\u53c2\u8003file source

    "},{"location":"user-guide/best-practice/log-enrich/#kubernetes","title":"\u589e\u52a0Kubernetes\u5143\u4fe1\u606f","text":"

    \u5728Kubernetes\u7684\u573a\u666f\u4e2d\uff0c\u91c7\u96c6\u7684\u5bb9\u5668\u65e5\u5fd7\uff0c\u4e3a\u4e86\u5728\u67e5\u8be2\u7684\u65f6\u5019\uff0c\u4f7f\u7528namespace/podName\u7b49\u4fe1\u606f\u8fdb\u884c\u68c0\u7d22\uff0c\u5f80\u5f80\u9700\u8981\u589e\u52a0\u76f8\u5173\u7684\u5143\u6570\u636e\u3002

    \u6211\u4eec\u53ef\u4ee5\u5728\u7cfb\u7edf\u914d\u7f6e\u7684discovery.kubernetes\u4e2d\uff0c\u914d\u7f6e\u989d\u5916\u7684k8s fields\u5b57\u6bb5\u3002

    \u53ef\u53c2\u8003discovery\u3002

    "},{"location":"user-guide/best-practice/log-enrich/#meta","title":"\u6dfb\u52a0meta\u7cfb\u7edf\u5185\u7f6e\u5143\u4fe1\u606f","text":"

    \u6709\u4e00\u4e9bLoggie\u7cfb\u7edf\u5185\u7f6e\u7684\u5143\u4fe1\u606f\uff0c\u6211\u4eec\u4e5f\u5e0c\u671b\u53d1\u9001\u7ed9\u4e0b\u6e38\uff0c\u8fd9\u4e2a\u65f6\u5019\uff0c\u9700\u8981\u4f7f\u7528normalize interceptor\u4e2d\u7684addMeta processors\u3002 \uff08\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8be5\u64cd\u4f5c\u4f1a\u5bf9\u91c7\u96c6\u4f20\u8f93\u6027\u80fd\u6709\u4e00\u5b9a\u5f71\u54cd\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u5e76\u4e0d\u5efa\u8bae\u4f7f\u7528\u8be5\u65b9\u5f0f\uff09

    pipelines.yml

    pipelines:\n- name: local\nsources:\n- type: file\nname: demo\npaths:\n- /tmp/log/*.log\nfields:\ntopic: \"loggie\"\ninterceptors:\n- type: normalize\nprocessors:\n- addMeta: ~\n\nsink:\ntype: dev\nprintEvents: true\ncodec:\npretty: true\n

    \u914d\u7f6e\u4e86addMeta processor\u4e4b\u540e\uff0c\u9ed8\u8ba4\u4f1a\u628a\u6240\u6709\u7684\u7cfb\u7edf\u5185\u7f6e\u5143\u4fe1\u606f\u8f93\u51fa\u3002

    \u9ed8\u8ba4Json\u683c\u5f0f\u8f93\u51fa\u793a\u4f8b\u5982\u4e0b\uff1a

    Example

    {\n\"fields\": {\n\"topic\": \"loggie\"\n},\n\"meta\": {\n\"systemState\": {\n\"nextOffset\": 720,\n\"filename\": \"/tmp/log/a.log\",\n\"collectTime\": \"2022-03-08T11:33:47.369813+08:00\",\n\"contentBytes\": 90,\n\"jobUid\": \"43772050-16777231\",\n\"lineNumber\": 8,\n\"offset\": 630\n},\n\"systemProductTime\": \"2022-03-08T11:33:47.370166+08:00\",\n\"systemPipelineName\": \"local\",\n\"systemSourceName\": \"demo\"\n},\n\"body\": \"01-Dec-2021 03:13:58.298 INFO [main] Starting service [Catalina]\"\n}\n

    \u5f53\u7136\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u89c9\u5f97\u8fd9\u4e9b\u6570\u636e\u592a\u591a\u4e86\uff0c\u6216\u8005\u60f3\u5bf9\u5b57\u6bb5\u8fdb\u884c\u4fee\u6539\u3002\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528transformer interceptor\u91cc\u7684action\u8fdb\u884c\u64cd\u4f5c\u3002

    "},{"location":"user-guide/best-practice/log-process/","title":"\u65e5\u5fd7\u5207\u5206\u5904\u7406","text":"

    Loggie\u53ef\u4f7f\u7528transformer interceptor\u6765\u8fdb\u884c\u65e5\u5fd7\u7684\u5207\u5206\u548c\u5904\u7406\uff0c\u5c06\u65e5\u5fd7\u6570\u636e\u8fdb\u884c\u7ed3\u6784\u5316\u7684\u63d0\u53d6\uff0c\u540c\u65f6\u53ef\u4ee5\u5bf9\u63d0\u53d6\u540e\u7684\u5b57\u6bb5\u8fdb\u884c\u5904\u7406\u3002 \u5efa\u8bae\u5148\u4e86\u89e3Loggie\u5185\u90e8\u65e5\u5fd7\u6570\u636eschema\u8bbe\u8ba1\u3002

    "},{"location":"user-guide/best-practice/log-process/#_2","title":"\u9700\u6c42\u573a\u666f","text":"

    \u6700\u4e3b\u8981\u7684\u662f\u5bf9\u65e5\u5fd7\u8fdb\u884c\u5207\u5206\u89e3\u6790\u63d0\u53d6\u548c\u5904\u7406\u3002

    \u6bd4\u5982\u4ee5\u4e0b\u65e5\u5fd7\uff1a

    01-Dec-2021 03:13:58.298 INFO [main] Starting service [Catalina]\n

    \u6211\u4eec\u53ef\u80fd\u4f1a\u9700\u8981\u5c06\u5176\u4e2d\u7684\u65e5\u671f\u3001\u65e5\u5fd7\u7ea7\u522b\u89e3\u6790\u51fa\u6765\uff0c\u6700\u7ec8\u5f62\u6210\uff1a

    {\n\"time\": \"01-Dec-2021 03:13:58.298\",\n\"level\": \"INFO\",\n\"message\": \"[main] Starting service [Catalina]\"\n}\n

    \u8fd9\u79cd\u7ed3\u6784\u5316\u7684\u6570\u636e\uff0c\u5b58\u50a8\u7684\u65f6\u5019\u4fbf\u4e8e\u8fc7\u6ee4\u67e5\u8be2\uff0c\u6216\u8005\u6839\u636e\u65e5\u5fd7\u91cc\u7684\u65f6\u95f4\u6765\u6392\u5e8f\uff0c\u800c\u4e0d\u662f\u91c7\u96c6\u7684\u65f6\u95f4\u6233\uff0c\u6216\u8005\u6839\u636e\u65e5\u5fd7\u7ea7\u522b\u8fdb\u884c\u4e00\u4e9b\u8fc7\u6ee4\uff0c\u53ef\u4ee5\u65b9\u4fbf\u67e5\u8be2\u5230ERROR\u7ea7\u522b\u7684\u65e5\u5fd7\u7b49\u7b49\u3002 \u5f53\u7136\u4e0d\u4ec5\u4ec5\u662f\u50cf\u4ee5\u4e0atomcat\u7684\u8fd0\u7ef4\u7c7b\u65e5\u5fd7\uff0c\u8fd8\u6709\u8bf8\u5982\u4e1a\u52a1\u7684\u4e00\u4e9b\u8ba2\u5355\u7b49\u7b49\u65e5\u5fd7\uff0c\u90fd\u6709\u7c7b\u4f3c\u7684\u9700\u6c42\u548c\u4f7f\u7528\u573a\u666f\u3002

    \u5173\u4e8estdout\u65e5\u5fd7\u7684\u89e3\u6790\u63d0\u53d6

    \u4ee5\u4e0b\u793a\u4f8b\u4ec5\u63d0\u4f9b\u65e5\u5fd7\u5207\u5206\u5904\u7406\u7684\u53c2\u8003\u601d\u8def\uff0c\u5982\u679c\u4f60\u9700\u8981\u63d0\u53d6\u5bb9\u5668\u6807\u51c6\u8f93\u51fa\u7684\u539f\u59cb\u65e5\u5fd7\uff0c\u8bf7\u53c2\u8003\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\u3002

    "},{"location":"user-guide/best-practice/log-process/#_3","title":"\u914d\u7f6e\u793a\u4f8b","text":"

    \u65e5\u5fd7\u5207\u5206\u5904\u7406\u5728Loggie Agent\u7aef\u6216\u8005Loggie\u4e2d\u8f6c\u673a\u4fa7\u5747\u53ef\uff0c\u53d6\u51b3\u4e8e\u6211\u4eec\u662f\u5426\u9700\u8981\u4e2d\u8f6c\u673a\uff0c\u4ee5\u53ca\u5e0c\u671b\u65e5\u5fd7\u5904\u7406\u8fd9\u79cdCPU\u5bc6\u96c6\u578b\u7684\u8ba1\u7b97\u662f\u5206\u5e03\u5728Agent\u4e0a\uff0c\u7531\u5404\u4e2a\u8282\u70b9\u627f\u62c5\uff0c\u8fd8\u662f\u5e0c\u671b\u5728\u4e2d\u8f6c\u673a\u96c6\u7fa4\u4e2d\u96c6\u4e2d\u8fdb\u884c\u3002

    \u4e0b\u9762\u4ee5\u91c7\u96c6tomcat\u670d\u52a1\u7684access\u65e5\u5fd7\u4e3a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u5bf9access\u65e5\u5fd7\u8fdb\u884c\u5b57\u6bb5\u5207\u5206\u3002

    \u7b80\u5355\u8d77\u89c1\uff0c\u793a\u4f8b\u4f7f\u7528CRD\u5b9e\u4f8b\u914d\u7f6e\u4e0b\u53d1\u5728Agent\uff0c\u540c\u65f6\u4f7f\u7528dev sink\u76f4\u63a5\u8f93\u51fa\u5904\u7406\u7ed3\u679c\u5c55\u793a\u3002

    "},{"location":"user-guide/best-practice/log-process/#tomcat-deployment","title":"\u521b\u5efatomcat deployment","text":"

    \u8bf7\u53c2\u8003

    "},{"location":"user-guide/best-practice/log-process/#logconfig","title":"\u521b\u5efalogconfig","text":"

    \u914d\u7f6elogconfig\u5982\u4e0b\u6240\u793a\uff1a

    Example

    apiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: tomcat\nnamespace: default\nspec:\nselector:\nlabelSelector:\napp: tomcat\ntype: pod\npipeline:\nsources: |\n- type: file\nname: access\npaths:\n- /usr/local/tomcat/logs/localhost_access_log.*.txt\n\ninterceptors: |\n- type: transformer\nactions:\n- action: regex(body)\npattern: (?<ip>\\S+) (?<id>\\S+) (?<u>\\S+) (?<time>\\[.*?\\]) (?<url>\\\".*?\\\") (?<status>\\S+) (?<size>\\S+)\n\nsink: |\ntype: dev\nprintEvents: true\ncodec:\ntype: json\npretty: true\n

    \u8fd9\u91cc\u6211\u4eec\u5728transformer interceptors\u91cc\uff0c\u914d\u7f6e\u4e86regex action\uff0c\u9488\u5bf9access\u65e5\u5fd7\u8fdb\u884c\u6b63\u5219\u63d0\u53d6\u3002

    \u539f\u59cb\u7684access\u65e5\u5fd7\u5927\u6982\u5982\u4e0b\u6240\u793a\uff1a

    10.244.0.1 - - [31/Aug/2022:03:13:40 +0000] \"GET / HTTP/1.1\" 404 683\n

    \u7ecf\u8fc7transformer\u5904\u7406\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7kubectl -nloggie logs -f <loggie-pod-name> --tail=100\u6765\u67e5\u770b\u8f93\u51fa\u7684\u65e5\u5fd7\u3002

    \u8f6c\u6362\u540e\u7684event\u793a\u4f8b\u5982\u4e0b\uff1a

    {\n\"status\": \"404\",\n\"size\": \"683\",\n\"fields\": {\n\"logconfig\": \"tomcat\",\n\"namespace\": \"test1\",\n\"nodename\": \"kind-control-plane\",\n\"podname\": \"tomcat-85c84988d8-frs4n\",\n\"containername\": \"tomcat\"\n},\n\"ip\": \"10.244.0.1\",\n\"id\": \"-\",\n\"u\": \"-\",\n\"time\": \"[31/Aug/2022:03:13:40 +0000]\",\n\"url\": \"\\\"GET / HTTP/1.1\\\"\"\n}\n

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/","title":"\u65e5\u5fd7\u7cfb\u7edf\u67b6\u6784\u4e0e\u6f14\u8fdb","text":"

    \u6211\u4eec\u53ef\u4ee5\u6253\u9020\u4ee5Loggie\u4e3a\u6838\u5fc3\u7684\u4e91\u539f\u751f\u53ef\u6269\u5c55\u7684\u5168\u94fe\u8def\u6570\u636e\u5e73\u53f0\uff0cLoggie\u652f\u6301\u4f7f\u7528\u4e0d\u540c\u7684\u6280\u672f\u9009\u578b\u3002

    \u5728\u4e0d\u540c\u7684\u4e1a\u52a1\u7c7b\u578b\u3001\u4e0d\u540c\u7684\u4f7f\u7528\u573a\u666f\u3001\u4e0d\u540c\u7684\u65e5\u5fd7\u89c4\u6a21\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u91c7\u7528\u4e0d\u540c\u7684\u65e5\u5fd7\u7cfb\u7edf\u67b6\u6784\uff0c\u67b6\u6784\u4e0d\u5b58\u5728\u597d\u574f\uff0c\u53ea\u6709\u5408\u4e0d\u5408\u9002\u3002\u4e00\u4e2a\u7b80\u5355\u7684\u573a\u666f\u4e0b\uff0c\u4f7f\u7528\u590d\u6742\u7684\u67b6\u6784\u642d\u5efa\u51fa\u6765\u7684\u65e5\u5fd7\u7cfb\u7edf\uff0c\u5927\u6982\u4f1a\u5e26\u6765\u8fd0\u7ef4\u707e\u96be\u3002

    \u8fd9\u91cc\u901a\u8fc7\u89c4\u6a21\u6f14\u8fdb\u7684\u89c6\u89d2\uff0c\u603b\u7ed3\u4e00\u4e0b\u5e38\u89c1\u7684\u65e5\u5fd7\u7cfb\u7edf\u67b6\u6784\uff0c\u5f53\u7136\u5b9e\u9645\u7684\u6280\u672f\u9009\u578b\u53ca\u53d8\u79cd\u6709\u5f88\u591a\uff0c\u6211\u4eec\u65e0\u6cd5\u4e00\u4e00\u5217\u51fa\uff0c\u76f8\u4fe1\u4f60\u53ef\u4ee5\u901a\u8fc7\u53c2\u8003\u4e0b\u6587\uff0c\u642d\u5efa\u9002\u5408\u81ea\u5df1\u4e1a\u52a1\u7684\u67b6\u6784\u3002

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/#_2","title":"\u67b6\u6784\u6f14\u8fdb","text":"

    \u9700\u8981\u63d0\u524d\u8bf4\u660e\u7684\u662f:

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/#_3","title":"\u5c0f\u89c4\u6a21\u4e1a\u52a1\u573a\u666f","text":"

    \u6bcf\u5929\u7684\u65e5\u5fd7\u89c4\u6a21\u8f83\u5c0f\uff0c\u6bd4\u5982\u53ea\u6709\u51e0\u767eG\uff08\u9884\u4f30500G\u4ee5\u4e0b\uff09\u5de6\u53f3\uff0c\u65e5\u5fd7\u7684\u4f7f\u7528\u573a\u666f\u4ec5\u4ec5\u7528\u4e8e\u65e5\u5e38\u8fd0\u7ef4\u6392\u67e5\u95ee\u9898\uff0c\u53ef\u4ee5\u91c7\u7528Loggie\u76f4\u63a5\u53d1\u9001\u81f3Elasticsearch\u96c6\u7fa4\u7684\u65b9\u5f0f\u3002 \u67b6\u6784\u56fe\u5982\u4e0b\u6240\u793a\uff1a

    \u4f18\u70b9\uff1a

    \u7f3a\u70b9\uff1a

    \u53d8\u79cd\uff1a \u56e0\u4e3a\u4e00\u76f4\u4ee5\u6765ELK\u67b6\u6784\u7684\u6d41\u884c\uff0cElasticsearch\u662f\u6700\u5e38\u7528\u7684\u65e5\u5fd7\u5b58\u50a8\u3002 \u5982\u679c\u6709\u5176\u4ed6\u670d\u52a1\u5bf9Elasticsearch\u7684\u4f9d\u8d56\uff0c\u6216\u8005\u6709Elasticsearch\u7684\u8fd0\u7ef4\u7ecf\u9a8c\uff0cElasticsearch\u662f\u4e00\u4e2a\u8fd8\u4e0d\u9519\u7684\u9009\u62e9\u3002 \u4f46\u662f\uff0cElasticsearch\u5bf9\u8d44\u6e90\u548c\u8fd0\u7ef4\u6709\u4e00\u5b9a\u7684\u8981\u6c42\uff0c\u5728\u67d0\u4e9b\u8f7b\u91cf\u7ea7\u548c\u8d44\u6e90\u654f\u611f\u7684\u73af\u5883\u4e0b\uff0c\u53ef\u4ee5\u8003\u8651\uff1a

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/#_4","title":"\u4e2d\u578b\u89c4\u6a21\u4e1a\u52a1\u573a\u666f","text":"

    \u5728\u6bcf\u5929\u7684\u65e5\u5fd7\u91cf\u7ea7\u7a0d\u5927\uff0c\u6bd4\u5982\u5728500G\u81f31T\u7684\u89c4\u6a21\uff0c\u67b6\u6784\u548c\u4e1a\u52a1\u4f7f\u7528\u4e0a\u6709\u6269\u5c55\u6027\u7684\u8003\u8651\uff0c\u53ef\u8003\u8651\u5f15\u5165Loggie\u4e2d\u8f6c\u96c6\u7fa4\u3002

    \u4f18\u70b9\uff1a

    \u7f3a\u70b9\uff1a

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/#_5","title":"\u5927\u578b\u89c4\u6a21\u4e1a\u52a1\u573a\u666f","text":"

    \u5982\u679c\u65e5\u5fd7\u91cf\u8f83\u5927\uff0c\u6bd4\u59821T\u4ee5\u4e0a\u573a\u666f\uff0c\u5bf9\u6027\u80fd\u4e0e\u7a33\u5b9a\u6027\u8981\u6c42\u6bd4\u8f83\u9ad8\uff0c\u53ef\u8003\u8651\u4f7f\u7528Kafka\u7b49\u6d88\u606f\u961f\u5217\u96c6\u7fa4\u3002

    \u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cKafka\u672c\u8eab\u5e76\u4e0d\u80fd\u76f4\u63a5\u53d1\u9001\u81f3\u540e\u7aef\uff0c\u6240\u4ee5\u8fd9\u91cc\u9700\u8981\u8003\u8651\u5982\u4f55\u5c06Kafka\u7684\u6570\u636e\u5b9e\u65f6\u5bfc\u5165\u5230\u540e\u7aef\u5b58\u50a8\u4e2d\u3002 \u8fd9\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u4ee5\u9009\u62e9\u4e00\u4e9b\u7ec4\u4ef6\u6d88\u8d39Kafka\uff0c\u53d1\u9001\u81f3\u540e\u7aef\uff0c\u6bd4\u5982Loggie/Logstash/Kafka connect/Flink\u7b49\u3002 \u4f46\u662fFlink\u9002\u5408\u6709\u81ea\u5df1\u7684\u5b9e\u65f6\u6d41\u5e73\u53f0\u6216\u8005\u8fd0\u7ef4\u80fd\u529b\u7684\u4f01\u4e1a\uff0c\u5426\u5219\u53ef\u80fd\u5f15\u5165\u66f4\u591a\u8fd0\u7ef4\u6210\u672c\u3002

    \u4f18\u70b9\uff1a

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/#_6","title":"\u8d85\u5927\u578b\u89c4\u6a21\u4e1a\u52a1\u573a\u666f","text":"

    \u51e0\u5341TB\u81f3PB\u7ea7\uff0c\u76f8\u6bd4\u4e0a\u9762\u5927\u89c4\u6a21\u573a\u666f\uff0c\u96c6\u7fa4\u6570\u91cf\u591a\uff0c\u673a\u623f\u67b6\u6784\u590d\u6742\uff0c\u53ef\u4ee5\u6839\u636e\u4ee5\u4e0a\u67b6\u6784\u589e\u52a0\u66f4\u591a\u7075\u6d3b\u7684\u6269\u5c55\u3002

    \u6bd4\u5982\uff1a

    \u6700\u7ec8\u6211\u4eec\u53ef\u4ee5\u57fa\u4e8eLoggie\uff0c\u642d\u5efa\u4e00\u5957\u751f\u4ea7\u7ea7\u522b\u7684\u5168\u94fe\u8def\u65e5\u5fd7\u6570\u636e\u5e73\u53f0\u3002

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/#_7","title":"\u66f4\u591a","text":"

    \u5b9e\u9645\u5728\u843d\u5730\u4e00\u5957\u5b8c\u5584\u7684\u65e5\u5fd7\u67b6\u6784\u548c\u5e73\u53f0\uff0c\u8fd8\u9700\u8981\u8003\u8651\uff1a

    "},{"location":"user-guide/enterprise-practice/sls/","title":"\u4f7f\u7528\u963f\u91cc\u4e91\u53ef\u89c2\u6d4b\u7edf\u4e00\u5b58\u50a8SLS","text":"

    \u4e0d\u7ba1\u4f60\u7684\u670d\u52a1\u90e8\u7f72\u5728\u963f\u91cc\u4e91\u8fd8\u662f\u4f7f\u7528\u6df7\u5408\u4e91\u7684\u67b6\u6784\uff0cLoggie\u540c\u6837\u652f\u6301\u91c7\u96c6\u65e5\u5fd7\u6570\u636e\u81f3\u963f\u91cc\u4e91\u53ef\u89c2\u6d4b\u7edf\u4e00\u5b58\u50a8SLS\u3002 \u800c\u4f60\u53ea\u9700\u8981\u4f7f\u7528sls sink\u5373\u53ef\u3002

    \u963f\u91cc\u4e91\u5b98\u65b9\u6587\u6863\u4e2d\u5173\u4e8eLoggie\u7684\u4f7f\u7528\u8bf7\u53c2\u8003\uff1a\u4f7f\u7528Loggie\u4e0a\u4f20\u65e5\u5fd7

    "},{"location":"user-guide/enterprise-practice/sls/#sls-project","title":"\u51c6\u5907\uff1a\u521b\u5efaSLS Project","text":"

    \u4e3a\u4e86\u4f7f\u7528\u963f\u91cc\u4e91\u53ef\u89c2\u6d4b\u7edf\u4e00\u5b58\u50a8SLS\uff0c\u6211\u4eec\u9700\u8981\u5148\u521b\u5efa\u4e00\u4e2a\u5bf9\u5e94\u7684Project\u3002 \u5982\u4e0b\u6240\u793a\uff0c\u5728SLS\u9875\u9762\u4e2d\uff0c\u70b9\u51fb\u521b\u5efaProject\uff0c\u586b\u5165project\u540d\u79f0\u548c\u5bf9\u5e94\u7684\u5730\u57df\uff0c\u521b\u5efa\u5b8c\u4e4b\u540e\u540c\u6b65\u521b\u5efa\u76f8\u5e94\u7684Logstore\u3002

    \u7136\u540e\u6211\u4eec\u53ef\u4ee5\u51c6\u5907\u4e00\u4e0bsls sink\u7684\u914d\u7f6e\uff0c\u793a\u4f8b\u5982\u4e0b\u6240\u793a\uff0c\u5177\u4f53\u53ef\u53c2\u8003sls sink \u914d\u7f6e\u53c2\u6570\uff1a

    sls sink

        sink:\ntype: sls\nname: demo\nendpoint: cn-hangzhou.log.aliyuncs.com\naccessKeyId: xxxx\naccessKeySecret: xxxx\nproject: test\nlogstore: test1\ntopic: myservice\n
    "},{"location":"user-guide/enterprise-practice/sls/#ecs","title":"\u91c7\u96c6ECS\u4e0a\u7684\u65e5\u5fd7","text":"

    \u53c2\u8003\u4e3b\u673a\u90e8\u7f72\u7684\u65b9\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u4fee\u6539pipeline.yml\uff0c\u52a0\u4e0asls sink\u7684\u914d\u7f6e\u5373\u53ef\u3002

    Pipeline\u914d\u7f6e\u53c2\u8003\u793a\u4f8b\u5982\u4e0b\uff1a

    sls pipeline

    pipelines:\n- name: test\nsources:\n- type: file\nname: demo\naddonMeta: true\npaths:\n- /tmp/log/*.log\nsink:\ntype: sls\nendpoint: cn-hangzhou.log.aliyuncs.com\naccessKeyId: ${accessKeyId}\naccessKeySecret: ${accessKeySecret}\nproject: loggietest\nlogstore: demo1\ntopic: myservice\n
    "},{"location":"user-guide/enterprise-practice/sls/#ack-kubernetes","title":"\u91c7\u96c6ACK Kubernetes\u96c6\u7fa4\u7684\u65e5\u5fd7","text":"

    \u548c\u81ea\u5efaKubernetes\u96c6\u7fa4\u4e00\u6837\uff0cLoggie\u540c\u6837\u53ef\u4ee5\u90e8\u7f72\u5728\u963f\u91cc\u4e91ACK\u7684Kubernetes\u96c6\u7fa4\u4e2d\u3002 \u6211\u4eec\u53ef\u4ee5\u6839\u636eACK\u63d0\u4f9b\u7684kubeconfig\u6587\u4ef6\uff0c\u4f7f\u7528kubectl\u6216\u8005helm\u6765\u90e8\u7f72\u3002\u53ef\u53c2\u8003Kubernetes\u90e8\u7f72\u3002

    \u8bf7\u6ce8\u610f\uff1a

    \u90e8\u7f72\u5b8c\u4e4b\u540e\uff0c\u548c\u5e38\u89c4\u7684Kubernetes\u96c6\u7fa4\u4e0b\u7684\u4f7f\u7528\u59ff\u52bf\u7c7b\u4f3c\uff0c\u540c\u6837\u53ef\u4ee5\u4f7f\u7528ClusterLogConfig/LogConfig/Interceptor/Sink CR\u7684\u65b9\u5f0f\u3002

    ACK\u63d0\u4f9b\u4e86CRD\u7684\u4f7f\u7528\u9875\u9762\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u5728\u8be5\u9875\u9762\u4e2d\u8fdb\u884c\u521b\u5efa\u548c\u4fee\u6539\u3002

    \u91c7\u96c6\u67d0\u4e2a\u670d\u52a1\u7684\u65e5\u5fd7\u793a\u4f8b\u53c2\u8003\u5982\u4e0b\uff0c\u53ea\u9700\u4f7f\u7528sls sink\u5373\u53ef\u3002\u5f53\u7136\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5355\u72ec\u521b\u5efa\u4e00\u4e2asink CR\u5b58\u50a8sls sink\u914d\u7f6e\uff0c\u5728LogConfig\u4e2d\u901a\u8fc7sinkRef\u5f15\u7528\u3002

    logconfig

    apiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: tomcat\nnamespace: default\nspec:\nselector:\nlabelSelector:\napp: tomcat\ntype: pod\n\npipeline:\nsources: |\n- type: file\nname: stdout\npaths:\n- stdout\n- type: file\nname: access\nignoreOlder: 3d\npaths:\n- /usr/local/tomcat/logs/*.log\n\nsink: |\ntype: sls\nendpoint: cn-hangzhou.log.aliyuncs.com\naccessKeyId: ${accessKeyId}\naccessKeySecret: ${accessKeySecret} \nproject: loggietest\nlogstore: demo1\ntopic: myservice\n
    "},{"location":"user-guide/enterprise-practice/sls/#_1","title":"\u67e5\u770b\u65e5\u5fd7","text":"

    \u6211\u4eec\u53ef\u4ee5\u5728SLS\u5177\u4f53\u7684Project\u4e2d\u67e5\u770b\u91c7\u96c6\u7684\u65e5\u5fd7\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a

    \u5177\u4f53\u7684\u5143\u4fe1\u606f\u7684\u6dfb\u52a0\u548c\u65e5\u5fd7\u5b57\u6bb5\u4fee\u6539\uff0c\u53ef\u53c2\u8003\u65e5\u5fd7\u5207\u5206\u5904\u7406\u4ee5\u53ca\u65e5\u5fd7\u589e\u52a0\u5143\u4fe1\u606f\u3002

    "},{"location":"user-guide/monitor/loggie-monitor/","title":"Loggie\u7684\u76d1\u63a7\u4e0e\u62a5\u8b66","text":"

    Loggie\u7684monitor eventbus\u88ab\u8bbe\u8ba1\u4e3a\u53d1\u5e03\u548c\u8ba2\u9605\u6a21\u5f0f\uff0c\u5404\u4e2a\u7ec4\u4ef6\u53d1\u9001metrics\u5230\u6307\u5b9a\u7684topic\u4e2d\uff0c\u7531\u72ec\u7acb\u7684listener\u6765\u6d88\u8d39\u5904\u7406\u3002

    \u6bd4\u5982file source\u4f1a\u5c06\u91c7\u96c6\u65e5\u5fd7\u7684\u4e00\u4e9b\u6307\u6807\u6570\u636e\uff0c\u53d1\u9001\u81f3filesource topic\uff0c\u7531filesource listener\u6765\u6d88\u8d39\uff0cfilesource listener\u4f1a\u5c06\u6570\u636e\u805a\u5408\u8ba1\u7b97\u4e4b\u540e\uff0c\u6253\u5370\u81f3\u65e5\u5fd7\uff0c\u66b4\u9732\u51faPrometheus\u6307\u6807\u3002

    \u7ec4\u4ef6\u548ctopic\u4ee5\u53calistener\u4e4b\u95f4\u662f\u677e\u8026\u5408\u5173\u7cfb\uff0c\u6bd4\u5982file source\u8fd8\u4f1a\u5b9a\u65f6\u5c06\u5168\u91cf\u5339\u914d\u7684\u65e5\u5fd7\u6587\u4ef6\u6307\u6807\u53d1\u9001\u81f3filewatcher topic\uff0cfilewatcher listener\u4f1a\u5904\u7406\u548c\u66b4\u9732\u6307\u6807\u3002

    "},{"location":"user-guide/monitor/loggie-monitor/#monitor","title":"Monitor\u914d\u7f6e","text":"

    monitor eventbus\u914d\u7f6e\u5728\u5168\u5c40\u7684\u7cfb\u7edf\u914d\u7f6e\u4e2d\uff0c\u793a\u4f8b\u5982\u4e0b\uff1a

    Config

    loggie:\nmonitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nqueue: ~\nsink: ~\nhttp:\nenabled: true\nport: 9196\n

    \u5176\u4e2dlogger\u63a7\u5236\u6240\u6709\u7684metrics\u6307\u6807\u7684\u65e5\u5fd7\u6253\u5370\uff0c\u4f1a\u5728period\u65f6\u95f4\u95f4\u9694\u5c06\u914d\u7f6elisteners\u4ea7\u751f\u7684metrics\u805a\u5408\u6253\u5370\u5728Loggie\u65e5\u5fd7\u4e2d\uff0c\u4fbf\u4e8e\u56de\u6eaf\u548c\u6392\u67e5\u95ee\u9898\u3002

    listeners\u5219\u7528\u4e8e\u914d\u7f6e\u76f8\u5173\u7684listener\u662f\u5426\u5f00\u542f\u3002

    Prometheus\u683c\u5f0fmetrics\u9ed8\u8ba4\u901a\u8fc7http.port\u7aef\u53e3\u66b4\u9732\u5728/metrics\u3002\u53ef\u4ee5\u901a\u8fc7curl <podIp>:9196/metrics\u6765\u67e5\u770b\u5f53\u524d\u7684metrics\u6307\u6807\u3002

    "},{"location":"user-guide/monitor/loggie-monitor/#_1","title":"\u65e5\u5fd7\u91c7\u96c6\u6838\u5fc3\u6307\u6807","text":"

    \u76ee\u524d\u6709\u4ee5\u4e0b\u7684listener\uff0c\u4e3b\u8981\u5305\u542b\uff1a

    "},{"location":"user-guide/monitor/loggie-monitor/#prometheusgrafana","title":"\u90e8\u7f72Prometheus\u548cGrafana","text":"

    \u53ef\u4ee5\u4f7f\u7528\u73af\u5883\u5df2\u6709\u7684Prometheus\u6216\u8005Grafana\uff0c\u5982\u679c\u9700\u8981\u65b0\u90e8\u7f72\uff0c\u53ef\u53c2\u8003\uff1ahttps://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack\u3002

    \u4f7f\u7528Helm\u90e8\u7f72:

    helm repo add prometheus-community https://prometheus-community.github.io/helm-charts\nhelm repo update\nhelm install prometheus prometheus-community/kube-prometheus-stack -nprometheus --create-namespace\n

    Note

    \u7531\u4e8e\u4f17\u6240\u5468\u77e5\u7684\u539f\u56e0\uff0c\u4f60\u7684\u73af\u5883\u91cc\u53ef\u80fd\u65e0\u6cd5\u4e0b\u8f7d\u5176\u4e2d\u7684\u67d0\u4e9bk8s.gcr.io\u955c\u50cf\uff0c\u53ef\u4ee5\u8003\u8651\u4e0b\u8f7dchart\u5305\u66ff\u6362\u540e\u518d\u91cd\u65b0\u90e8\u7f72\u3002

    \u786e\u8ba4Pod\u6b63\u5e38running\u540e\uff0c\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u73af\u5883\u8bbf\u95eegrafana\u3002\u901a\u8fc7\u4ee3\u7406\u8bbf\u95eegrafana\u7684\u65b9\u5f0f\u53ef\u53c2\u8003\uff1a

    kubectl -nprometheus port-forward --address 0.0.0.0 service/prometheus-grafana 8181:80\n

    Grafana\u7528\u6237\u540d\u548c\u5bc6\u7801\u53ef\u5728prometheus-grafana sercret\u4e2d\uff0c\u901a\u8fc7base64 -d\u6765\u67e5\u770b\u3002

    "},{"location":"user-guide/monitor/loggie-monitor/#loggie-prometheus","title":"\u589e\u52a0Loggie Prometheus\u76d1\u63a7","text":"

    \u5728\u90e8\u7f72\u4e86Loggie\u7684Kubernetes\u96c6\u7fa4\u4e2d\uff0c\u9700\u8981\u521b\u5efa\u5982\u4e0b\u7684ServiceMonitor\u6765\u8ba9Prometheus\u91c7\u96c6Loggie Agent\u6307\u6807\u3002

    apiVersion: monitoring.coreos.com/v1\nkind: ServiceMonitor\nmetadata:\nlabels:\napp: loggie\nrelease: prometheus\nname: loggie-agent\nnamespace: prometheus\nspec:\nnamespaceSelector:\nmatchNames:\n- loggie\nendpoints:\n- port: monitor\nselector:\nmatchLabels:\napp: loggie\ninstance: loggie\n

    \u540c\u65f6\uff0c\u6211\u4eec\u9700\u8981\u5728Grafana\u4e2d\u6dfb\u52a0install\u5de5\u7a0b\u4e2d\u7684json\u6765\u5c55\u793aLoggie\u7684\u76d1\u63a7\u63a7\u5236\u53f0\u3002

    Note

    Kubernetes\u7248\u672c\u548cGrafana\u7248\u672c\u4e0d\u540c\uff0c\u53ef\u80fd\u5bfc\u81f4\u56fe\u8868\u5c55\u793a\u4e0d\u517c\u5bb9\uff0c\u9700\u8981\u6839\u636e\u60c5\u51b5\u8fdb\u884c\u4fee\u6539\u3002

    \u5bfc\u5165\u7684Grafana\u56fe\u8868\u76ee\u524d\u5305\u542b\u76d1\u63a7\u5927\u76d8\u548c\u8282\u70b9Agent\u7684\u76d1\u63a7\u56fe\u8868\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a

    "},{"location":"user-guide/monitor/service-log-alarm/","title":"\u4e1a\u52a1\u65e5\u5fd7\u62a5\u8b66","text":"

    \u9664\u4e86Loggie\u672c\u8eab\u7684\u62a5\u8b66\uff0c\u4e1a\u52a1\u65e5\u5fd7\u672c\u8eab\u7684\u76d1\u63a7\u62a5\u8b66\u4e5f\u662f\u4e00\u4e2a\u5e38\u7528\u7684\u529f\u80fd\uff0c\u6bd4\u5982\u5728\u65e5\u5fd7\u4e2d\u5305\u542b\u4e86ERROR\u65e5\u5fd7\uff0c\u53ef\u4ee5\u53d1\u9001\u62a5\u8b66\uff0c\u8fd9\u79cd\u62a5\u8b66\u4f1a\u66f4\u8d34\u8fd1\u4e1a\u52a1\u672c\u8eab\uff0c\u662f\u57fa\u4e8emetrics\u62a5\u8b66\u7684\u4e00\u79cd\u5f88\u597d\u7684\u8865\u5145\u3002

    "},{"location":"user-guide/monitor/service-log-alarm/#_2","title":"\u4f7f\u7528\u65b9\u5f0f","text":"

    \u6709\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\u53ef\u4ee5\u9009\u62e9\uff1a

    "},{"location":"user-guide/monitor/service-log-alarm/#_3","title":"\u91c7\u96c6\u94fe\u8def\u68c0\u6d4b","text":""},{"location":"user-guide/monitor/service-log-alarm/#_4","title":"\u539f\u7406","text":"

    \u91c7\u96c6\u94fe\u8def\u4e0d\u9700\u8981\u72ec\u7acb\u90e8\u7f72Loggie\uff0c\u4f46\u662f\u7531\u4e8e\u5728\u91c7\u96c6\u7684\u6570\u636e\u94fe\u8def\u4e0a\u8fdb\u884c\u5339\u914d\uff0c\u7406\u8bba\u4e0a\u4f1a\u5bf9\u4f20\u8f93\u6027\u80fd\u9020\u6210\u4e00\u5b9a\u5f71\u54cd\uff0c\u4f46\u80dc\u5728\u65b9\u4fbf\u7b80\u5355\u3002

    logAlert interceptor\u7528\u4e8e\u5728\u65e5\u5fd7\u4f20\u8f93\u7684\u65f6\u5019\u68c0\u6d4b\u5f02\u5e38\u65e5\u5fd7\uff0c\u5f02\u5e38\u65e5\u5fd7\u4f1a\u88ab\u5c01\u88c5\u6210\u62a5\u8b66\u7684\u4e8b\u4ef6\u53d1\u9001\u81f3monitor eventbus\u7684logAlert topic\uff0c\u7531logAlert listener\u6765\u6d88\u8d39\u3002logAlert listener\u652f\u6301\u53d1\u9001\u81f3\u4efb\u610fhttp\u540e\u7aef\uff08\u53ef\u4ee5\u591a\u4e2a\uff09\u3002 \u53d1\u9001\u4f53\u6839\u636e\u81ea\u5b9a\u4e49\u6a21\u677f\u8fdb\u884c\u6e32\u67d3\uff0c\u82e5\u6a21\u677f\u672a\u5b9a\u4e49\uff0c\u5219\u4f1a\u53d1\u9001\u539f\u59cb\u6570\u636e\u3002\u5728\u914d\u7f6e\u6a21\u677f\u524d\uff0c\u53ef\u4ee5\u5148\u89c2\u5bdf\u539f\u59cb\u6570\u636e\uff08\u8bbe\u7f6edebug\u6a21\u5f0f\u542f\u52a8\uff09\uff0c\u518d\u8fdb\u884c\u6a21\u677f\u914d\u7f6e\uff0c\u539f\u59cb\u6570\u636e\u53ef\u80fd\u4f1a\u6839\u636epipeline\u914d\u7f6e\u88ab\u5176\u4ed6interceptor\u6539\u52a8\u800c\u4e0e\u793a\u4f8b\u4e0d\u540c\u3002

    "},{"location":"user-guide/monitor/service-log-alarm/#_5","title":"\u914d\u7f6e\u793a\u4f8b","text":""},{"location":"user-guide/monitor/service-log-alarm/#1-logalert-listener","title":"1. \u65b0\u589elogAlert listener","text":"

    \u914d\u7f6e\u65b0\u589elogAlert listener\u53d1\u9001\u544a\u8b66\u914d\u7f6e\u3002\u7528\u4e8e\u5728\u68c0\u6d4b\u5230\u5339\u914d\u7684\u65e5\u5fd7\u540e\uff0c\u5c06\u65e5\u5fd7\u62a5\u8b66\u53d1\u9001\u81f3\u8bf8\u5982alertManager\u7b49\u540e\u7aef\uff0c\u8be6\u7ec6\u914d\u7f6e\u53ef\u53c2\u8003logAlert listener\u3002

    \u5168\u5c40Config\u6587\u4ef6

    loggie:\nmonitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nlogAlert:\naddr: [\"http://127.0.0.1:8080/loggie\"]\nbufferSize: 100\nbatchTimeout: 10s\nbatchSize: 10\nlinelimit: 10\ntemplate: |\n{\n\"alerts\":\n[\n{{$first := true}}\n{{range .Alerts}}\n{{if $first}}{{$first = false}}{{else}},{{end}}\n{\n\"labels\": {\n\"topic\": \"{{.fields.topic}}\"\n},\n\"annotations\": {\n\"message\": \"\\nNew alert: \\nbody:\\n{{range .body}}{{.}}\\n{{end}}\\ncontainerid: {{._meta.pipelineName}}\\nsource: {{._meta.sourceName}}\\ncontainername: {{.fields.containername}}\\nlogconfig: {{.fields.logconfig}}\\nname: {{.fields.name}}\\nnamespace: {{.fields.namespace}}\\nnodename: {{.fields.nodename}}\\npodname: {{.fields.podname}}\\nfilename: {{.state.filename}}\\n\",\n\"reason\": \"{{.reason}}\"\n},\n\"startsAt\": \"{{._meta.timestamp}}\",\n\"endsAt\": \"{{._meta.timestamp}}\"\n}\n{{end}}\n],\n{{$first := true}}\n{{range .Alerts}}\n{{if $first}}{{$first = false}}{{else}}\n\"commonLabels\": {\n\"module\": \"{{._additions.module}}\",\n\"alertname\": \"{{._additions.alertname}}\",\n\"cluster\": \"{{._additions.cluster}}\"\n}\n{{end}}\n{{end}}\n}\nfilesource: ~\nfilewatcher: ~\nreload: ~\nqueue: ~\nsink: ~\nhttp:\nenabled: true\nport: 9196\n

    \u4e0a\u9762\u7684template\u6a21\u7248\u8868\u793a\u53d1\u9001\u7684\u544a\u8b66\u5185\u5bb9\u683c\u5f0f\uff0c\u4f7f\u7528go template\u683c\u5f0f\u3002\u53ef\u53c2\u8003GO Template\uff0c\u6216\u8005\u8bf7\u81ea\u884c\u641c\u7d22go template\u4f7f\u7528\u6559\u7a0b\u3002

    \u5176\u4e2d\u53ef\u4f7f\u7528\u7c7b\u4f3c{{._meta.timestamp}}\u7b49\u5f62\u5f0f\u52a8\u6001\u6e32\u67d3\u539f\u59cbalert\u6570\u636e\u4e2d\u7684\u5b57\u6bb5\u3002

    alert\u5b57\u6bb5\u89e3\u91ca\uff1a

    \u5b57\u6bb5 \u662f\u5426\u5185\u7f6e \u542b\u4e49 _meta \u662f alert\u5143\u6570\u636e _meta.pipelineName \u8868\u793apipeline\u540d\u79f0 _meta.sourceName \u8868\u793asource\u540d\u79f0 _meta.timestamp \u8868\u793a\u65e5\u5fd7\u65f6\u95f4\u6233 body \u662f logBody reason \u662f \u5339\u914d\u6210\u529f\u539f\u56e0 fields \u5426 field\u5b57\u6bb5\uff0c\u7531\u5176\u4f59\u914d\u7f6e\u6dfb\u52a0 state \u5426 \u91c7\u96c6\u4fe1\u606f\uff0c\u9700\u8981\u5728file source\u914d\u7f6eaddonMeta: true _additions \u5426 \u7531\u914d\u7f6e\u6307\u5b9a

    \u539f\u59cbalert\u6570\u636e\u4e3a\u4e00\u4e2ajson\uff0c\u5176\u4e2dAlerts\u4e3a\u56fa\u5b9a\u7684key\u3002

    \u539f\u59cbalert\u6570\u636e\u793a\u4f8b

      {\n\"Alerts\": [\n{\n\"_meta\": {\n\"pipelineName\": \"default/spring\",\n\"sourceName\": \"loggie-source-756fd6bb94-4skqv/loggie-alert/common\",\n\"timestamp\": \"2022-10-28T13:12:30.528824+08:00\"\n},\n\"body\": [\n\"2022-10-28 01:48:07.093 ERROR 1 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].  [dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in   context with path [] threw exception [Request processing failed; nested   exception is java.lang.ArithmeticException: / by zero] with root cause\",\n\"\",\n\"java.lang.ArithmeticException: / by zero\"\n],\n\"fields\": {\n\"containerid\":   \"0dc5f07983bfdf7709ee4fce752679983c4184e94c70dab5fe6df5843d5cbb68\",\n\"containername\": \"loggie-alert\",\n\"logconfig\": \"spring\",\n\"name\": \"loggie-source\",\n\"namespace\": \"default\",\n\"nodename\": \"docker-desktop\",\n\"podname\": \"loggie-source-756fd6bb94-4skqv\",\n\"topic\": \"loggie\"\n},\n\"reason\": \"matches some rules\",\n\"state\": {\n\"bytes\": 6913,\n\"filename\": \"/var/log/pods/  default_loggie-source-756fd6bb94-4skqv_9da3e440-e749-4930-8e4d-41e0d5b66417/  loggie-alert/1.log\",\n\"hostname\": \"docker-desktop\",\n\"offset\": 3836,\n\"pipeline\": \"default/spring\",\n\"source\": \"loggie-source-756fd6bb94-4skqv/loggie-alert/common\",\n\"timestamp\": \"2022-10-28T13:12:30.527Z\"\n},\n\"_additions\": {\n\"namespace\": \"default\",\n\"cluster\": \"local\",\n\"alertname\": \"loggie-test\",\n\"module\": \"loggie\"\n}\n}\n]\n}\n
    "},{"location":"user-guide/monitor/service-log-alarm/#2-logalert-interceptor","title":"2. \u589e\u52a0logAlert interceptor","text":"

    Pipeline\u4e2d\u589e\u52a0logAlert interceptor\u7528\u4e8e\u5728\u91c7\u96c6\u7684\u65f6\u5019\u68c0\u6d4b\u65e5\u5fd7\u5e76\u5339\u914d\u65e5\u5fd7\u62a5\u8b66\u89c4\u5219\uff0c\u53ef\u5728ClusterLogConfig/LogConfig\u4e2d\u5f15\u7528\u3002\u5176\u4e2dadditions\u4e3a\u7ed9alert\u989d\u5916\u6dfb\u52a0\u7684\u5b57\u6bb5\uff0c\u4f1a\u653e\u5165alert\u539f\u59cb\u6570\u636e\u7684_addtions\u5b57\u6bb5\u4e2d\uff0c\u53ef\u7528\u505a\u6a21\u677f\u6e32\u67d3\u3002

    \u5efa\u8bae\u5148\u4f7f\u7528debug\u6a21\u5f0f\uff08-log.level=debug\uff09\u89c2\u5bdf\u539f\u59cbalert\u6570\u636e\u683c\u5f0f\uff0c\u518d\u914d\u7f6e\u6a21\u677f\u8fdb\u884c\u6e32\u67d3\uff0c\u539f\u59cb\u6570\u636e\u4f1a\u53d7\u5230\u5176\u4ed6\u914d\u7f6e\u7684\u5f71\u54cd\uff0c\u8fd9\u91cc\u4ec5\u5c55\u793a\u4e00\u4e2a\u793a\u4f8b\u3002

    \u8be6\u7ec6\u914d\u7f6e\u53ef\u53c2\u8003logAlert interceptor\u3002

    Config

    apiVersion: loggie.io/v1beta1\nkind: Interceptor\nmetadata:\nname: logalert\nspec:\ninterceptors: |\n- type: logAlert\nmatcher:\ncontains: [\"ERROR\"]\nadditions:\nmodule: \"loggie\"\nalertname: \"loggie-test\"\ncluster: \"local\"\n

    \u5339\u914d\u5230\u65e5\u5fd7\u544a\u8b66\u89c4\u5219\u4e4b\u540e\uff0c\u544a\u8b66\u540e\u7aef\u53ef\u63a5\u6536\u5230\u7c7b\u4f3c\u7684\u6570\u636e\u5982\u4e0b\u6240\u793a\uff1a

    Example

    {\n\"alerts\": [\n{\n\"labels\": {\n\"topic\": \"loggie\"\n},\n\"annotations\": {\n\"message\": \"\\nNew alert: \\nbody:\\n2022-10-28 01:48:07.093 ERROR 1 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ArithmeticException: / by zero] with root cause\\n\\njava.lang.ArithmeticException: / by zero\\ncontainerid: 0dc5f07983bfdf7709ee4fce752679983c4184e94c70dab5fe6df5843d5cbb68\\nsource: loggie-source-756fd6bb94-4skqv/loggie-alert/common\\ncontainername: loggie-alert\\nlogconfig: spring\\nname: loggie-source\\nnamespace: default\\nnodename: docker-desktop\\npodname: loggie-source-756fd6bb94-4skqv\\nfilename: /var/log/pods/default_loggie-source-756fd6bb94-4skqv_9da3e440-e749-4930-8e4d-41e0d5b66417/loggie-alert/1.log\\n\",\n\"reason\": \"matches some rules\"\n},\n\"startsAt\": \"2022-10-28T13:12:30.527Z\",\n\"endsAt\": \"2022-10-28T13:12:30.527Z\"\n}\n],\n\"commonLabels\": {\n\"module\": \"loggie\",\n\"alertname\": \"loggie-test\",\n\"cluster\": \"local\"\n}\n}\n
    "},{"location":"user-guide/monitor/service-log-alarm/#_6","title":"\u72ec\u7acb\u94fe\u8def\u68c0\u6d4b","text":""},{"location":"user-guide/monitor/service-log-alarm/#_7","title":"\u539f\u7406","text":"

    Loggie\u914d\u7f6esource\u91c7\u96c6\u65e5\u5fd7\uff0c\u7ecf\u8fc7logAlert interceptor\u5339\u914d\u65f6\uff0c\u53ef\u914d\u7f6esendOnlyMatched\u4ec5\u5c06\u5339\u914d\u6210\u529f\u7684\u65e5\u5fd7\u53d1\u9001\u81f3alertWebhook sink\uff0c\u5339\u914d\u5931\u8d25\u7684\u65e5\u5fd7\u770b\u4f5c\u6b63\u5e38\u65e5\u5fd7\u88ab\u5ffd\u7565\u3002\u5efa\u8bae\u5728\u4f7f\u7528alertWebhook sink\u65f6\uff0c\u540c\u65f6\u5f00\u542flogAlert interceptor, \u8bbe\u7f6esendOnlyMatched\u4e3atrue\u642d\u914d\u4f7f\u7528\u3002

    "},{"location":"user-guide/monitor/service-log-alarm/#_8","title":"\u914d\u7f6e\u793a\u4f8b","text":"

    \u914d\u7f6e\u65b0\u589ealertWebhook sink\u3002\u8be6\u7ec6\u914d\u7f6e\u53ef\u53c2\u8003alertWebhook Sink\u3002

    Config

        sink:\ntype: alertWebhook\naddr: http://localhost:8080/loggie\nlinelimit: 10\ntemplate: |\n{\n\"alerts\":\n[\n{{$first := true}}\n{{range .Alerts}}\n{{if $first}}{{$first = false}}{{else}},{{end}}\n{\n\"labels\": {\n\"topic\": \"{{.fields.topic}}\"\n},\n\"annotations\": {\n\"message\": \"\\nNew alert: \\nbody:\\n{{range .body}}{{.}}\\n  {{end}}\\ncontainerid: {{._meta.pipelineName}}\\nsource: {{.  _meta.sourceName}}\\ncontainername: {{.fields.  containername}}\\nlogconfig: {{.fields.logconfig}}\\nname:   {{.fields.name}}\\nnamespace: {{.fields.namespace}}  \\nnodename: {{.fields.nodename}}\\npodname: {{.fields.  podname}}\\nfilename: {{.state.filename}}\\n\",\n\"reason\": \"{{.reason}}\"\n},\n\"startsAt\": \"{{._meta.timestamp}}\",\n\"endsAt\": \"{{._meta.timestamp}}\"\n}\n{{end}}\n],\n{{$first := true}}\n{{range .Alerts}}\n{{if $first}}{{$first = false}}{{else}}\n\"commonLabels\": {\n\"namespace\": \"{{._additions.namespace}}\",\n\"module\": \"{{._additions.module}}\",\n\"alertname\": \"{{._additions.alertname}}\",\n\"cluster\": \"{{._additions.cluster}}\"\n}\n{{end}}\n{{end}}\n}\n

    logAlert Interceptor\u914d\u7f6e\u548c\u63a5\u6536\u65b9\u6536\u5230\u7684\u62a5\u8b66\u4e0e\u91c7\u96c6\u94fe\u8def\u68c0\u6d4b\u62a5\u8b66\u7c7b\u4f3c\u3002

    "},{"location":"user-guide/troubleshot/log-collection/","title":"\u65e5\u5fd7\u91c7\u96c6\u5feb\u901f\u6392\u969c\u6307\u5357","text":"

    \u4e3a\u4ec0\u4e48\u6211\u7684\u65e5\u5fd7\u6ca1\u6709\u91c7\u96c6\uff1f

    \u65e5\u5fd7\u91c7\u96c6\u4e2d\uff0c\u6700\u4e3a\u5173\u952e\u6838\u5fc3\u7684\u95ee\u9898\u662f\uff0c\u65e5\u5fd7\u6709\u6ca1\u6709\u88ab\u91c7\u96c6\u5230\uff0c\u4e3a\u4ec0\u4e48\u6211\u914d\u7f6e\u7684\u65e5\u5fd7\u6ca1\u6709\u53d1\u9001\u8fc7\u53bb\uff1f \u4e0b\u9762\u63d0\u4f9b\u4e86\u6838\u5fc3\u7684\u6392\u67e5\u601d\u8def\u548c\u624b\u6bb5\u4f9b\u53c2\u8003\u3002 \u53e6\u5916\uff0c\u6700\u91cd\u8981\u7684\u662f\uff0c\u5728\u73af\u5883\u91cc\u914d\u7f6eLoggie\u7684Prometheus\u76d1\u63a7\u548cGrafana\u56fe\u8868\uff0c\u53ef\u4ee5\u5feb\u901f\u53d1\u73b0\u95ee\u9898\u3002

    "},{"location":"user-guide/troubleshot/log-collection/#_2","title":"\u65e5\u5fd7\u91c7\u96c6\u6838\u5fc3\u673a\u5236","text":"

    \u4e86\u89e3\u5b9e\u73b0\u673a\u5236\u662f\u6392\u969c\u7684\u57fa\u7840\uff1a

    1. \u4e0b\u53d1\u91c7\u96c6\u4efb\u52a1\uff1a\u521b\u5efa\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1LogConfig CR\u81f3Kubernetes
    2. \u63a5\u6536\u65e5\u5fd7\u914d\u7f6e\uff1a\u8282\u70b9\u7684Agent Loggie\u76d1\u542c\u5230K8s\u76f8\u5e94\u4e8b\u4ef6\uff0c\u5c06LogConfig\u8f6c\u6362\u6210Pipelines\u914d\u7f6e\u6587\u4ef6
    3. \u91c7\u96c6\u65e5\u5fd7\u6587\u4ef6\uff1aLoggie\u4f1a\u81ea\u52a8Reload\u7136\u540e\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff0c\u7136\u540e\u6839\u636e\u914d\u7f6e\u53d1\u9001\u76f8\u5e94\u7684\u65e5\u5fd7\u6570\u636e\u5230\u4e0b\u6e38\u670d\u52a1

    \uff08\u9488\u5bf9\u975eKubernetes\u7684\u4e3b\u673a\u573a\u666f\uff0c\u53ea\u662f\u5c11\u4e86LogConfig CRD\u914d\u7f6e\u4e0b\u53d1\u7684\u6b65\u9aa4\uff0c\u5176\u4f59\u7c7b\u4f3c\uff09

    "},{"location":"user-guide/troubleshot/log-collection/#loggie-terminal","title":"Loggie Terminal","text":"

    \u5728Kubernetes\u7684\u573a\u666f\u4e0b\uff0c\u76ee\u524dLoggie\u63d0\u4f9b\u4e86\u4e00\u4e2a\u57fa\u4e8eterminal\u7684\u53ef\u4ea4\u4e92\u5f0fdashboard\uff0c\u53ef\u4ee5\u66f4\u597d\u7684\u5e2e\u52a9\u6211\u4eec\u4fbf\u6377\u7684\u6392\u67e5\u95ee\u9898\u3002

    \u8fdb\u5165Terminal

    \u627e\u5230\u4efb\u610f\u4e00\u4e2aLoggie Pod\u5e76\u6267\u884cloggie inspect:

    kubectl -nloggie exec -it $(kubectl -nloggie get po -oname|head -n1|cut -d/ -f2) -- ./loggie inspect\n

    \u6216\u8005\uff0c \u5982\u679c\u4f60\u8bb0\u4e0d\u4f4f\u4ee5\u4e0a\u547d\u4ee4\uff0c\u53ef\u4ee5\uff1a - \u627e\u5230\u4efb\u610f\u4e00\u4e2aLoggie Pod

    kubectl -nloggie get po -owide\n

    \u4f7f\u7528terminal

    terminal\u9996\u9875\u5c55\u793a\u793a\u4f8b\u5982\u4e0b\u6240\u793a\uff1a

    \u5177\u4f53\u8bf7\u53c2\u8003\u4f7f\u7528\u8bf4\u660e\u89c6\u9891\u3002

    Tips

    Loggie terminal\u529f\u80fd\u4ec5\u4ecev1.4\u7248\u672c\u5f00\u59cb\u63d0\u4f9b\uff0c\u5982\u679c\u4ece\u4f4e\u7248\u672c\u5347\u7ea7\uff0c\u9700\u589e\u52a0clusterrole\u914d\u7f6e\uff0c\u8bf7\u53c2\u8003\u8fd9\u91cc\u3002

    "},{"location":"user-guide/troubleshot/log-collection/#_3","title":"\u624b\u52a8\u6392\u67e5\u6b65\u9aa4","text":"

    \u6392\u67e5\u95ee\u9898\u5173\u952e\u5148\u8981\u786e\u5b9a\u662f\u54ea\u4e00\u6b65\u51fa\u73b0\u4e86\u95ee\u9898\u3002

    "},{"location":"user-guide/troubleshot/log-collection/#_4","title":"\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\u6392\u67e5","text":"

    \u67e5\u770b\u6211\u4eec\u8981\u6392\u67e5\u7684\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1LogConfig/ClusterLogConfig\u7684Events\u4e8b\u4ef6\uff1a

    kubectl -n ${namespace} describe lgc ${name}\n

    \u5982\u679c\u6ca1\u6709events\uff0c\u5219\u53ef\u80fd\u4e3a\uff1a

    \u5982\u679c\u6ca1\u6709\u7c7b\u4f3csync success\u7684events\uff0c\u53ef\u6839\u636eevents\u540c\u65f6\u7ed3\u5408Loggie\u65e5\u5fd7\u6392\u67e5\u95ee\u9898\uff1a

    \u5e38\u89c1\u7684\u5f02\u5e38\u6709\uff1a

    "},{"location":"user-guide/troubleshot/log-collection/#agent","title":"\u8282\u70b9\u65e5\u5fd7Agent\u6392\u67e5","text":""},{"location":"user-guide/troubleshot/log-collection/#1-logconfigpodagent","title":"1. \u627e\u5230logConfig\u5339\u914d\u7684pod\u6240\u5728\u8282\u70b9\u7684\u65e5\u5fd7Agent","text":"

    \u6839\u636e\u5728logConfig\u7684labelSelector\u627e\u5230\u4e00\u4e2a\u5339\u914d\u7684\u4e1a\u52a1pod\uff1a

    kubectl -n ${namespace} get po -owide -l ${labels}\n
    \u627e\u5230\u4efb\u610f\u4e00\u4e2a\u6240\u5728\u7684Node\u8282\u70b9${node-name}\uff0c\u7136\u540e\u901a\u8fc7\uff1a
    kubectl -n ${loggie-namespace} get po -owide |grep ${node-name}\n
    \u627e\u5230\u8be5\u8282\u70b9\u6240\u5728\u7684Loggie\u3002

    "},{"location":"user-guide/troubleshot/log-collection/#2-loggie","title":"2. \u67e5\u770b\u5bf9\u5e94\u8282\u70b9\u7684Loggie\u65e5\u5fd7","text":"

    \u68c0\u67e5\u662f\u5426\u6709\u5f02\u5e38\uff0c\u5982\u679c\u6709\u5f02\u5e38\uff0c\u5219\u9700\u6839\u636e\u5f02\u5e38\u65e5\u5fd7\u518d\u505a\u5206\u6790\u5224\u65ad

    kubectl -n ${loggie-namespace} logs -f ${loggie-pod-name} \u2014-tail=${N}\n

    "},{"location":"user-guide/troubleshot/log-collection/#3","title":"3. \u67e5\u770b\u91c7\u96c6\u60c5\u51b5","text":"

    \u8c03\u7528\u81ea\u52a8\u6392\u969c\u63a5\u53e3

    \u9488\u5bf9\u5bf9\u5e94\u7684Agent\uff0c\u8c03\u7528help\u63a5\u53e3\uff1a

    curl <ip>:9196/api/v1/help\n

    \u63a5\u53e3\u8fd4\u56de\u91cc\u6700\u5f00\u5934\u5305\u62ec\u4e86\u4e00\u4e2a\u4f7f\u7528\u63d0\u793a\uff1a

    --------- Usage: -----------------------\n|--- view details: /api/v1/help?detail=<module>, module is one of: all/pipeline/log\n|--- query by pipeline name: /api/v1/help?pipeline=<name>\n|--- query by source name: /api/v1/help?source=<name>\n
    \u6211\u4eec\u53ef\u4ee5\u4f7f\u7528curl <ip>:9196/api/v1/help?detail=all\u6765\u67e5\u8be2\u6240\u6709\u7684\u7ec6\u8282\u8be6\u60c5\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u6839\u636epipeline\u6216\u8005source\u7684\u540d\u79f0\u6765\u641c\u7d22\u3002

    \u76ee\u524d\u8fd4\u56de\u4e3b\u8981\u5305\u62ec\u4e24\u90e8\u5206\uff1a

    \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u8be5\u63a5\u53e3\u8986\u76d6\u4e86\u4ee5\u4e0b\u64cd\u4f5c\u5f97\u5230\u7684\u5185\u5bb9\uff0c\u65e0\u9700\u7ee7\u7eed\u8fdb\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff0c\u4e0b\u6587\u6b65\u9aa4\u4ec5\u4f9b\u53c2\u8003\u3002

    \u67e5\u770b\u8282\u70b9Loggie\u6e32\u67d3\u751f\u6210\u7684\u914d\u7f6e

    \u8fdb\u5165\u5230\u5bb9\u5668\u4e2d\uff1a

    kubectl -n ${loggie-namespace} exec -it ${loggie-pod-name} bash\n
    \u67e5\u770b\u6e32\u67d3\u751f\u6210\u7684Pipeline\u914d\u7f6e\uff1a
    ls /opt/loggie/pipeline/\n
    \u5f53\u7136\uff0c\u4f60\u4e5f\u53ef\u4ee5\u9009\u62e9\u901a\u8fc7\u8c03\u7528Loggie\u63a5\u53e3\u6765\u67e5\u770b\u6e32\u67d3\u751f\u6210\u7684Pipeline\u914d\u7f6e\uff1a
    curl ${loggie-pod-ip}:9196/api/v1/reload/config\n

    \u786e\u8ba4\u65e5\u5fd7\u91c7\u96c6\u914d\u7f6e

    cat /opt/loggie/pipeline/\n
    \u67e5\u770b\u73b0\u5728\u6e32\u67d3\u540e\u7684\u65e5\u5fd7\u914d\u7f6e\uff0c\u8fd9\u91cc\u7684path\u4e3a\u6839\u636elogconfig\u91cc\u586b\u5199\u7684\u5bb9\u5668\u91ccpath\u8f6c\u6362\u540e\u7684\u8def\u5f84\uff0c\u4e3a\u5b9e\u9645\u8282\u70b9\u7684path\uff0c\u6b63\u5e38\u53ef\u4ee5\u5728\u8282\u70b9\u4e0a\u627e\u5230\u3002 \u5f53\u7136\uff0c\u56e0\u4e3aLoggie\u4f7f\u7528\u5bb9\u5668\u5316\u90e8\u7f72\uff0cLoggie Pod\u91cc\u65e0\u6cd5\u67e5\u770b\u5230\u8282\u70b9\u6240\u6709\u7684\u914d\u7f6e\uff0c\u9700\u8981\u786e\u4fddLoggie\u4e5f\u6302\u8f7d\u4e86\u76f8\u5173\u7684\u8def\u5f84\u524d\u7f00\u3002

    \u67e5\u770b\u65e5\u5fd7\u91c7\u96c6\u6301\u4e45\u5316\u72b6\u6001

    Loggie\u4f1a\u8bb0\u5f55\u6bcf\u4e2a\u65e5\u5fd7\u6587\u4ef6\u7684\u91c7\u96c6\u72b6\u6001\uff0c\u8fd9\u6837\u5373\u4f7fLoggie\u91cd\u542f\u540e\uff0c\u4e5f\u53ef\u4ee5\u7ee7\u7eed\u4fdd\u6301\u4e0a\u4e00\u6b21\u7684\u91c7\u96c6\u8fdb\u5ea6\uff0c\u907f\u514d\u91cd\u65b0\u91c7\u96c6\u65e5\u5fd7\u6587\u4ef6\u3002 \u53ef\u4ee5\u901a\u8fc7\u8c03\u7528\u63a5\u53e3\u6765\u67e5\u770b\uff1a

    curl ${loggie-pod-ip}:9196/api/v1/source/file/registry?format=text | grep XXX\n
    \u4e00\u822c\u8fd4\u56de\u7684\u7c7b\u4f3c\uff1a
      {\n    \"id\": 85,\n    \"pipelineName\": \"default/tomcat\",\n    \"sourceName\": \"tomcat-7d64c4f6c9-cm8jm/tomcat/common\",\n    \"filename\": \"/var/lib/kubelet/pods/9397b8be-8927-44ba-8b94-73e5a4459377/volumes/kubernetes.io~empty-dir/log/catalina.2022-06-02.log\",\n    \"jobUid\": \"3670030-65025\",\n    \"offset\": 4960,\n    \"collectTime\": \"2022-06-06 12:44:12.861\",\n    \"version\": \"0.0.1\"\n  },\n
    \u5176\u4e2d\u7684filename\u4e3aLoggie\u8f6c\u6362\u540e\u7684\u5b9e\u9645\u8282\u70b9\u4e0a\u7684\u65e5\u5fd7\u8def\u5f84\uff0cjobUid\u7ec4\u6210\u4e3a\u6587\u4ef6\u7684inode-deviceId\uff0coffset\u4e3asink\u53d1\u9001\u6210\u529f\u63a5\u6536\u5230ack\u540e\u7684offset\u3002 \u53e6\u5916\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5728Loggie\u5bb9\u5668\u4e2d\u6267\u884c\uff1a
    stat ${filename}\n
    \u67e5\u770b\u6587\u4ef6\u7684size/inode\u7b49\u4fe1\u606f\uff0c\u4f8b\u5982\uff1a

    stat

      File: /var/lib/kubelet/pods/9397b8be-8927-44ba-8b94-73e5a4459377/volumes/kubernetes.io~empty-dir/log/catalina.2022-06-02.log\nSize: 4960        Blocks: 16         IO Block: 4096   regular file\nDevice: fe01h/65025d    Inode: 3670030     Links: 1\nAccess: (0640/-rw-r-----)  Uid: (    0/    root)   Gid: (    0/    root)\nAccess: 2022-06-06 12:44:12.859236003 +0000\nModify: 2022-06-02 08:54:33.177240007 +0000\nChange: 2022-06-02 08:54:33.177240007 +0000\n

    \u53ef\u901a\u8fc7\u6bd4\u8f83size\u548coffset\u6765\u5224\u65ad\u91c7\u96c6\u8fdb\u5ea6\u3002\u5982\u679csize=offset\uff0c\u5219\u8bf4\u660e\u5df2\u7ecf\u6587\u4ef6\u5df2\u7ecf\u5168\u90e8\u91c7\u96c6\u5e76\u53d1\u9001\u6210\u529f\u3002

    "},{"location":"user-guide/troubleshot/problems/","title":"\u95ee\u9898\u6848\u4f8b","text":""},{"location":"user-guide/troubleshot/problems/#netcgolookupip-segmentation-violation","title":"net.cgoLookupIP \u5bfc\u81f4segmentation violation","text":"

    \u73b0\u8c61

    \u53ef\u80fd\u5728\u4f7f\u7528\u4e86\u6bd4\u5982unix sock source\u7684\u65f6\u5019\uff0cLoggie\u542f\u52a8\u540ecrash\uff0c\u5e76\u6709\u5982\u4e0b\u7684\u65e5\u5fd7\uff1a

    fatal error: unexpected signal during runtime execution\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x47 pc=0x7f59b4528360]\n\nruntime stack:\nruntime.throw({0x213b1a1, 0x7f59b423b640})\n    /usr/local/go/src/runtime/panic.go:1198 +0x71\nruntime.sigpanic()\n    /usr/local/go/src/runtime/signal_unix.go:719 +0x396\n\ngoroutine 86 [syscall]:\nruntime.cgocall(0x1a39d30, 0xc000510d90)\n    /usr/local/go/src/runtime/cgocall.go:156 +0x5c fp=0xc000510d68 sp=0xc000510d30 pc=0x40565c\nnet._C2func_getaddrinfo(0xc00030bc40, 0x0, 0xc000724fc0, 0xc0005bd990)\n    _cgo_gotypes.go:91 +0x56 fp=0xc000510d90 sp=0xc000510d68 pc=0x5c7bb6\nnet.cgoLookupIPCNAME.func1({0xc00030bc40, 0xc0004d29c0, 0x4}, 0xc00030bb80, 0xc000510e50)\n    /usr/local/go/src/net/cgo_unix.go:163 +0x9f fp=0xc000510de8 sp=0xc000510d90 pc=0x5c98ff\nnet.cgoLookupIPCNAME({0x20f751c, 0x3}, {0xc00030bb80, 0xc00022b5e0})\n    /usr/local/go/src/net/cgo_unix.go:163 +0x16d fp=0xc000510f38 sp=0xc000510de8 pc=0x5c914d\nnet.cgoIPLookup(0x358aed0, {0x20f751c, 0xc00030bbc0}, {0xc00030bb80, 0xc000510fb8})\n    /usr/local/go/src/net/cgo_unix.go:220 +0x3b fp=0xc000510fa8 sp=0xc000510f38 pc=0x5c99bb\nnet.cgoLookupIP\u00b7dwrap\u00b725()\n    /usr/local/go/src/net/cgo_unix.go:230 +0x36 fp=0xc000510fe0 sp=0xc000510fa8 pc=0x5c9e36\nruntime.goexit()\n    /usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000510fe8 sp=0xc000510fe0 pc=0x46ae81\ncreated by net.cgoLookupIP\n    /usr/local/go/src/net/cgo_unix.go:230 +0x125\n

    \u539f\u56e0

    \u5177\u4f53\u539f\u56e0\u8bf7\u53c2\u8003\uff1ago net\u3002

    Name Resolution\n\nThe method for resolving domain names, whether indirectly with functions like Dial\nor directly with functions like LookupHost and LookupAddr, varies by operating system.\n\nOn Unix systems, the resolver has two options for resolving names.\nIt can use a pure Go resolver that sends DNS requests directly to the servers\nlisted in /etc/resolv.conf, or it can use a cgo-based resolver that calls C\nlibrary routines such as getaddrinfo and getnameinfo.\n\nBy default the pure Go resolver is used, because a blocked DNS request consumes\nonly a goroutine, while a blocked C call consumes an operating system thread.\nWhen cgo is available, the cgo-based resolver is used instead under a variety of\nconditions: on systems that do not let programs make direct DNS requests (OS X),\nwhen the LOCALDOMAIN environment variable is present (even if empty),\nwhen the RES_OPTIONS or HOSTALIASES environment variable is non-empty,\nwhen the ASR_CONFIG environment variable is non-empty (OpenBSD only),\nwhen /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the\nGo resolver does not implement, and when the name being looked up ends in .local\nor is an mDNS name.\n\nThe resolver decision can be overridden by setting the netdns value of the\nGODEBUG environment variable (see package runtime) to go or cgo, as in:\n\n    export GODEBUG=netdns=go    # force pure Go resolver\n    export GODEBUG=netdns=cgo   # force cgo resolver\n\nThe decision can also be forced while building the Go source tree\nby setting the netgo or netcgo build tag.\n

    \u89e3\u51b3\u529e\u6cd5

    \u5728Loggie \u90e8\u7f72\u811a\u672c\u91cc\u589e\u52a0\u73af\u5883\u53d8\u91cf\uff1a

      env:\n- name: GODEBUG\nvalue: netdns=go\n
    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/","title":"\u4f7f\u7528Loggie\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7","text":"

    \u9605\u8bfb\u672c\u6587\u4e4b\u524d\uff0c\u5efa\u8bae\u5148\u53c2\u8003Kubernetes\u4e0b\u65e5\u5fd7\u91c7\u96c6\u95ee\u9898\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#loggie_1","title":"Loggie\u5982\u4f55\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff1f","text":"

    \u7531\u4e8eKubernetes\u826f\u597d\u7684\u53ef\u6269\u5c55\u6027\uff0cKubernetes\u8bbe\u8ba1\u4e86\u4e00\u79cd\u81ea\u5b9a\u4e49\u8d44\u6e90CRD\u7684\u6982\u5ff5\uff0c\u7528\u6237\u53ef\u4ee5\u81ea\u5df1\u5b9a\u4e49CRD\u8868\u793a\u81ea\u5df1\u7684\u671f\u671b\u72b6\u6001\uff0c\u5e76\u501f\u52a9\u4e00\u4e9bframework\u5f00\u53d1Controller\uff0c\u4f7f\u7528Controller\u5c06\u6211\u4eec\u7684\u671f\u671b\u53d8\u6210\u73b0\u5b9e\u3002

    \u57fa\u4e8e\u8fd9\u4e2a\u601d\u8def\uff0c\u4e00\u4e2a\u670d\u52a1\u9700\u8981\u91c7\u96c6\u54ea\u4e9b\u65e5\u5fd7\uff0c\u9700\u8981\u4ec0\u4e48\u6837\u7684\u65e5\u5fd7\u914d\u7f6e\uff0c\u662f\u7528\u6237\u7684\u671f\u671b\uff0c\u800c\u8fd9\u5c31\u9700\u8981\u6211\u4eec\u5f00\u53d1\u4e00\u4e2a\u65e5\u5fd7\u91c7\u96c6\u7684Controller\u53bb\u5b9e\u73b0\u3002

    \u6240\u4ee5\uff0c\u7528\u6237\u53ea\u9700\u8981\u5728\u6211\u4eec\u5b9a\u4e49\u7684CRD LogConfig\u4e2d\uff0c\u586b\u5199\u9700\u8981\u91c7\u96c6\u54ea\u4e9bPods\u7684\u65e5\u5fd7\uff0c\u5728Pod\u4e2d\u7684\u65e5\u5fd7\u8def\u5f84\u662f\u4ec0\u4e48\u3002

    \u6838\u5fc3\u67b6\u6784\u5982\u4e0b\u56fe\u6240\u793a\uff1a

    Loggie\u4f1a\u611f\u77e5\u5230Pod\u548cCRD\u7684\u4e8b\u4ef6\uff0c\u8fdb\u884c\u914d\u7f6e\u7684\u52a8\u6001\u66f4\u65b0\u3002\u540c\u65f6\uff0cLoggie\u53ef\u4ee5\u6839\u636e\u65e5\u5fd7\u6587\u4ef6\u8def\u5f84\u6302\u8f7d\u7684Volume\uff0c\u627e\u5230\u76f8\u5e94\u5728\u8282\u70b9\u7684\u6587\u4ef6\u8fdb\u884c\u91c7\u96c6\u3002\u53e6\u5916\u8fd8\u53ef\u4ee5\u6839\u636e\u914d\u7f6e\uff0c\u81ea\u52a8\u5c06Pod\u4e0a\u7684Env/Annotation/Label\u52a0\u5165\u5230\u65e5\u5fd7\u91cc\u4f5c\u4e3a\u5143\u4fe1\u606f\u3002

    \u540c\u65f6\u76f8\u6bd4\u7c97\u66b4\u7684\u6240\u6709\u8282\u70b9\u6302\u8f7d\u76f8\u540c\u8def\u5f84\u8fdb\u884c\u901a\u914d\u91c7\u96c6\u7684\u65b9\u5f0f\uff0c\u4e5f\u89e3\u51b3\u4e86\u6ca1\u6cd5\u9488\u5bf9\u5355\u4e2a\u670d\u52a1\u7cbe\u7ec6\u5316\u914d\u7f6e\u3001\u91c7\u96c6\u65e0\u5173\u65e5\u5fd7\u7684\u95ee\u9898\u3002

    \u5f53\u7136\u5e26\u6765\u7684\u597d\u5904\u4e0d\u4ec5\u4ec5\u8fd9\u4e9b\uff0cLoggie\u5728\u52a8\u6001\u914d\u7f6e\u4e0b\u53d1\u3001\u76d1\u63a7\u6307\u6807\u7b49\u65b9\u9762\u90fd\u53ef\u4ee5\u57fa\u4e8eKubernetes\u8fdb\u884c\u76f8\u5e94\u7684\u9002\u914d\u548c\u652f\u6301\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#crd","title":"CRD\u4f7f\u7528\u8bf4\u660e","text":"

    Loggie\u76ee\u524d\u6709\u4ee5\u4e0b\u51e0\u79cdCRD\uff1a

    \u4f7f\u7528CRD\u7684\u6d41\u7a0b\u67b6\u6784\u5982\u4e0b\u6240\u793a\uff1a

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#_1","title":"\u51c6\u5907\u5de5\u4f5c","text":""},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#_2","title":"\u90e8\u7f72\u67b6\u6784","text":"

    \u6574\u4f53\u7684\u90e8\u7f72\u67b6\u6784\u662f\u4ec0\u4e48\uff1f

    1. Loggie Agent\u76f4\u63a5\u53d1\u9001\u7ed9\u540e\u7aef\u6bd4\u5982Elasticsearch\u8fd8\u662f\u5176\u4ed6\u5b58\u50a8\u7b49
    2. Loggie Agent\u53d1\u9001\u81f3Loggie Aggregator\u4e2d\u8f6c\u5904\u7406\uff0c\u518d\u8f6c\u53d1\u81f3\u5176\u4ed6\u540e\u7aef\u5b58\u50a8
    3. Loggie Agent\u53d1\u9001\u81f3Kafka\uff0cLoggie Aggregator\u6d88\u8d39Kafka\u518d\u53d1\u9001\u81f3\u540e\u7aef ...

    \u672c\u6587\u4ec5\u5173\u6ce8\u91c7\u96c6\u7aef\uff0c\u5982\u679c\u9700\u8981\u4f7f\u7528\u90e8\u7f72Loggie Aggregator\uff0c\u8bf7\u53c2\u8003Loggie\u4e2d\u8f6c\u673a\u3002

    \u5728\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u5df2\u7ecf\u5728Kubernetes\u4e2d\u90e8\u7f72\u4e86Loggie DaemonSet\u3002\u5982\u4f55\u5728Kubernetes\u4e2d\u90e8\u7f72Loggie\uff1f

    Info

    \u6211\u4eec\u63a8\u8350\u4f7f\u7528DaemonSet\u7684\u65b9\u5f0f\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff0cLoggie\u5df2\u652f\u6301\u81ea\u52a8\u6ce8\u5165Loggie Sidecar\u7684\u65b9\u5f0f\u91c7\u96c6\u65e5\u5fd7\u3002\u8bf7\u53c2\u8003\uff1ahttps://github.com/loggie-io/loggie-operator

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#_3","title":"\u4f7f\u7528\u65b9\u5f0f","text":"

    \u4e1a\u52a1Pod\u4f7f\u7528\u4ec0\u4e48\u65b9\u5f0f\u6302\u8f7d\u65e5\u5fd7\uff1f \u5efa\u8bae\u5982\u679c\u5bf9\u65e5\u5fd7\u53ef\u80fd\u6027\u7684\u4e22\u5931\u4e0d\u654f\u611f\uff0c\u6bd4\u5982\u8fd0\u7ef4\u7c7b\u7684\u65e5\u5fd7\uff0c\u53ef\u4ee5\u4f7f\u7528emptyDir\u3002\u5982\u679c\u65e5\u5fd7\u6bd4\u8f83\u91cd\u8981\uff0c\u4e0d\u5141\u8bb8\u4e22\u5931\uff0c\u8bf7\u4f7f\u7528hostPath\uff0c\u5e76\u5728volumeMount\u914d\u7f6esubPathExpr\u5b9e\u73b0\u8def\u5f84\u9694\u79bb\u3002

    Example

    tomcat-emptydir.ymltomcat-hostpath.yml
    apiVersion: apps/v1\nkind: Deployment\nmetadata:\nlabels:\napp: tomcat\nname: tomcat\nnamespace: default\nspec:\nreplicas: 1\nselector:\nmatchLabels:\napp: tomcat\ntemplate:\nmetadata:\nlabels:\napp: tomcat\nspec:\ncontainers:\n- name: tomcat\nimage: tomcat\nvolumeMounts:\n- mountPath: /usr/local/tomcat/logs\nname: log\nvolumes:\n- emptyDir: {}\nname: log        
    apiVersion: apps/v1\nkind: Deployment\nmetadata:\nlabels:\napp: tomcat\nname: tomcat\nnamespace: default\nspec:\nreplicas: 1\nselector:\nmatchLabels:\napp: tomcat\ntemplate:\nmetadata:\nlabels:\napp: tomcat\nspec:\ncontainers:\n- env:\n- name: POD_NAME\nvalueFrom:\nfieldRef:\napiVersion: v1\nfieldPath: metadata.name\n- name: NAMESPACE\nvalueFrom:\nfieldRef:\napiVersion: v1\nfieldPath: metadata.namespace\nimage: tomcat\nname: tomcat\nvolumeMounts:\n- mountPath: /log\nname: datalog\nsubPathExpr: $(NAMESPACE)/$(POD_NAME)\nvolumes:\n- hostPath:\npath: /data/log\ntype: \"\"\nname: datalog\n

    Caution

    \u8bf7\u786e\u4fddPod\u6302\u8f7d\u7684\u65e5\u5fd7\u8def\u5f84\u4e0d\u4f1a\u88ab\u591a\u4e2aPod\u5171\u4eab\u3002\u6bd4\u5982\u4e00\u4e2aDeployment\u4e0b\u7684\u4e24\u4e2aPod\uff0c\u4f7f\u7528\u672a\u914d\u7f6esubPathExpr\u7684hostPath\u6302\u8f7d\u65e5\u5fd7\u76ee\u5f55\uff0c\u5982\u679c\u4e24\u4e2aPod\u8c03\u5ea6\u5728\u76f8\u540c\u7684\u8282\u70b9\uff0c\u4f1a\u6253\u5370\u5230\u76f8\u540c\u7684\u65e5\u5fd7\u76ee\u5f55\u548c\u6587\u4ef6\u4e2d\uff0c\u6b64\u65f6\u53ef\u80fd\u5f15\u8d77\u91c7\u96c6\u5f02\u5e38\u3002

    \u6211\u4eec\u9996\u5148\u521b\u5efa\u4ee5\u4e0a\u793a\u4f8b\u7684tomcat Deployment\u4f5c\u4e3a\u6211\u4eec\u88ab\u91c7\u96c6\u65e5\u5fd7\u7684\u5bf9\u8c61\u3002

    kubectl apply -f tomcat-emptydir.yml\n

    \u63a5\u4e0b\u6765\u5c06\u6f14\u793a\u91c7\u96c6\u4e0a\u9762\u793a\u4f8b\u7684tomcat\u65e5\u5fd7\uff0c\u5e76\u53d1\u9001\u81f3Elasticsearch\u3002 \u5982\u679c\u4f60\u5e0c\u671b\u91c7\u96c6\u5176\u4ed6\u7684\u5bb9\u5668\u65e5\u5fd7\uff0c\u6216\u8005\u53d1\u9001\u81f3\u5176\u4ed6\u7684\u540e\u7aef\uff0c\u53ea\u9700\u8981\u4fee\u6539\u5176\u4e2d\u7684\u914d\u7f6e\u5373\u53ef\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#elasticsearchkibana","title":"\u90e8\u7f72Elasticsearch\u548cKibana\uff08\u53ef\u9009\uff09","text":"

    \u7531\u4e8e\u672c\u6587\u6f14\u793a\u53d1\u9001\u81f3Elasticsearch\uff0c\u6240\u4ee5\u8fd9\u91cc\u6211\u4eec\u90e8\u7f72\u4e00\u4e0bElasticsearch\u548cKibana\u3002 \u5982\u679c\u4f60\u7684\u73af\u5883\u4e2d\u5df2\u7ecf\u6709Elasticsearch\u548cKibana\uff0c\u8fd9\u4e00\u6b65\u53ef\u4ee5\u5ffd\u7565\u3002 \u5982\u679c\u5e0c\u671b\u81ea\u5df1\u642d\u5efa\u4e00\u5957Elasticsearch\u548cKibana\u8bd5\u7528\uff0c\u8fd9\u91cc\u5efa\u8bae\uff1a

    \u5982\u679c\u672c\u5730\u6ca1\u6709helm\u5ba2\u6237\u7aef\uff0c\u9700\u8981\u4e0b\u8f7dhelm\u3002

    \u4f7f\u7528\u5982\u4e0b\u547d\u4ee4:

    helm repo add elastic https://helm.elastic.co\nhelm install elasticsearch elastic/elasticsearch --set replicas=1\nhelm install kibana elastic/kibana\n

    \u901a\u8fc7\uff1a

    kubectl port-forward service/kibana-kibana 5601:http\n

    \u53ef\u4ee5\u76f4\u63a5\u5728\u6d4f\u89c8\u5668\u8f93\u5165localhost:5601\uff0c\u8bbf\u95eeKibana\u9875\u9762\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#_4","title":"\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7","text":""},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#sink","title":"\u521b\u5efasink","text":"

    \u4e3a\u4e86\u8868\u660e\u6211\u4eec\u5373\u5c06\u91c7\u96c6\u65e5\u5fd7\u53d1\u9001\u5230\u7684Elasticsearch\uff0c\u9700\u8981\u914d\u7f6e\u5bf9\u5e94\u7684Sink\u3002 \u8fd9\u91cc\u6709\u4e24\u79cd\u65b9\u5f0f\uff1a

    1. \u5982\u679c\u6574\u4e2a\u96c6\u7fa4\u53ea\u4f1a\u6709\u4e00\u4e2a\u5b58\u50a8\u540e\u7aef\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u5168\u5c40\u7684\u914d\u7f6e\u6587\u4ef6configMap\u91cc\uff0c\u914d\u7f6edefaults\u53c2\u6570\uff0c\u5177\u4f53\u53ef\u53c2\u8003\u3002

    2. \u4f7f\u7528Sink CRD\uff0c\u5e76\u5728logConfig\u4e2d\u5f15\u7528\u3002\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u6269\u5c55\u4e3a\u591a\u4e2a\u540e\u7aef\uff0c\u4e0d\u540c\u7684logConfig\u53ef\u4ee5\u914d\u7f6e\u4f7f\u7528\u4e0d\u540c\u7684\u540e\u7aef\u5b58\u50a8\uff0c\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u5efa\u8bae\u4f7f\u7528\u8be5\u65b9\u5f0f\u3002

    \u521b\u5efa\u4e00\u4e2aSink\u5982\u4e0b\uff0cSink\u4e3a\u96c6\u7fa4\u7ea7\u522bCRD\u3002\u53ef\u4ee5\u5728spec.sink\u4e2d\u4fee\u6539\u4e3a\u5176\u4ed6\u914d\u7f6e\u3002

    Example

    cat << EOF | kubectl apply -f -\napiVersion: loggie.io/v1beta1\nkind: Sink\nmetadata:\nname: default\nspec:\nsink: |\ntype: elasticsearch\nindex: \"loggie\"\nhosts: [\"elasticsearch-master.default.svc:9200\"]\nEOF\n

    \u53ef\u4ee5\u901a\u8fc7kubectl get sink default\u67e5\u770b\u662f\u5426\u521b\u5efa\u6210\u529f\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#interceptor","title":"\u521b\u5efainterceptor(\u53ef\u9009)","text":"

    \u548cSink\u4e00\u6837\uff0c\u914d\u7f6einterceptor\u6709\u4e24\u79cd\u65b9\u5f0f\uff1a

    1. \u5728\u5168\u5c40\u914d\u7f6e\u6587\u4ef6configMap\u4e2d\uff0c\u914d\u7f6edefaults\u53c2\u6570\u3002\u6b64\u65f6\u610f\u5473\u7740\u6240\u6709\u7684Loggie Agent\u90fd\u4f7f\u7528\u8be5default interceptors\u914d\u7f6e\u3002

    2. \u4f7f\u7528Interceptor CRD\uff0c\u5e76\u5728logConfig\u4e2d\u88ab\u5f15\u7528\u3002\u8fd9\u79cd\u65b9\u5f0f\u4f1a\u66f4\u52a0\u7075\u6d3b\uff0c\u9002\u5408\u6709\u4e00\u5b9a\u8fd0\u7ef4\u548c\u529f\u80fd\u9700\u6c42\u7684\u573a\u666f\u3002

    Loggie\u76ee\u524d\u9ed8\u8ba4\u5185\u7f6e\u4e86metric\uff08\u76d1\u63a7\u6307\u6807\u53d1\u9001\uff09\u3001 maxbytes\uff08\u6700\u5927event\u5b57\u8282\u6570\u9650\u5236\uff09\u3001 retry\uff08\u91cd\u8bd5\uff09\u4e09\u4e2ainterceptors\u3002\u5373\u4f7f\u6211\u4eec\u6ca1\u6709\u4f7f\u7528\u4ee5\u4e0a\u4e24\u79cd\u65b9\u5f0f\u914d\u7f6e\uff0c\u4ecd\u7136\u4f1a\u81ea\u52a8\u4f7f\u7528\u8fd93\u4e2a\u9ed8\u8ba4interceptor\uff0c\u6240\u4ee5interceptor\u5176\u5b9e\u662f\u53ef\u9009\u9879\u3002

    Caution

    \u521b\u5efa\u4e00\u4e2ainterceptor\u793a\u4f8b\u5982\u4e0b\uff1a

    Example

    cat << EOF | kubectl apply -f -\napiVersion: loggie.io/v1beta1\nkind: Interceptor\nmetadata:\nname: default\nspec:\ninterceptors: |\n- type: rateLimit\nqps: 90000\nEOF\n

    \u8fd9\u91cc\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2arateLimit interceptor\uff0c\u53ef\u7528\u4e8e\u91c7\u96c6\u53d1\u9001\u65e5\u5fd7\u7684\u9650\u6d41\u3002 \u53ef\u4ee5\u901a\u8fc7kubectl get interceptor default\u6216\u8005kubectl get icp default\u67e5\u770b\u662f\u5426\u521b\u5efa\u6210\u529f\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#logconfig","title":"\u521b\u5efalogConfig","text":"

    \u521b\u5efa\u5b8csink\u548cinterceptor\u540e\uff0c\u6700\u91cd\u8981\u7684\u4fbf\u662f\u521b\u5efalogConfig\uff0c\u8868\u660e\u6211\u4eec\u5e0c\u671b\u91c7\u96c6\u54ea\u4e9bPod\u7684\u65e5\u5fd7\uff0c\u4ee5\u53ca\u91c7\u96c6Pod\u7684\u54ea\u4e9b\u65e5\u5fd7\u3002

    logConfig\u91ccspec.selector\u90e8\u5206\u8868\u793a\u65e5\u5fd7\u914d\u7f6e\u7684\u4e0b\u53d1\u8303\u56f4\uff0c\u5bf9\u91c7\u96c6Pod\u65e5\u5fd7\u6765\u8bf4\uff0c\u9700\u8981\u914d\u7f6etype: pod\uff0c\u5e76\u4e14\u4f7f\u7528labelSelector\u9009\u62e9\u6307\u5b9a\u7684Pods\uff0c\u5373\u91c7\u96c6\u8fd9\u4e9bPods\u7684\u65e5\u5fd7\u3002 \u793a\u4f8b\u5982\u4e0b\uff1a

    spec:\nselector:\ntype: pod\nlabelSelector:\napp: tomcat\n

    \u53e6\u5916\uff0c\u6211\u4eec\u9700\u8981\u5728pipeline.sources\u4e2d\u914d\u7f6efile source\uff0c\u5373\u91c7\u96c6Pods\u7684\u54ea\u4e9b\u65e5\u5fd7\u3002

      pipeline:\nsources: |\n- type: file\nname: mylog\npaths:\n- stdout\n- /var/log/*.log\n
    \u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a

    \u6700\u540e\uff0c\u6211\u4eec\u4f7f\u7528sinkRef\u548cinterceptorRef\u5f15\u7528\u4e0a\u9762\u521b\u5efa\u7684sink\u548cinterceptor\u3002 \u6700\u7ec8\u521b\u5efa\u4e00\u4e2alogConfig\u793a\u4f8b\u5982\u4e0b\uff1a

    Example

    cat << EOF | kubectl apply -f -\napiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: tomcat\nnamespace: default\nspec:\nselector:\ntype: pod\nlabelSelector:\napp: tomcat\npipeline:\nsources: |\n- type: file\nname: common\npaths:\n- stdout\n- /usr/local/tomcat/logs/*.log\nsinkRef: default\ninterceptorRef: default\nEOF\n

    \u6211\u4eec\u53ef\u4ee5\u901a\u8fc7kubectl get logconfig tomcat\u6216\u8005kubectl get lgc tomcat\u6765\u67e5\u770b\u662f\u5426\u521b\u5efa\u6210\u529f\u3002 \u540c\u65f6\u53ef\u4ee5\u901a\u8fc7kubectl describe lgc tomcat\u67e5\u770blogConfig\u7684events\uff0c\u7528\u4e8e\u6392\u67e5\u72b6\u6001\u3002 \u5982\u679c\u6709\u4ee5\u4e0b\u7c7b\u4f3c\u7684events\uff0c\u8bf4\u660e\u914d\u7f6e\u5df2\u7ecf\u4e0b\u53d1\u6210\u529f\u3002

    Events:\n  Type    Reason       Age   From                       Message\n  ----    ------       ----  ----                       -------\n  Normal  syncSuccess  55s   loggie/kind-control-plane  Sync type pod [tomcat-684c698b66-hvztn] success\n

    \u6211\u4eec\u8fd8\u53ef\u4ee5\u901a\u8fc7kubectl -nloggie logs -f ${loggie-name}\u6765\u67e5\u770b\u6307\u5b9a\u8282\u70b9Loggie\u7684\u65e5\u5fd7\u6765\u5224\u65ad\u65e5\u5fd7\u91c7\u96c6\u60c5\u51b5\u3002

    \u53d1\u9001\u6210\u529f\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Kibana\u4e0a\u67e5\u8be2\u5230\u91c7\u96c6\u5230\u7684\u65e5\u5fd7\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#_5","title":"\u81ea\u52a8\u89e3\u6790\u5bb9\u5668\u6807\u51c6\u8f93\u51fa\u539f\u59cb\u65e5\u5fd7","text":"

    \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u91c7\u96c6\u5230\u7684\u6807\u51c6\u8f93\u51fa\u5e76\u4e0d\u662f\u6253\u5370\u7684\u65e5\u5fd7\u5185\u5bb9\uff0c\u800c\u662f\u88ab\u5bb9\u5668\u8fd0\u884c\u65f6\u589e\u52a0\u4e86\u4e00\u5c42\u5c01\u88c5\u3002

    \u4f8b\u5982docker\u7684\u6807\u51c6\u8f93\u51fa\u4e3ajson\u5f62\u5f0f\uff1a

    {\"log\":\"I0610 08:29:07.698664 Waiting for caches to sync\\n\", \"stream\":\"stderr\", \"time:\"2021-06-10T08:29:07.698731204Z\"}\n
    \u4e1a\u52a1\u6253\u5370\u7684\u539f\u59cb\u65e5\u5fd7\u5185\u5bb9\u5b58\u50a8\u5728log\u5b57\u6bb5\u91cc\u3002

    containerd\u7684\u6807\u51c6\u8f93\u51fa\u5f62\u5f0f\u7c7b\u4f3c\u5982\u4e0b\uff1a

    2021-12-01T03:13:58.298476921Z stderr F INFO [main] Starting service [Catalina]\n
    \u524d\u97622021-12-01T03:13:58.298476921Z stderr F\u4e3a\u8fd0\u884c\u65f6\u589e\u52a0\u7684\u524d\u7f00\u5185\u5bb9\uff0c\u540e\u9762\u5219\u4e3a\u539f\u59cb\u7684\u65e5\u5fd7\u3002

    \u7279\u522b\u662f\u5982\u679c\u6211\u4eec\u914d\u7f6e\u4e86\u65e5\u5fd7\u91c7\u96c6\u591a\u884c\u914d\u7f6e\uff0c\u56e0\u4e3a\u91c7\u96c6\u5230\u7684\u65e5\u5fd7\u5185\u5bb9\u548c\u4e1a\u52a1\u8f93\u51fa\u7684\u65e5\u5fd7\u4e0d\u4e00\u81f4\uff0c\u4f1a\u5bfc\u81f4\u91c7\u96c6\u6807\u51c6\u8f93\u51fa\u65e5\u5fd7\u5339\u914d\u591a\u884c\u6709\u95ee\u9898\u3002

    \u6240\u4ee5\uff0cLoggie\u63d0\u4f9b\u4e86\u4e00\u952e\u5f00\u5173\u914d\u7f6e\uff0c\u5728\u7cfb\u7edf\u914d\u7f6e\u4e2d\uff0c\u5c06parseStdout\u53c2\u6570\u8bbe\u7f6e\u4e3atrue\u5373\u53ef\u3002

    parseStdout

    config:\nloggie:\ndiscovery:\nenabled: true\nkubernetes:\nparseStdout: true\n

    Loggie\u4f1a\u5728\u6e32\u67d3LogConfig\u7684\u65f6\u5019\u81ea\u52a8\u589e\u52a0source codec\u89e3\u6790\u51fa\u539f\u59cb\u7684\u4e1a\u52a1\u65e5\u5fd7\u3002

    \u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#volume","title":"\u65e0\u9700\u6302\u8f7dvolume\u7684\u5bb9\u5668\u65e5\u5fd7\u91c7\u96c6","text":"

    \u867d\u7136\u6211\u4eec\u5efa\u8bae\u4f7f\u7528\u6302\u8f7dvolume(emptyDir/hostPath+subPathExpr)\u7684\u65b9\u5f0f\u5c06\u65e5\u5fd7\u6587\u4ef6\u6302\u51fa\u7ed9Loggie\u91c7\u96c6\uff0c\u4f46\u4ecd\u7136\u5b58\u5728\u5f88\u591a\u60c5\u51b5\u6211\u4eec\u6ca1\u529e\u6cd5\u5c06\u4e1a\u52a1\u7684Pod\u7edf\u4e00\u6302\u8f7d\u51fa\u65e5\u5fd7\u8def\u5f84\u3002 \u6bd4\u5982\u4e00\u4e9b\u57fa\u7840\u7ec4\u4ef6\u65e0\u6cd5\u914d\u7f6e\u72ec\u7acb\u7684\u65e5\u5fd7volume\uff0c\u6216\u8005\u4e1a\u52a1\u5355\u7eaf\u7684\u4e0d\u613f\u610f\u6539\u90e8\u7f72\u914d\u7f6e\u3002

    Loggie\u63d0\u4f9b\u4e86\u65e0\u9700\u6302\u8f7d\u5373\u53ef\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\u7684\u80fd\u529b\uff0c\u53ef\u81ea\u52a8\u8bc6\u522b\u5e76\u91c7\u96c6\u5bb9\u5668root filesystem\u91cc\u7684\u65e5\u5fd7\u6587\u4ef6\u3002

    \u4f60\u53ea\u9700\u8981\u5c06\u90e8\u7f72\u7684helm chart\u4e2dvalues.yml\u91cc\u7684\u914d\u7f6erootFsCollectionEnabled\u8bbe\u7f6e\u4e3atrue\uff0c \u540c\u65f6\u586b\u4e0a\u5b9e\u9645\u73af\u5883\u7684\u5bb9\u5668\u8fd0\u884c\u65f6\uff08docker/containerd\uff09\uff0c\u5982\u4e0b\u6240\u793a\uff1a

    rootFsCollectionEnabled

    config:\nloggie:\ndiscovery:\nenabled: true\nkubernetes:\ncontainerRuntime: containerd\nrootFsCollectionEnabled: false\n

    \u4fee\u6539\u5b8c\u6210\u540e\uff0c\u91cd\u65b0helm upgrade\u5373\u53ef\u3002 helm\u6a21\u7248\u4f1a\u81ea\u52a8\u6e32\u67d3\u589e\u52a0\u989d\u5916\u7684\u4e00\u4e9b\u6302\u8f7d\u8def\u5f84\u548c\u914d\u7f6e\uff0c\u5982\u679c\u4f60\u4ece\u4f4e\u7248\u672c\u5347\u7ea7\uff0c\u9700\u8981\u989d\u5916\u4fee\u6539\u90e8\u7f72\u7684Daemonset yaml\u3002 \u5177\u4f53\u539f\u7406\u8bf7\u53c2\u8003issues #208\u3002

    \u8bf7\u6ce8\u610f\uff1a - containerd\u8fd0\u884c\u65f6\u4e0b\u7684\u65e0\u6302\u8f7dvolume\u7684\u5bb9\u5668\u65e5\u5fd7\u91c7\u96c6\u6682\u672a\u5927\u89c4\u6a21\u751f\u4ea7\u8fd0\u884c\u8fc7\uff0c\u8bf7\u8c28\u614e\u4f7f\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-node-logs/","title":"\u4f7f\u7528Loggie\u91c7\u96c6Node\u8282\u70b9\u65e5\u5fd7","text":"

    \u5728Kubernetes\u96c6\u7fa4\u4e2d\uff0c\u9664\u4e86\u91c7\u96c6Pod\u91cc\u7684\u65e5\u5fd7\uff0c\u8fd8\u53ef\u80fd\u6709\u91c7\u96c6Node\u8282\u70b9\u4e0a\u7684\u4e00\u4e9b\u8bf8\u5982kubelet\u65e5\u5fd7\u3001\u7cfb\u7edf\u65e5\u5fd7\u7b49\u9700\u6c42\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-node-logs/#_1","title":"\u914d\u7f6e\u8bf4\u660e","text":"

    \u548c\u91c7\u96c6\u5bb9\u5668\u4e0d\u540c\u7684\u662f\uff0c\u8282\u70b9\u65e5\u5fd7\u91c7\u96c6\u9700\u4f7f\u7528\u96c6\u7fa4\u7ea7\u522b\u7684ClusterLogConfig\uff0cselector\u4f7f\u7528type: node\uff0c\u5e76\u4e14\u586b\u5199nodeSelector\u7528\u4e8e\u9009\u62e9\u4e0b\u53d1\u914d\u7f6e\u5230\u54ea\u4e9b\u8282\u70b9\uff0c\u540c\u65f6\u9700\u786e\u4fddNode\u4e0a\u5305\u542b\u8fd9\u4e9blabels\u3002

    \u793a\u4f8b\u5982\u4e0b\uff1a

    Example

    apiVersion: loggie.io/v1beta1\nkind: ClusterLogConfig\nmetadata:\nname: varlog\nspec:\nselector:\ntype: node\nnodeSelector:\nnodepool: demo\npipeline:\nsources: |\n- type: file\nname: varlog\npaths:\n- /var/log/*.log\nsinkRef: default\ninterceptorRef: default\n

    \u53e6\u5916\u5e94\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u9700\u8981\u91c7\u96c6Node\u8282\u70b9\u4e0a\u67d0\u8def\u5f84\u7684\u65e5\u5fd7\uff0c\u9700\u8981Loggie\u540c\u6837\u6302\u8f7d\u76f8\u540c\u7684\u8def\u5f84\uff0c\u5426\u5219\u7531\u4e8e\u5bb9\u5668\u9694\u79bb\u6027Loggie\u65e0\u6cd5\u83b7\u53d6\u5230\u8282\u70b9\u7684\u65e5\u5fd7\u3002 \u6bd4\u5982\u91c7\u96c6Node\u4e0a/var/log/\u8def\u5f84\u4e0b\u7684\u65e5\u5fd7\uff0c\u9700\u8981Loggie Agent\u589e\u52a0\u6302\u8f7d\u8be5\u8def\u5f84\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/","title":"Kubernetes\u4e0b\u7684\u65e5\u5fd7\u91c7\u96c6","text":"

    Cite

    \u76f8\u6bd4\u4f20\u7edf\u7684\u4e3b\u673a\u65e5\u5fd7\u91c7\u96c6\uff0c\u5728Kubernetes\u96c6\u7fa4\u4e2d\uff0c\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\u6709\u4e00\u4e9b\u5dee\u5f02\uff0c\u4f7f\u7528\u65b9\u5f0f\u4e0a\u4e5f\u6709\u6240\u533a\u522b\u3002 \u8fd9\u91cc\u6211\u4eec\u7f57\u5217\u4e86\u4e00\u4e9b\u5e38\u89c4\u7684\u90e8\u7f72\u548c\u4f7f\u7528\u65b9\u5f0f\u4ee5\u4f9b\u53c2\u8003\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#1","title":"1. \u4ece\u4e3b\u673a\u5230\u5bb9\u5668","text":"

    \u5728\u4f20\u7edf\u7684\u4f7f\u7528\u865a\u62df\u673a/\u4e91\u4e3b\u673a/\u7269\u7406\u673a\u7684\u65f6\u4ee3\uff0c\u4e1a\u52a1\u8fdb\u7a0b\u90e8\u7f72\u5728\u56fa\u5b9a\u7684\u8282\u70b9\u4e0a\uff0c\u4e1a\u52a1\u65e5\u5fd7\u76f4\u63a5\u8f93\u51fa\u5230\u5bbf\u4e3b\u673a\u4e0a\uff0c\u8fd0\u7ef4\u53ea\u9700\u8981\u624b\u52a8\u6216\u8005\u4f7f\u7528\u81ea\u52a8\u5316\u5de5\u5177\u628a\u65e5\u5fd7\u91c7\u96c6Agent\u90e8\u7f72\u5728\u8282\u70b9\u4e0a\uff0c\u52a0\u4e00\u4e0bAgent\u7684\u914d\u7f6e\uff0c\u5c31\u53ef\u4ee5\u5f00\u59cb\u91c7\u96c6\u65e5\u5fd7\u4e86\u3002

    \u800c\u5728Kubernetes\u73af\u5883\u4e2d\uff0c\u60c5\u51b5\u5c31\u6ca1\u8fd9\u4e48\u7b80\u5355\u4e86\uff1a

    \u4ee5\u4e0a\u90fd\u662f\u6709\u522b\u4e8e\u4f20\u7edf\u65e5\u5fd7\u91c7\u96c6\u914d\u7f6e\u65b9\u5f0f\u7684\u9700\u6c42\u548c\u75db\u70b9\uff0c\u7a76\u5176\u539f\u56e0\uff0c\u8fd8\u662f\u56e0\u4e3a\u4f20\u7edf\u7684\u65b9\u5f0f\u8131\u79bb\u4e86Kubernetes\uff0c\u65e0\u6cd5\u611f\u77e5Kubernetes\uff0c\u65e0\u6cd5\u548cKubernetes\u96c6\u6210\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#2-kubernetes","title":"2. \u5728Kubernetes\u4e0b\u7684\u65e5\u5fd7\u5f62\u6001","text":"

    \u4e3a\u4e86\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff0c\u6211\u4eec\u5148\u6765\u770b\u4e00\u4e0b\u5e02\u9762\u4e0a\u4e00\u822c\u90fd\u6709\u54ea\u4e9b\u89e3\u51b3\u65b9\u6848\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#21","title":"2.1 \u91c7\u96c6\u7684\u65e5\u5fd7\u7c7b\u578b","text":"

    \u9996\u5148\uff0c\u9700\u8981\u63d0\u53ca\u7684\u662f\uff0c\u5728\u4e91\u539f\u751f\u768412\u8981\u7d20\u91cc\uff0c\u63a8\u8350\u4e1a\u52a1\u5bb9\u5668\u5c06\u65e5\u5fd7\u8f93\u51fa\u5230stdout\u4e2d\uff0c\u800c\u4e0d\u662f\u91c7\u7528\u6253\u5370\u65e5\u5fd7\u6587\u4ef6\u7684\u65b9\u5f0f\u3002\u5f53\u7136\uff0c\u5b9e\u9645\u60c5\u51b5\u662f\uff0c\u6211\u4eec\u5f88\u96be\u8fd9\u4e48\u505a\uff0c\u539f\u56e0\u5927\u6982\u6709\uff1a

    \u6240\u4ee5\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u9700\u8981\u540c\u65f6\u91c7\u96c6\uff1a

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#22-agent","title":"2.2 Agent\u90e8\u7f72\u65b9\u5f0f","text":"

    \u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff0cAgent\u6709\u4e24\u79cd\u90e8\u7f72\u65b9\u5f0f\uff1a

    1. DaemonSet\uff1a\u6bcf\u4e2a\u8282\u70b9\u90e8\u7f72\u4e00\u4e2aAgent
    2. Sidecar\uff1a\u6bcf\u4e2aPod\u589e\u52a0\u4e00\u4e2aSidecar\u5bb9\u5668\uff0c\u8fd0\u884c\u65e5\u5fd7Agent

    \u4e24\u79cd\u90e8\u7f72\u65b9\u5f0f\u7684\u4f18\u52a3\u90fd\u663e\u800c\u6613\u89c1\uff1a

    Tip

    \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u4f18\u5148\u4f7f\u7528DaemonSet\u7684\u65b9\u5f0f\u91c7\u96c6\u65e5\u5fd7\uff0c\u5982\u679c\u5355\u4e2aPod\u65e5\u5fd7\u91cf\u7279\u522b\u5927\uff0c\u8d85\u8fc7\u4e00\u822cAgent\u53d1\u9001\u541e\u5410\u91cf\uff0c\u53ef\u4ee5\u5355\u72ec\u5bf9\u8be5Pod\u4f7f\u7528Sidecar\u7684\u65b9\u5f0f\u91c7\u96c6\u65e5\u5fd7\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#23","title":"2.3 \u91c7\u96c6\u65b9\u5f0f","text":""},{"location":"user-guide/use-in-kubernetes/general-usage/#daemonset-stdout","title":"DaemonSet + Stdout","text":"

    \u5982\u679c\u4f7f\u7528\u5bb9\u5668\u8fd0\u884c\u65f6\u7684\u662fdocker\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\u6211\u4eec\u53ef\u4ee5\u5728\u8282\u70b9\u7684docker\u8def\u5f84\u4e2d\u627e\u5230\u5bb9\u5668\u7684stdout\u7684\u65e5\u5fd7\uff0c\u9ed8\u8ba4\u4e3a/var/lib/docker/containers/{containerId}/{containerId}-json.log\u3002

    \u5728Kubernetes 1.14\u7248\u672c\u4e4b\u524d\uff0ckubelet\u4f1a\u5728/var/log/pods/<podUID>/<containerName>/<num>.log\u5efa\u7acb\u4e00\u4e2a\u8f6f\u94fe\u63a5\u5230stdout\u6587\u4ef6\u4e2d\u3002

    \u7c7b\u4f3c\u5982\u4e0b\u6240\u793a\uff1a

    root@master0:/var/log/pods# tree .\n|-- 6687e53201c01e3fad31e7d72fbb92a6\n|   `-- kube-apiserver\n|       |-- 865.log -> /var/lib/docker/containers/3a35ae0a1d0b26455fbd9b267cd9d6ac3fbd3f0b12ee03b4b22b80dc5a1cde03/3a35ae0a1d0b26455fbd9b267cd9d6ac3fbd3f0b12ee03b4b22b80dc5a1cde03-json.log\n|       `-- 866.log -> /var/lib/docker/containers/15a6924f14fcbf15dd37d1c185c5b95154fa2c5f3de9513204b1066bbe474662/15a6924f14fcbf15dd37d1c185c5b95154fa2c5f3de9513204b1066bbe474662-json.log\n|-- a1083c6d-3b12-11ea-9af1-fa163e28f309\n|   `-- kube-proxy\n|       |-- 3.log -> /var/lib/docker/containers/4b63b5a90a8f9ca6b6f20b49b5ab2564f92df21a5590f46de2a46b031e55c80e/4b63b5a90a8f9ca6b6f20b49b5ab2564f92df21a5590f46de2a46b031e55c80e-json.log\n|       `-- 4.log -> /var/lib/docker/containers/fc7c315d33935887ca3479a38cfca4cca66fad782b8a120c548ad0b9f0ff7207/fc7c315d33935887ca3479a38cfca4cca66fad782b8a120c548ad0b9f0ff7207-json.log\n

    \u5728Kubernetes 1.14\u7248\u672c\u4e4b\u540e\uff0c\u6539\u6210\u4e86/var/log/pods/<namespace>_<pod_name>_<pod_id>/<container_name>/<num>.log\u7684\u5f62\u5f0f\u3002

    root@master-0:/var/log/pods# tree .\n|-- kube-system_kube-apiserver-kind-control-plane_bd1c21fe1f0ef615e0b5e41299f1be61\n|   `-- kube-apiserver\n|       `-- 0.log\n|-- kube-system_kube-proxy-gcrfq_f07260b8-6055-4c19-9491-4a825579528f\n|   `-- kube-proxy\n|       `-- 0.log\n`-- loggie_loggie-csd4g_f1cc32e9-1002-4e64-bd58-fc6094394e06\n    `-- loggie\n        `-- 0.log\n

    \u6240\u4ee5\uff0c\u5bf9\u4e8eAgent\u91c7\u96c6\u6807\u51c6\u8f93\u51fa\u65e5\u5fd7\u6765\u8bf4\uff0c\u4e5f\u5c31\u662f\u91c7\u96c6\u8282\u70b9\u4e0a\u7684\u8fd9\u4e9b\u65e5\u5fd7\u6587\u4ef6\u3002

    \u4e00\u79cd\u7b80\u5355\u7c97\u66b4\u7684\u91c7\u96c6\u65b9\u5f0f\u662f\uff0c\u4f7f\u7528DaemonSet\u90e8\u7f72\u65e5\u5fd7Agent\uff0c\u6302\u8f7d/var/log/pods\u76ee\u5f55\uff0cAgent\u7684\u914d\u7f6e\u6587\u4ef6\u4f7f\u7528\u7c7b\u4f3c/var/log/pod/*/*.log\u53bb\u901a\u914d\u65e5\u5fd7\u6587\u4ef6\uff0c\u91c7\u96c6\u8282\u70b9\u4e0a\u6240\u6709\u7684\u5bb9\u5668\u6807\u51c6\u8f93\u51fa\u3002

    \u4f46\u662f\u8fd9\u6837\u7684\u5c40\u9650\u5728\u4e8e\uff1a

    \u5f53\u7136\u73b0\u5728\u7684\u4e00\u4e9b\u65e5\u5fd7Agent\u6bd4\u5982Filebeat/Fluentd\u90fd\u9488\u5bf9\u6027\u7684\u505a\u4e86\u652f\u6301\uff0c\u6bd4\u5982\u53ef\u4ee5\u5c06namespace/pod\u7b49\u4fe1\u606f\u6ce8\u5165\u65e5\u5fd7\u4e2d\uff0c\u4f46\u4ecd\u7136\u6ca1\u6709\u89e3\u51b3\u5927\u90e8\u5206\u7684\u95ee\u9898\u3002

    \u6240\u4ee5\uff0c\u8fd9\u79cd\u65b9\u5f0f\u53ea\u9002\u5408\u7b80\u5355\u7684\u4e1a\u52a1\u573a\u666f\uff0c\u540e\u7eed\u4e5f\u96be\u4ee5\u6ee1\u8db3\u5176\u4ed6\u66f4\u591a\u7684\u65e5\u5fd7\u9700\u6c42\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#daemonset","title":"DaemonSet + \u65e5\u5fd7\u6587\u4ef6","text":"

    \u5982\u679cPod\u91cc\u4e0d\u4ec5\u4ec5\u662f\u8f93\u51fastdout\uff0c\u8fd8\u5305\u62ec\u65e5\u5fd7\u6587\u4ef6\uff0c\u5c31\u9700\u8981\u8003\u8651\u5230\u6302\u8f7d\u65e5\u5fd7\u6587\u4ef6\u5230\u8282\u70b9\u4e0a\uff0c\u540c\u65f6\u91c7\u7528DaemonSet\u90e8\u7f72\u7684Agent\u4e5f\u9700\u8981\u6302\u8f7d\u76f8\u540c\u7684\u76ee\u5f55\uff0c\u5426\u5219\u91c7\u7528\u5bb9\u5668\u5316\u90e8\u7f72\u7684Agent\u65e0\u6cd5\u67e5\u770b\u5230\u76f8\u5e94\u7684\u6587\u4ef6\uff0c\u66f4\u65e0\u6cd5\u91c7\u96c6\u3002

    \u4e1a\u52a1Pod\u6302\u8f7d\u65e5\u5fd7\u8def\u5f84\u7684\u65b9\u5f0f\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a

    (1) emtpyDir

    emtpyDir\u7684\u751f\u547d\u5468\u671f\u8ddf\u968fPod\uff0cPod\u9500\u6bc1\u540e\u5176\u4e2d\u5b58\u50a8\u7684\u65e5\u5fd7\u4e5f\u4f1a\u6d88\u5931\u3002

    \u4f7f\u7528emptyDir\u6302\u8f7d\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u4e00\u822c\u5728\u8282\u70b9\u7684\u8def\u5f84\u5982\u4e0b\uff1a

    /var/lib/kubelet/pods/${pod.UID}/volumes/kubernetes.io~empty-dir/${volumeName}\n

    (2) hostPath

    \u751f\u547d\u5468\u671f\u548cPod\u65e0\u5173\uff0cPod\u8fc1\u79fb\u6216\u8005\u9500\u6bc1\uff0c\u65e5\u5fd7\u6587\u4ef6\u8fd8\u4fdd\u7559\u5728\u73b0\u6709\u78c1\u76d8\u4e0a\u3002

    \u4e3a\u4e86\u89e3\u51b3\u9694\u79bb\u6027\uff0c\u907f\u514d\u591a\u4e2aPod\u6253\u5370\u65e5\u5fd7\u5230\u76f8\u540c\u7684\u8def\u5f84\u548c\u6587\u4ef6\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528 subPathExpr \u5b57\u6bb5\u4ece Downward API \u73af\u5883\u53d8\u91cf\u6784\u9020 subPath \u76ee\u5f55\u540d\u3002 \u8be5 VolumeSubpathEnvExpansion \u529f\u80fd\u4ece Kubernetes1.15 \u5f00\u59cb\u9ed8\u8ba4\u5f00\u542f\uff0c\u57281.17 GA\u3002\u53ef\u53c2\u8003 feature-gates \u548c using-subpath-expanded-environment\u3002

    \u4f7f\u7528subPathExpr\u7684\u793a\u4f8b\u5982\u4e0b\u6240\u793a\uff1a

    apiVersion: apps/v1\nkind: Deployment\nmetadata:\nlabels:\napp: nginx\nname: nginx\nnamespace: default\nspec:\nselector:\nmatchLabels:\napp: nginx\ntemplate:\nmetadata:\nlabels:\napp: nginx\nspec:\ncontainers:\n- env:\n- name: POD_NAME\nvalueFrom:\nfieldRef:\napiVersion: v1\nfieldPath: metadata.name\n- name: NAMESPACE\nvalueFrom:\nfieldRef:\napiVersion: v1\nfieldPath: metadata.namespace\nimage: nginx\nname: nginx\nresources: {}\nvolumeMounts:\n- mountPath: /data/log\nname: datalog\nsubPathExpr: $(NAMESPACE)/$(POD_NAME)\nvolumes:\n- hostPath:\npath: /data/log\ntype: \"\"\nname: datalog\n

    \u5728\u521b\u5efa\u5b8c\u4e4b\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u6240\u5728\u8282\u70b9\u7684/data/log\u4e0b\u53d1\u73b0\u7c7b\u4f3c\u7684\u76ee\u5f55\u7ed3\u6784\uff1a

    .\n`-- default\n    |-- nginx-888dc6778-krfqr\n    `-- nginx-888dc6778-sw8vd\n
    \u6bcf\u4e2aPod\u7684\u5b58\u653e\u7684\u65e5\u5fd7\u6587\u4ef6\u5373\u5728\u8282\u70b9\u7684/data/log/$(NAMESPACE)/$(POD_NAME)\u8def\u5f84\u4e0b\u3002

    (3) Pv Pv\u7684\u8bbf\u95ee\u6a21\u5f0f\u5305\u62ec\uff1a

    \u5bf9\u4e8e\u5927\u90e8\u5206\u7684\u4e1a\u52a1\u6765\u8bf4\uff0c\u90fd\u662fDeployment\u65e0\u72b6\u6001\u90e8\u7f72\uff0c\u9700\u8981\u6302\u8f7d\u540c\u4e00\u4e2aPv\u5171\u4eab\uff1b\u5bf9\u4e8e\u4e00\u4e9b\u4e2d\u95f4\u4ef6\u7b49\u6709\u72b6\u6001\u670d\u52a1\uff0c\u4e00\u822c\u4f1a\u4f7f\u7528StatefulSet\u90e8\u7f72\uff0c\u6bcf\u4e2aPod\u4f1a\u4f7f\u7528\u72ec\u7acb\u7684Pv\u3002

    \u867d\u7136\u540c\u6837\u53ef\u4ee5\u5728Node\u4e0a\u627e\u5230\u4f7f\u7528Pv\u6302\u8f7d\u7684\u5bf9\u5e94\u65e5\u5fd7\u6587\u4ef6\uff0c\u4f46\u662fPv\u6839\u636e\u4e0d\u540c\u7684\u5e95\u5c42\u5b9e\u73b0\uff0c\u5728Node\u4e0a\u7684\u8def\u5f84\u4f1a\u6709\u4e00\u5b9a\u7684\u533a\u522b\u3002

    \u76ee\u524d\u5e02\u9762\u4e0a\u5927\u90e8\u5206\u65e5\u5fd7Agent\u5747\u5bf9\u8fd9\u4e9b\u6302\u8f7d\u65b9\u5f0f\u6ca1\u6709\u611f\u77e5\uff0c\u6240\u4ee5\u4f60\u80fd\u505a\u7684\u548c\u4e0a\u9762\u4f7f\u7528stdout\u7684\u65b9\u5f0f\u7c7b\u4f3c\uff0c\u4e5f\u5c31\u662f\u7b80\u5355\u7c97\u66b4\u7684\u8ba9Agent\u5c06\u8def\u5f84\u90fd\u6302\u8f7d\uff0c\u4f7f\u7528\u901a\u914d\u7684\u65b9\u5f0f\u91c7\u96c6\u6240\u6709\u7684\u65e5\u5fd7\uff0c\u4f7f\u7528\u4e0a\u7684\u5c40\u9650\u548cstdout\u7684\u65b9\u5f0f\u540c\u6837\u4e00\u81f4\u3002

    \u53e6\u5916\uff0c\u9274\u4e8e\u4e00\u4e9bAgent\u5bf9\u91c7\u96c6docker stdout\u6709\u4e00\u5b9a\u7684\u652f\u6301\uff0c\u6240\u4ee5\u8fd8\u5b58\u5728\u4e00\u4e9b\u4f7f\u7528\u4e0a\u53d8\u79cd\uff0c\u6bd4\u5982\u5229\u7528webhook\u6ce8\u5165\u4e00\u4e2asidecar\uff0c\u8bfb\u53d6Pod\u91cc\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u8f6c\u6362\u6210sidecar\u7684stdout\uff0c\u7136\u540e\u91c7\u96c6sidecar\u7684stdout\u65e5\u5fd7\uff0c\u8fd9\u91cc\u4e0d\u518d\u8be6\u8ff0\u3002

    \uff084\uff09\u4e0d\u6302\u8f7d

    \u5f88\u591a\u60c5\u51b5\u4e0b\uff0c\u7528\u6237\u90fd\u758f\u4e8e\u6302\u8f7d\u65e5\u5fd7\u8def\u5f84volume\uff0c\u6216\u8005\u5bf9\u63a5\u4e00\u4e2a\u5df2\u7ecf\u5b58\u5728\u7684\u7cfb\u7edf\uff0c\u5f80\u5f80\u4e1a\u52a1\u65b9\u4e0d\u613f\u610f\u66f4\u6539\uff0c\u8fd9\u4e2a\u65f6\u5019\u80fd\u91c7\u96c6\u5bb9\u5668\u91cc\u7684\u65e5\u5fd7\u6587\u4ef6\u5417\uff1f

    Loggie\u5c1d\u8bd5\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u5f00\u542f\uff0c\u4e0d\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u4ecd\u7136\u9700\u8981\u66f4\u591a\u957f\u671f\u751f\u4ea7\u5b9e\u8df5\u7684\u68c0\u9a8c\u3002\u6b22\u8fce\u8bd5\u7528\uff0c\u5177\u4f53\u5f00\u5173\u8bf7\u53c2\u8003\u4e0b\u4e00\u8282\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#sidecar-stdout","title":"Sidecar + Stdout/\u65e5\u5fd7\u6587\u4ef6","text":"

    \u5982\u679c\u9700\u8981\u91c7\u7528sidecar\u7684\u65b9\u5f0f\uff0c\u9700\u8981\u5c06\u65e5\u5fd7Agent\u540c\u65f6\u6302\u8f7d\u76f8\u540c\u7684\u65e5\u5fd7\u8def\u5f84\uff0cAgent\u7684\u914d\u7f6e\u6587\u4ef6\u4e5f\u4e00\u822c\u4f7f\u7528ConfigMap\u6302\u8f7d\u51fa\u6765\u3002

    \u4f7f\u7528Sidecar\u7684\u90e8\u7f72\u65b9\u5f0f\u548cDaemonSet\u7684\u65b9\u5f0f\u4f18\u52a3\u5bf9\u6bd4\u8bf7\u53c2\u8003\u4e0a\u6587\u3002

    \u603b\u7ed3\uff1a \u5927\u90e8\u5206\u4e3b\u6d41\u7684\u5f00\u6e90Agent\uff0c\u53ea\u5bf9\u5bb9\u5668Stdout\u6709\u90e8\u5206\u652f\u6301\uff0c\u6bd4\u5982\u652f\u6301\u91c7\u96c6\u7684\u65f6\u5019\u7edf\u4e00\u52a0\u4e0a\u4e00\u4e9bK8s\u76f8\u5173\u5143\u4fe1\u606f\uff0c\u4f46\u4e0d\u652f\u6301\u5355\u72ec\u9488\u5bf9\u67d0\u4e9bPod\u8fdb\u884c\u914d\u7f6e\uff0c\u800c\u4e14\u5747\u6ca1\u6709\u5bf9\u5bb9\u5668\u4e2d\u7684\u65e5\u5fd7\u6587\u4ef6\u91c7\u96c6\u6709\u5f88\u597d\u7684\u652f\u6301\u3002 \u8fd9\u6837\u5bfc\u81f4\u5728\u5b9e\u9645\u590d\u6742\u7684\u5404\u7c7b\u4e1a\u52a1\u573a\u666f\u4e2d\uff0c\u6ca1\u529e\u6cd5\u6ee1\u8db3\u9700\u6c42\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#loggie","title":"Loggie\u5982\u4f55\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff1f","text":"

    \u76f8\u4fe1\u4ee5\u4e0a\u5217\u51fa\u7684\u95ee\u9898\u5927\u5bb6\u90fd\u9047\u5230\u6216\u8005\u601d\u8003\u8fc7\uff0c\u90a3Loggie\u662f\u5982\u4f55\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u7684\u5462\uff1f \u8bf7\u770b\u4e0b\u4e00\u8282\u5982\u4f55 \u4f7f\u7528Loggie\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff1f

    "},{"location":"user-guide/use-in-kubernetes/kube-event-source/","title":"\u91c7\u96c6Kubernetes Events","text":"

    \u9664\u4e86\u4f7f\u7528Logconfig\u91c7\u96c6\u65e5\u5fd7\u5916\uff0cLoggie\u540c\u6837\u53ef\u4ee5\u901a\u8fc7CRD\u914d\u7f6e\u4efb\u610f\u7684source/sink/interceptor\uff0c\u672c\u8d28\u4e0aLoggie\u5c31\u662f\u4e00\u4e2a\u652f\u6301\u591aPipeline\u7684\u6570\u636e\u6d41\uff0c\u96c6\u6210\u4e86\u901a\u7528\u7684\u8bf8\u5982\u961f\u5217\u91cd\u8bd5\u3001\u6570\u636e\u5904\u7406\u3001\u914d\u7f6e\u4e0b\u53d1\u3001\u76d1\u63a7\u62a5\u8b66\u7b49\u7b49\u529f\u80fd\uff0c\u51cf\u5c11\u4e86\u7c7b\u4f3c\u9700\u6c42\u7684\u7814\u53d1\u6210\u672c\u3002\u91c7\u96c6Kubernetes\u7684Events\u5c31\u662f\u5176\u4e2d\u4e00\u4e2a\u5f88\u597d\u7684\u4f8b\u5b50\u3002

    Kubernetes Events\u662f\u7531Kubernetes\u672c\u8eab\u7ec4\u4ef6\u548c\u4e00\u4e9b\u63a7\u5236\u5668\u4ea7\u751f\u7684\u4e8b\u4ef6\uff0c\u6211\u4eec\u5e38\u7528\u7684kubectl describe\u547d\u4ee4\u5c31\u53ef\u4ee5\u67e5\u770b\u5173\u8054\u8d44\u6e90\u7684\u4e8b\u4ef6\u4fe1\u606f\uff0c\u91c7\u96c6\u8bb0\u5f55\u8fd9\u4e9b\u4e8b\u4ef6\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u56de\u6eaf\u3001\u6392\u67e5\u3001\u5ba1\u8ba1\u3001\u603b\u7ed3\u95ee\u9898\uff0c\u66f4\u597d\u7684\u4e86\u89e3Kubernetes\u96c6\u7fa4\u5185\u90e8\u72b6\u6001\u3002

    "},{"location":"user-guide/use-in-kubernetes/kube-event-source/#_1","title":"\u51c6\u5907","text":"

    \u548cLoggie\u4e2d\u8f6c\u673a\u7c7b\u4f3c\uff0c\u6211\u4eec\u53ef\u4ee5\u5355\u72ec\u90e8\u7f72Aggregator\u96c6\u7fa4\u6216\u8005\u590d\u7528\u73b0\u6709\u7684\u4e2d\u8f6c\u673a\u96c6\u7fa4\u3002

    "},{"location":"user-guide/use-in-kubernetes/kube-event-source/#_2","title":"\u914d\u7f6e\u793a\u4f8b","text":"

    \u914d\u7f6ekubeEvents source\uff0c\u5e76\u4e14\u4f7f\u7528type: cluster\u4e0b\u53d1\u914d\u7f6e\u5230Aggregator\u96c6\u7fa4\u5373\u53ef\u3002

    Config

    apiVersion: loggie.io/v1beta1\nkind: ClusterLogConfig\nmetadata:\nname: kubeevent\nspec:\nselector:\ntype: cluster\ncluster: aggregator\npipeline:\nsources: |\n- type: kubeEvent\nname: event\nsinkRef: dev\n

    \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4e0d\u7ba1\u662f\u53d1\u9001\u7ed9Elasticsearch\u8fd8\u662f\u5176\u4ed6\u7684sink\uff0c\u8f93\u51fa\u7684\u662f\u7c7b\u4f3c\u5982\u4e0b\u683c\u5f0f\u7684\u6570\u636e:

    event

    {\n\"body\": \"{\\\"metadata\\\":{\\\"name\\\":\\\"loggie-aggregator.16c277f8fc4ff0d0\\\",\\\"namespace\\\":\\\"loggie-aggregator\\\",\\\"uid\\\":\\\"084cea27-cd4a-4ce4-97ef-12e70f37880e\\\",\\\"resourceVersion\\\":\\\"2975193\\\",\\\"creationTimestamp\\\":\\\"2021-12-20T12:58:45Z\\\",\\\"managedFields\\\":[{\\\"manager\\\":\\\"kube-controller-manager\\\",\\\"operation\\\":\\\"Update\\\",\\\"apiVersion\\\":\\\"v1\\\",\\\"time\\\":\\\"2021-12-20T12:58:45Z\\\",\\\"fieldsType\\\":\\\"FieldsV1\\\",\\\"fieldsV1\\\":{\\\"f:count\\\":{},\\\"f:firstTimestamp\\\":{},\\\"f:involvedObject\\\":{\\\"f:apiVersion\\\":{},\\\"f:kind\\\":{},\\\"f:name\\\":{},\\\"f:namespace\\\":{},\\\"f:resourceVersion\\\":{},\\\"f:uid\\\":{}},\\\"f:lastTimestamp\\\":{},\\\"f:message\\\":{},\\\"f:reason\\\":{},\\\"f:source\\\":{\\\"f:component\\\":{}},\\\"f:type\\\":{}}}]},\\\"involvedObject\\\":{\\\"kind\\\":\\\"DaemonSet\\\",\\\"namespace\\\":\\\"loggie-aggregator\\\",\\\"name\\\":\\\"loggie-aggregator\\\",\\\"uid\\\":\\\"7cdf4792-815d-4eba-8a81-d60131ad1fc4\\\",\\\"apiVersion\\\":\\\"apps/v1\\\",\\\"resourceVersion\\\":\\\"2975170\\\"},\\\"reason\\\":\\\"SuccessfulCreate\\\",\\\"message\\\":\\\"Created pod: loggie-aggregator-pbkjk\\\",\\\"source\\\":{\\\"component\\\":\\\"daemonset-controller\\\"},\\\"firstTimestamp\\\":\\\"2021-12-20T12:58:45Z\\\",\\\"lastTimestamp\\\":\\\"2021-12-20T12:58:45Z\\\",\\\"count\\\":1,\\\"type\\\":\\\"Normal\\\",\\\"eventTime\\\":null,\\\"reportingComponent\\\":\\\"\\\",\\\"reportingInstance\\\":\\\"\\\"}\",\n\"systemPipelineName\": \"default/kubeevent/\",\n\"systemSourceName\": \"event\"\n}\n

    \u4e3a\u4e86\u65b9\u4fbf\u5206\u6790\u5c55\u793a\uff0c\u6211\u4eec\u53ef\u4ee5\u6dfb\u52a0\u4e00\u4e9binterceptor\u5c06\u91c7\u96c6\u5230\u7684events\u6570\u636ejson decode\u3002

    \u914d\u7f6e\u793a\u4f8b\u5982\u4e0b\uff0c\u5177\u4f53\u8bf7\u53c2\u8003\u65e5\u5fd7\u5207\u5206\u4e0e\u5904\u7406\u3002

    Config

    interceptorclusterLogConfig
    apiVersion: loggie.io/v1beta1\nkind: Interceptor\nmetadata:\nname: jsondecode\nspec:\ninterceptors: |\n- type: normalize\nname: json\nprocessors:\n- jsonDecode: ~\n- drop:\ntargets: [\"body\"]\n
    apiVersion: loggie.io/v1beta1\nkind: ClusterLogConfig\nmetadata:\nname: kubeevent\nspec:\nselector:\ntype: cluster\ncluster: aggregator\npipeline:\nsources: |\n- type: kubeEvent\nname: event\ninterceptorRef: jsondecode\nsinkRef: dev\n

    \u7ecf\u8fc7normalize interceptor\u91ccjsonDecode\u540e\u7684\u6570\u636e\u5982\u4e0b\u6240\u793a\uff1a

    event

    {\n\"metadata\": {\n\"name\": \"loggie-aggregator.16c277f8fc4ff0d0\",\n\"namespace\": \"loggie-aggregator\",\n\"uid\": \"084cea27-cd4a-4ce4-97ef-12e70f37880e\",\n\"resourceVersion\": \"2975193\",\n\"creationTimestamp\": \"2021-12-20T12:58:45Z\",\n\"managedFields\": [\n{\n\"fieldsType\": \"FieldsV1\",\n\"fieldsV1\": {\n\"f:type\": {\n\n},\n\"f:count\": {\n\n},\n\"f:firstTimestamp\": {\n\n},\n\"f:involvedObject\": {\n\"f:apiVersion\": {\n\n},\n\"f:kind\": {\n\n},\n\"f:name\": {\n\n},\n\"f:namespace\": {\n\n},\n\"f:resourceVersion\": {\n\n},\n\"f:uid\": {\n\n}\n},\n\"f:lastTimestamp\": {\n\n},\n\"f:message\": {\n\n},\n\"f:reason\": {\n\n},\n\"f:source\": {\n\"f:component\": {\n\n}\n}\n},\n\"manager\": \"kube-controller-manager\",\n\"operation\": \"Update\",\n\"apiVersion\": \"v1\",\n\"time\": \"2021-12-20T12:58:45Z\"\n}\n]\n},\n\"reportingComponent\": \"\",\n\"type\": \"Normal\",\n\"message\": \"Created pod: loggie-aggregator-pbkjk\",\n\"reason\": \"SuccessfulCreate\",\n\"reportingInstance\": \"\",\n\"source\": {\n\"component\": \"daemonset-controller\"\n},\n\"count\": 1,\n\"lastTimestamp\": \"2021-12-20T12:58:45Z\",\n\"firstTimestamp\": \"2021-12-20T12:58:45Z\",\n\"eventTime\": null,\n\"involvedObject\": {\n\"kind\": \"DaemonSet\",\n\"namespace\": \"loggie-aggregator\",\n\"name\": \"loggie-aggregator\",\n\"uid\": \"7cdf4792-815d-4eba-8a81-d60131ad1fc4\",\n\"apiVersion\": \"apps/v1\",\n\"resourceVersion\": \"2975170\"\n},\n}\n

    \u5982\u679c\u89c9\u5f97\u6570\u636e\u5b57\u6bb5\u592a\u591a\u6216\u8005\u683c\u5f0f\u4e0d\u7b26\u5408\u9700\u6c42\uff0c\u8fd8\u53ef\u4ee5\u914d\u7f6enormalize interceptor\u8fdb\u884c\u4fee\u6539\u3002

    "},{"location":"user-guide/use-in-kubernetes/sidecar/","title":"Loggie Sidecar\u65b9\u5f0f\u91c7\u96c6\u65e5\u5fd7","text":"

    \u867d\u7136\u9ed8\u8ba4\u4e0d\u63a8\u8350\u4f7f\u7528Sidecar\u65b9\u5f0f\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff0c\u4f46\u662f\u5728\u67d0\u4e9b\u53d7\u9650\u573a\u666f\u4e0b\u53ea\u80fd\u9009\u62e9\u4f7f\u7528Sidecar\u7684\u65b9\u5f0f\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff0c\u8fd9\u91cc\u6211\u4eec\u7ed9\u51fa\u4e00\u4e2a\u53c2\u8003\u7684\u793a\u4f8b\u3002

    "},{"location":"user-guide/use-in-kubernetes/sidecar/#_1","title":"\u603b\u4f53\u601d\u8def","text":"

    \u5982\u4e0b\u56fe\u6240\u793a\uff1a

    Loggie\u548c\u4e1a\u52a1container\u90e8\u7f72\u5728\u540c\u4e00\u4e2aPod\u91cc\uff0c\u540c\u65f6\u9700\u8981\u6302\u8f7d\u76f8\u540c\u7684\u65e5\u5fd7\u6587\u4ef6volume\uff0c\u53e6\u5916Loggie\u7684\u914d\u7f6e\u53ef\u901a\u8fc7configMap\u7684\u65b9\u5f0f\u6302\u8f7d\u5230\u5bb9\u5668\u4e2d\uff0cLoggie\u6839\u636e\u63d0\u4f9b\u7684configMap\u914d\u7f6e\u6587\u4ef6\uff0c\u91c7\u96c6\u5bb9\u5668\u7684\u65e5\u5fd7\uff0c\u5e76\u53d1\u9001\u5230\u540e\u7aef\u3002

    "},{"location":"user-guide/use-in-kubernetes/sidecar/#1-loggie-sidecar","title":"\u65b9\u5f0f1: \u624b\u52a8\u6216\u8005\u901a\u8fc7\u90e8\u7f72\u4fa7\u6ce8\u5165Loggie sidecar","text":"
    apiVersion: apps/v1\nkind: Deployment\nmetadata:\nlabels:\napp: tomcat\nname: tomcat\nnamespace: default\nspec:\nreplicas: 1\nselector:\nmatchLabels:\napp: tomcat\ntemplate:\nmetadata:\nlabels:\napp: tomcat\nspec:\ncontainers:\n- name: tomcat\nimage: tomcat\nvolumeMounts:\n- mountPath: /usr/local/tomcat/logs\nname: log\n\n- name: loggie\nargs:\n- -config.system=/opt/loggie/loggie.yml\n- -config.pipeline=/opt/loggie/pipeline.yml\nimage: loggieio/loggie:main\nvolumeMounts:\n# loggie\u548c\u4e1a\u52a1container\u6302\u8f7d\u76f8\u540c\u7684log volume\n- mountPath: /usr/local/tomcat/logs\nname: log\n# \u6302\u8f7d\u65e5\u5fd7\u914d\u7f6econfigMap\n- mountPath: /opt/loggie\nname: loggie-config\n# \u6302\u8f7dloggie\u81ea\u8eab\u6301\u4e45\u5316\u7684\u6570\u636e\n- mountPath: /data\nname: registry\n\nvolumes:\n- emptyDir: {}\nname: log\n- emptyDir: {}\nname: registry\n- name: loggie-config\nconfigMap:\nname: tomcat-loggie-config\n\n---\napiVersion: v1\nkind: ConfigMap\nmetadata:\nname: tomcat-loggie-config\nnamespace: default\ndata:\nloggie.yml: |\nloggie:\nreload:\nenabled: true\nperiod: 10s\nmonitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nsink: ~\nhttp:\nenabled: true\nport: 9196\npipeline.yml: |\npipelines:\n- name: \"tomcat\"\nsources:\n- type: \"file\"\nname: \"tomcatlog\"\npaths:\n- \"/usr/local/tomcat/logs/*.log\"\nfields:\nnamespace: default\ndeployment: tomcat\nfieldsFromEnv:\npodname: HOSTNAME\nsink:\ntype: \"dev\"\nprintEvents: true\ncodec:\npretty: true\n

    \u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0a\u7684\u90e8\u7f72\u65b9\u5f0f\u901a\u8fc7loggie sidecar\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\u3002 \u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a

    Tips

    Info

    Loggie\u540e\u7eed\u4f1a\u652f\u6301\u81ea\u52a8Sidecar\u6ce8\u5165\u548c\u901a\u8fc7LogConfig\u81ea\u52a8\u751f\u6210ConfigMap\u6302\u8f7d\u7684\u65b9\u5f0f\uff0c\u4ece\u800c\u8fbe\u5230\u548c\u4f7f\u7528DaemonSet\u4e00\u81f4\u7684\u4f53\u9a8c\u3002

    "},{"location":"user-guide/use-in-kubernetes/sidecar/#2-sidecar","title":"\u65b9\u5f0f2: \u81ea\u52a8\u6ce8\u5165sidecar","text":"

    \u8bf7\u53c2\u8003\uff1ahttps://github.com/loggie-io/loggie-operator

    "}]} \ No newline at end of file +{"config":{"lang":["ja"],"separator":"[\\s\\-\uff0c\u3002]+","pipeline":["stemmer"]},"docs":[{"location":"blog/","title":"Posts","text":""},{"location":"blog/#blog","title":"Blog","text":""},{"location":"blog/#loggievictorialogs","title":"\u5c1d\u9c9c\u521d\u4f53\u9a8c\uff1a\u4f7f\u7528Loggie\u548cVictoriaLogs\u5feb\u901f\u6784\u5efa\u65b0\u4e00\u4ee3\u7684\u65e5\u5fd7\u7cfb\u7edf","text":"

    ethfoo 2023-6-28 \u00a0 20 min read

    \u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a

    Continue reading

    "},{"location":"blog/#loggie","title":"\u7f51\u6613\u57fa\u4e8eLoggie\u7684\u4e91\u539f\u751f\u5927\u89c4\u6a21\u65e5\u5fd7\u67b6\u6784\u6f14\u8fdb","text":"

    ethfoo 2022-12-17 \u00a0 15 min read

    \u6765\u81ea2022 Top 100\u5168\u7403\u8f6f\u4ef6\u6848\u4f8b\u7814\u7a76\u5cf0\u4f1a\u7684\u5206\u4eab\u3002

    \u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a

    Continue reading

    "},{"location":"blog/#loggie_1","title":"\u4f7f\u7528Loggie\u5feb\u901f\u6784\u5efa\u53ef\u6269\u5c55\u7684\u4e91\u539f\u751f\u65e5\u5fd7\u67b6\u6784","text":"

    ethfoo 2022-10-26 \u00a0 10 min read

    \u6765\u81ea\u4e91\u539f\u751f\u793e\u533a\u53ef\u89c2\u6d4b\u6027\u76f4\u64ad\u5206\u4eab\u3002

    \u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a

    Continue reading

    "},{"location":"blog/#_1","title":"\u7f51\u6613\u6570\u5e06\u4e91\u539f\u751f\u65e5\u5fd7\u5e73\u53f0\u67b6\u6784\u5b9e\u8df5","text":"

    ethfoo 2022-03-11 \u00a0 8 min read

    \u6765\u81eadatafun talk\u7684\u5206\u4eab\u3002

    \u7f51\u6613\u4ece2015\u5e74\u5c31\u5f00\u59cb\u4e86\u4e91\u539f\u751f\u7684\u63a2\u7d22\u4e0e\u5b9e\u8df5\uff0c\u4f5c\u4e3a\u53ef\u89c2\u6d4b\u6027\u7684\u91cd\u8981\u4e00\u73af\uff0c\u65e5\u5fd7\u5e73\u53f0\u4e5f\u7ecf\u5386\u4e86\u4ece\u4e3b\u673a\u5230\u5bb9\u5668\u7684\u6f14\u8fdb\uff0c\u652f\u6491\u4e86\u96c6\u56e2\u5185\u5404\u4e1a\u52a1\u90e8\u95e8\u7684\u5927\u89c4\u6a21\u4e91\u539f\u751f\u5316\u6539\u9020\u3002 \u672c\u6587\u4f1a\u8bb2\u8ff0\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u6211\u4eec\u9047\u5230\u7684\u95ee\u9898\uff0c\u5982\u4f55\u6f14\u8fdb\u548c\u6539\u9020\uff0c\u5e76\u4ece\u4e2d\u6c89\u6dc0\u4e86\u54ea\u4e9b\u7ecf\u9a8c\u4e0e\u6700\u4f73\u5b9e\u8df5\u3002

    \u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a

    Continue reading

    PPT

    "},{"location":"blog/victorialogs/loggie_victorialogs/","title":"\u5c1d\u9c9c\u521d\u4f53\u9a8c\uff1a\u4f7f\u7528Loggie\u548cVictoriaLogs\u5feb\u901f\u6784\u5efa\u65b0\u4e00\u4ee3\u7684\u65e5\u5fd7\u7cfb\u7edf","text":"

    \u5982\u679c\u4f60\u719f\u6089Prometheus\uff0c\u60f3\u5fc5\u4f60\u80af\u5b9a\u4e5f\u77e5\u9053VictoriaMetrics\uff0c\u8fd9\u6b3e\u8d8a\u6765\u8d8a\u6d41\u884c\u7684\u76d1\u63a7\u9879\u76ee\uff0c\u53ef\u4f5c\u4e3aPrometheus\u7684\u589e\u5f3a\u6216\u8005\u5e73\u66ff\u3002VictoriaMetrics\u4e00\u4e2a\u91cd\u8981\u7684\u4eae\u70b9\u5c31\u662f\u89e3\u51b3Prometheus\u5728\u5927\u89c4\u6a21Metrics\u6307\u6807\u6570\u636e\u91cf\u7ea7\u4e0b\u7684\u5b58\u50a8\u95ee\u9898\u3002

    \u540c\u5c5e\u4e8e\u53ef\u89c2\u6d4b\u6027\uff0c\u5f53\u6211\u4eec\u628a\u773c\u5149\u805a\u7126\u5230\u65e5\u5fd7\u9886\u57df\uff0c\u5176\u5b9e\u5f88\u4e45\u4ee5\u6765\u65e5\u5fd7\u7684\u4e00\u4e2a\u75db\u70b9\u662f\u4e5f\u662f\u5b58\u50a8\u3002

    "},{"location":"blog/victorialogs/loggie_victorialogs/#_1","title":"\u5f53\u524d\u65e5\u5fd7\u5b58\u50a8\u7684\u75db\u70b9","text":"

    \u65f6\u4e0b\u6bd4\u8f83\u5e38\u89c1\u7684\u4e00\u4e9b\u5f00\u6e90\u65e5\u5fd7\u5b58\u50a8\u9879\u76ee\u6709\uff1aElasticsearch\u3001Clickhouse\u3001Loki\u7b49\u3002\u5f53\u7136\uff0cElasticsearch\u548cClickhouse\u5e76\u975e\u5929\u751f\u9488\u5bf9\u65e5\u5fd7\u5b58\u50a8\u800c\u8bbe\u8ba1\uff0c\u6211\u4eec\u53ea\u662f\u53ef\u4ee5\u62ff\u6765\u5b58\u50a8\u65e5\u5fd7\u6570\u636e\u800c\u5df2\u3002

    \u6bd4\u5982Elasticsearch\u7684\u6838\u5fc3\u662f\u4e00\u4e2a\u641c\u7d22\u5f15\u64ce\u3002\u9488\u5bf9\u65e5\u5fd7\u5b58\u50a8\u7684\u573a\u666f\uff0c\u53ef\u4ee5\u5168\u6587\u68c0\u7d22\u662f\u4e00\u5927\u4f18\u52bf\uff0c\u4f46\u540c\u65f6\u5b58\u5728\u4ee5\u4e0b\u4e00\u4e9b\u4e0d\u8db3\uff1a

    \u603b\u4f53\u6765\u8bf4\uff0cElasticsearch\u662f\u4e00\u6b3e\u5386\u53f2\u60a0\u4e45\u3001\u88ab\u5e7f\u6cdb\u4f7f\u7528\u7684\u65e5\u5fd7\u5b58\u50a8\u6570\u636e\u5e93\uff0c\u6bd5\u7adf\u5f53\u5e74ELK\u7684\u6982\u5ff5\u6df1\u5165\u4eba\u5fc3\u3002\u4f46\u662f\uff0c\u5728\u5f53\u524d\u964d\u672c\u589e\u6548\u7684\u5927\u80cc\u666f\u4e0b\uff0c\u5f88\u591a\u4f01\u4e1a\u8fd8\u662f\u4f1a\u5bf9Elasticsearch\u5360\u7528\u7684\u673a\u5668\u8d44\u6e90\u6bd4\u8f83\u654f\u611f\uff0c\u5982\u679c\u53ea\u7528\u4e8e\u5b58\u50a8\u5927\u91cf\u7684\u8fd0\u7ef4\u7c7b\u65e5\u5fd7\uff0c\u6027\u4ef7\u6bd4\u8fd8\u662f\u504f\u4f4e\u3002

    \u6240\u4ee5\u524d\u4e24\u5e74Grafana\u5bb6\u7684Loki\u6a2a\u7a7a\u51fa\u4e16\uff0c\u8fd8\u662f\u6380\u8d77\u4e86\u4e00\u70b9\u6c34\u82b1\u7684\uff0c\u6bd5\u7adf\u65e5\u5fd7\u9886\u57df\u65e9\u5c31\u82e6Elasticsearch\u4e45\u77e3\u3002

    \u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0bLoki\u7684\u4f18\u70b9\uff1a

    \u5927\u534a\u5e74\u524d\uff0c\u6211\u4eec\u516c\u53f8\u5185\u90e8\u6709\u90e8\u95e8\u5f00\u59cb\u5c1d\u8bd5\u4f7f\u7528Loki\u5b58\u50a8\u4e00\u4e9b\u7cfb\u7edf\u65e5\u5fd7\u3002\u4f46\u603b\u4f1a\u9047\u5230\u4e00\u4e9b\u5c0f\u95ee\u9898\uff0c\u5e76\u4e0d\u662f\u5f88\u8ba9\u4eba\u653e\u5fc3\u3002\u9664\u6b64\u4e4b\u5916\uff0cLoki\u7684\u4e0d\u8db3\u4e4b\u5904\u8fd8\u6709\uff1a

    \u5f53\u7136\uff0cLoki\u8fd8\u662f\u4e00\u4e2a\u76f8\u5bf9\u5e74\u8f7b\u7684\u9879\u76ee\uff0c\u6211\u4eec\u53ef\u4ee5\u7406\u89e3\u8fd9\u4e9b\u7a33\u5b9a\u6027\u3001\u6027\u80fd\u3001\u8bbe\u8ba1\u4e0a\u7684\u95ee\u9898\u53ef\u80fd\u662f\u53d1\u5c55\u65e9\u671f\u7684\u9635\u75db\u3002

    \u4f46\u662f\uff0c\u8c8c\u4f3c\u5f88\u591a\u4eba\u5df2\u7ecf\u7b49\u4e0d\u53ca\u4e86\u3002

    "},{"location":"blog/victorialogs/loggie_victorialogs/#victorialogs","title":"\u59d7\u59d7\u6765\u8fdf\uff1aVictoriaLogs\u7684\u4f18\u52bf","text":"

    \u6700\u8fd1VictoriaMetrics\u53d1\u5e03\u4e86\u9884\u89c8\u7248\u7684VictoriaLogs\uff0c\u7c7b\u4f3cLoki\u4e13\u95e8\u7528\u4e8e\u5b58\u50a8\u65e5\u5fd7\u3002\u9274\u4e8eVictoriaMetrics\u7684\u826f\u597d\u540d\u58f0\uff0c\u8fd8\u662f\u8ba9\u5927\u5bb6\u5bf9\u8fd9\u6761\u6405\u5c40\u7684\u300c\u9cb6\u9c7c\u300d\u5145\u6ee1\u4e86\u4e00\u5b9a\u7684\u671f\u5f85\u3002

    VictoriaMetrics\u4e3a\u4ec0\u4e48\u8981\u5165\u5c40\u641eVictoriaLogs\u5462\uff1f

    \u5176\u5b9e\u4ece2020\u5e74\u7684\u8fd9\u4e2aIssues\u5f00\u59cb\uff1ahttps://github.com/VictoriaMetrics/VictoriaMetrics/issues/816

    VictoriaMetrics\u5c31\u6709\u4e86\u7814\u53d1VictoriaLogs\u7684\u60f3\u6cd5\u3002\u4ece\u8be5issues\u7684\u8ba8\u8bba\u4e2d\u6211\u4eec\u53ef\u4ee5\u770b\u51fa\uff0c\u5927\u5bb6\u5bf9Loki\u8fd8\u662f\u6709\u70b9\u5fae\u8f9e\u7684\uff0c\u6bd4\u5982\u8bf4\u5b58\u50a8\u4f9d\u8d56S3\uff08\u672c\u5730\u5b58\u50a8\u4e0d\u652f\u6301\u5206\u5e03\u5f0f\uff09\uff0c\u6bd4\u5982\u8bf4\u6027\u80fd\u3002

    \u8fd9\u91cc\u8282\u9009\u4e00\u4e0bissues\u91cc\u7684\u5410\u69fd\uff1a

    almost 2 years passed and Loki is still unusable for scenarios with real logging data. Trying to query anything hitting more than 50k logs is exploding servers :)

    \u4e0d\u7528\u7ffb\u8bd1\u4e86\uff0c\u9694\u7740\u5c4f\u5e55\u6211\u4eec\u90fd\u80fd\u611f\u53d7\u5230\u8fd9\u4e2a\u7528\u6237\u7684\u5f3a\u70c8\u4e0d\u6ee1\u3002

    \u65f6\u9694\u4e24\u5e74\u591a\uff0cVictoriaLogs\u7ec8\u4e8e\u6b63\u5f0f\u6765\u5230\u4e86\u6211\u4eec\u9762\u524d\uff0c\u90a3VictoriaLogs\u5230\u5e95\u6709\u54ea\u4e9b\u4f18\u52bf\uff0c\u53c8\u80fd\u89e3\u51b3\u65e5\u5fd7\u5b58\u50a8\u9886\u57df\u7684\u54ea\u4e9b\u95ee\u9898\u5462\uff1f

    \u8fd9\u91cc\u6211\u7b80\u7565\u603b\u7ed3\u51e0\u70b9\uff0c\u611f\u5174\u8da3\u7684\u540c\u5b66\u53ef\u4ee5\u5728\u5b98\u65b9\u6587\u6863\u4e2d\u5bfb\u627e\u66f4\u591a\u7b54\u6848\u3002

    \u5148\u8bf4VictoriaMetrics\u5bb6\u7684\u4e00\u5927\u7279\u8272\uff1a\u517c\u5bb9\u6027\u3002 VictoriaLogs\u76f4\u63a5\u652f\u6301\u4e86Elasticsearch bulk API\uff0c\u7531\u4e8e\u5e02\u9762\u4e0a\u51e0\u4e4e\u6240\u6709\u7684\u65e5\u5fd7\u91c7\u96c6Agent\u90fd\u652f\u6301\u53d1\u9001\u81f3Elasticsearch\uff0c\u6240\u4ee5\u53ef\u4ee5\u57fa\u672c\u505a\u5230\u65e0\u7f1d\u5bf9\u63a5\u548c\u8fc1\u79fb\uff0c\u65e0\u9700\u8ba9\u8fd9\u4e9bAgent\u90fd\u53bb\u7814\u53d1\u589e\u52a0\u65b0\u7684\u8f93\u51fa\u6e90\u3002\uff08\u8fd9\u91cc\u786e\u5b9e\u8981\u5410\u69fd\u4e00\u4e0bLoki\uff0c\u8fde\u4e2a\u516c\u5f00\u7684\u5ba2\u6237\u7aefClient SDK\u5305\u90fd\u6ca1\u6709\u63d0\u4f9b\uff0c\u8fd9\u8ba9\u4eba\u600e\u4e48\u5bf9\u63a5\u5462\uff09

    \u4f46\u662f\u652f\u6301\u6a2a\u5411\u548c\u7eb5\u5411\u6269\u5bb9\uff0c\u8fd9\u70b9\u7531\u4e8e\u73b0\u5728VictoriaLogs\u9884\u89c8\u7248\u53ea\u63d0\u4f9b\u4e86\u5355\u8282\u70b9\u7684\uff0c\u6682\u65f6\u8fd8\u65e0\u6cd5\u786e\u8ba4\u3002

    \u53e6\u5916\u5728 \u8d44\u6e90\u5360\u7528 \u65b9\u9762\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u770bVictoriaLogs\u63d0\u4f9b\u7684benchmark\u7ed3\u679c\u3002\u5bf9\u6bd4Elasticsearch\uff0c\u4ece\u4e0b\u56fe\u53ef\u4ee5\u770b\u51fa\uff1a

    \u5185\u5b58\u548c\u78c1\u76d8\u5360\u7528\u786e\u5b9e\u8981\u4f4e\u592a\u591a\uff0c\u57fa\u672c\u4e0a\u662f\u5dee\u4e86\u4e00\u4e2a\u6570\u91cf\u7ea7\uff0c\u5982\u679c\u5b58\u50a8\u91cf\u5927\u7684\u8bdd\uff0c\u80fd\u7701\u4e0b\u4e0d\u5c11\u53f0\u670d\u52a1\u5668\u7684\u94b1\uff0c\u65e0\u7591\u662f\u73b0\u5728\u964d\u672c\u589e\u6548\u60a3\u8005\u7684\u4e00\u5927\u798f\u97f3\u3002

    VictoriaLogs\u540c\u6837\u5f15\u5165\u4e86 log stream \u7684\u6982\u5ff5\uff0c\u7ed3\u5408\u591a\u79df\u6237\u7684\u80fd\u529b\uff0c\u4f3c\u4e4e\u53ef\u4ee5\u505a\u5230\u65e5\u5fd7\u5b58\u50a8\u573a\u666f\u4e0b\u7684\u6027\u80fd\u3001\u8d44\u6e90\u5360\u7528\u6743\u8861\u4e0b\u7684\u6700\u4f18\u89e3\uff0c\u8fd9\u4e5f\u662fVictoriaLogs\u533a\u522b\u4e8eElasticsearch\u7b49\u975e\u4e13\u95e8\u4e3a\u65e5\u5fd7\u5b58\u50a8\u8bbe\u8ba1\u6570\u636e\u5e93\u7684\u6838\u5fc3\u56e0\u7d20\u3002

    \u6240\u4ee5\u5728\u4f7f\u7528VictoriaLogs\u4e4b\u524d\uff0c\u8bf7\u52a1\u5fc5\u5148\u597d\u597d\u4e86\u89e3\u4e00\u4e0blog stream\u3002

    log stream\u662f\u4ec0\u4e48\u5462\uff1f

    \u7b80\u5355\u6765\u8bf4\uff0c\u8868\u793a\u5e94\u7528\uff08\u670d\u52a1\uff09\u7684\u4e00\u4e2a\u65e5\u5fd7\u5b9e\u4f8b\u3002\u81f3\u4e8e\u8fd9\u4e2a\u65e5\u5fd7\u5b9e\u4f8b\u7684\u5177\u4f53\u7c92\u5ea6\uff0c\u53ef\u4ee5\u7531\u6211\u4eec\u81ea\u884c\u8bbe\u8ba1\u548c\u638c\u63a7\uff0c\u4f46\u662f\u4e0d\u5efa\u8bae\u6574\u4f53\u6570\u91cf\u7279\u522b\u5927\u3002

    \u4e3e\u4f8b\u8bf4\u660e\uff0c\u4e00\u4e2a\u65e5\u5fd7\u5b9e\u4f8b\u53ef\u4ee5\u4e3a\uff1a

    log stream\u8bbe\u8ba1\u7684\u5173\u952e\u662f\u53ef\u4ee5\u88ab\u552f\u4e00\u6807\u8bc6\uff0c\u8fd9\u6837\u53ef\u4ee5\u786e\u5b9a\u65e5\u5fd7\u5728\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u4ea7\u751f\u7684\u4f4d\u7f6e\uff0c\u6bd4\u5982\u5728\u54ea\u4e2a\u8282\u70b9\u7684\u54ea\u4e2a\u5bb9\u5668\u7684\u54ea\u4e2a\u65e5\u5fd7\u6587\u4ef6\u4e2d\u3002

    \u4e00\u4e2alog stream\u7531\u591a\u4e2alabel\u6765\u6807\u8bc6\uff0c\u6240\u4ee5\u5176\u5b9e\u8fd9\u91cc\u548cPrometheus metrics\u7684label\u7c7b\u4f3c\uff0c\u6211\u4eec\u53ef\u4ee5\u62ffPrometheus\u4e2d\u7684\u4e00\u4e9b\u6982\u5ff5\u7c7b\u6bd4\uff1a

    \u5728VictoriaLogs\u4e2d\u4e5f\u53ef\u4ee5\u81ea\u5df1\u8bbe\u8ba1\u4e00\u4e9b\u7c7b\u4f3c\u7684label\uff0c\u52a0\u5728\u65e5\u5fd7\u91c7\u96c6\u7684\u5143\u4fe1\u606f\u4e2d\uff0c\u8fd9\u6837\u8fd8\u80fd\u7528\u4e8e\u540e\u7eed\u7684\u65e5\u5fd7\u548c\u6307\u6807\u7684\u5173\u8054\u548c\u68c0\u7d22\u3002\u5f53\u7136\u5728\u5b9e\u9645\u7684\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u589e\u52a0\u8bf8\u5982\uff1a\u73af\u5883\u3001\u6570\u636e\u4e2d\u5fc3\u3001namespace\u7b49\u7684label\u3002

    \u5982\u679c\u4f60\u4e4b\u524d\u4e86\u89e3Loki\uff0c\u80af\u5b9a\u4f1a\u60f3\u8bf4\uff0cLoki\u4e0d\u4e5f\u662f\u8fd9\u6837\u8bbe\u8ba1label\u7684\u5417\uff1f

    \u5bf9\uff0c\u4f46\u662f\u7b49\u4f60\u6df1\u5165\u7528\u8fc7Loki\u540e\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u8fd9\u6837\u7684\u5751\uff1a\u5f53\u53d1\u9001\u7684\u65e5\u5fd7labels\u91cc\u643a\u5e26\u4e86\u4e00\u4e9b\u9891\u7e41\u4fee\u6539\u7684\u5b57\u6bb5\uff0c\u6bd4\u5982\u8bf4\u4e00\u6761\u65e5\u5fd7\uff0c\u5c06\u5176\u4e2d\u7684\u504f\u79fb\u91cfoffset\u5b57\u6bb5\u4f5c\u4e3a\u4e00\u4e2alabel\uff0c\u5927\u6982\u5982\u4e0b\u6240\u793a\uff1a

    {\n\"message\": \"xxx\",\n\"timestamp\": \"\",\n\"logconfig\": \"foo\",\n\"podname\": \"bar\",\n\"offset\": 20,\n...\n}\n

    Loki\u4f1a\u5c06\u6240\u6709labels\u7684\u503c\u4f5c\u4e3a\u4e00\u4e2a\u552f\u4e00\u7684log stream\u6807\u8bc6\uff0c\u6bd4\u5982\u4e0a\u9762\u7684\u5185\u5bb9\u5c31\u4f1a\u5c06{logconfig: \"foo\", \"podname\":\"bar\", \"offset\": 20}\u4f5c\u4e3a\u4e00\u4e2alog stream\u3002\u7531\u4e8e\u5728\u540c\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0coffset\u4f1a\u968f\u7740\u91c7\u96c6\u7684\u6bcf\u884c\u65e5\u5fd7\u90fd\u5728\u589e\u52a0\uff0c\u56e0\u6b64\u4f1a\u5bfc\u81f4log stream\u4e2a\u6570\u65e0\u9650\u589e\u957f\uff0c\u5bf9Loki\u9020\u6210\u5de8\u5927\u7684\u538b\u529b\u3002

    \u4e3a\u4e86\u89c4\u907f\u8fd9\u7c7b\u95ee\u9898\uff0cVictoriaLogs\u8bbe\u8ba1\u4e0a\u5c31\u5c06stream label\u548c\u666e\u901alabel\u505a\u4e86\u533a\u5206\uff0c\u6bd4\u5982\u4ee5\u4e0a\u8fd9\u79cd\u573a\u666f\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5c06logconfig\u548cpodname\u4f5c\u4e3astream label\u5373\u53ef\uff0coffset\u5219\u4f5c\u4e3a\u666e\u901a\u7684label\u3002

    \u4e86\u89e3\u4e86stream label\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u66f4\u597d\u7684\u7406\u89e3\u4ee5\u4e0bVictoriaLogs\u4e2d\u7684\u6570\u636e\u683c\u5f0f\uff1a

    "},{"location":"blog/victorialogs/loggie_victorialogs/#loggievictorialogs_1","title":"\u771f\u5b9e\u4e16\u754c\uff1a\u4f7f\u7528Loggie\u91c7\u96c6\u65e5\u5fd7\u81f3VictoriaLogs\u4e2d","text":"

    \u4e0b\u9762\u6211\u4eec\u5f00\u59cb\u771f\u5b9e\u7684\u4f53\u9a8c\u4e00\u4e0b\u5982\u4f55\u4f7f\u7528Loggie\u548cVictoriaLogs\u5feb\u901f\u6784\u5efa\u4e00\u5957\u65e5\u5fd7\u7cfb\u7edf\u3002

    "},{"location":"blog/victorialogs/loggie_victorialogs/#1-victorialogs","title":"1. \u90e8\u7f72VictoriaLogs","text":"

    \u53ef\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a

    helm repo add vm https://victoriametrics.github.io/helm-charts/\nhelm repo update\n\nhelm install vlsingle vm/victoria-logs-single -nvictoria-logs --create-namespace\n

    \u66f4\u591a\u7684\u8be6\u60c5\u53ef\u53c2\u8003helm chart\u90e8\u7f72\u3002

    \u8fd9\u91cc\u6211\u4eec\u8bbe\u7f6e\u90e8\u7f72\u7684namespace\u4e3avictoria-logs\uff0c\u5982\u679c\u4fee\u6539\u4e86\u8be5namespace\u540d\u79f0\uff0c\u4e0b\u9762\u7684\u4e00\u4e9b\u914d\u7f6e\u4e5f\u8bf7\u540c\u6b65\u4fee\u6539\u3002

    "},{"location":"blog/victorialogs/loggie_victorialogs/#2-loggie","title":"2. \u90e8\u7f72Loggie","text":"

    \u5982\u679c\u4f60\u8fd8\u4e0d\u77e5\u9053Loggie\uff0c\u8bf7\u8fdb\u8fd9\u91cc\u3002

    \u4e3a\u4e86\u65b9\u4fbf\u8d77\u89c1\uff0c\u6211\u4eec\u5728Loggie catalog\u4e2d\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9002\u914dVictoriaLogs\u7684\u90e8\u7f72\u914d\u7f6e\u3002

    VERSION=v1.4.0\nhelm pull https://github.com/loggie-io/installation/releases/download/$VERSION/loggie-$VERSION.tgz && tar xvzf loggie-$VERSION.tgz\n# \u4ececatalog\u4e2d\u4e0b\u8f7d\u9002\u914dvictoriaLogs\u6240\u7528\u7684\u90e8\u7f72\u914d\u7f6evalues\u6587\u4ef6\nwget https://raw.githubusercontent.com/loggie-io/catalog/main/scenarios/victoriaLogs/values.yml\n# \u6307\u5b9a\u8be5values\u6587\u4ef6\u90e8\u7f72Loggie\nhelm install loggie ./loggie -nloggie --create-namespace -f values.yml\n
    "},{"location":"blog/victorialogs/loggie_victorialogs/#3","title":"3. \u751f\u6210\u548c\u91c7\u96c6\u65e5\u5fd7","text":"

    \u90e8\u7f72\u5b8c\u4e86VictoriaLogs\u548cLoggie\u540e\uff0c\u521b\u5efa\u4e00\u4e2a\u6d4b\u8bd5\u7528\u7684Deployment genfiles\u7528\u4e8e\u4ea7\u751f\u65e5\u5fd7\u3002

    wget https://raw.githubusercontent.com/loggie-io/catalog/main/common/genfiles/deployment.yml\nkubectl apply -f deployment.yml\n

    \u7136\u540e\u521b\u5efa\u4e00\u4e2a\u76f8\u5339\u914d\u7684\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\uff0c\u544a\u8bc9Loggie\u8981\u53bb\u91c7\u96c6\u8fd9\u4e2aDeployment\u5bb9\u5668\u4e2d\u7684\u65e5\u5fd7\u6587\u4ef6\uff1a

    wget https://raw.githubusercontent.com/loggie-io/catalog/main/scenarios/victoriaLogs/genfiles_logconfig.yml\nkubectl apply -f genfiles_logconfig.yml\n

    \u8fd9\u91cc\u6211\u4eec\u91cd\u70b9\u5173\u6ce8\u4e0bgenfiles_logconfig.yml\u4e2d\u7684sink\u90e8\u5206\u914d\u7f6e\uff1a

    sink: |\ntype: elasticsearch\nhosts: [ \"vlsingle-victoria-logs-single-server.victoria-logs.svc:9428/insert/elasticsearch/\" ]\nparameters:\n_msg_field: \"body\"\n_time_field: \"@timestamp\"\n_stream_fields: \"logconfig,namespace,podname,containername\"\n

    \u5728\u672c\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u5728sink\u7aef\u53d1\u9001\u7684\u65e5\u5fd7\u683c\u5f0f\u5927\u6982\u5982\u4e0b\u6240\u793a\uff1a

    {\n\"body\": \"2023-07-04 02:58:18.014 INF cmd/subcmd/genfiles/genfiles.go:57 > 1000 TqrccSCPzRUYRP PJ MlvgdAluEpIoRIRyzjZoNk\",\n\"containername\": \"genfiles\",\n\"namespace\": \"default\",\n\"podname\": \"genfiles-66f5c86fdb-tjpzr\",\n\"@timestamp\": \"2023-07-04T02:58:21.905Z\",\n\"offset\": 1092798,\n\"cluster\": \"test\",\n\"logconfig\": \"genfiles\",\n\"nodename\": \"kind-control-plane\",\n\"filename\": \"/var/lib/kubelet/pods/c7b2da94-b152-414e-a7d8-1951e9d4f09a/volumes/kubernetes.io~empty-dir/logs/loggie.log\"\n}\n

    \u53ef\u4ee5\u770b\u5230\uff0c\u8fd9\u91cc\u5c06log stream\u7684\u7c92\u5ea6\u5b9a\u4e3a\u4e86Pod\u5bb9\u5668\u7ea7\u522b\uff0c\u6240\u4ee5_stream_fields\u8bbe\u7f6e\u4e3a\u4e86cluster,logconfig,namespace,podname,containername\u3002

    \u73b0\u5728\u6211\u4eec\u6a21\u62df\u4ea7\u751f\u4e00\u70b9\u65e5\u5fd7\uff1a

    # \u8fdb\u5165\u5230genfiles\u5bb9\u5668\u4e2d\nkubectl exec -it $(kubectl get po -l app=genfiles -o jsonpath=\"{.items[0].metadata.name}\") bash\n\n# \u4ea7\u751f\u4e00\u70b9\u65e5\u5fd7\n./loggie genfiles -totalCount=1000 -lineBytes=1024 -qps=0 \\\n-log.maxBackups=1 -log.maxSize=1000 -log.directory=/tmp/log -log.noColor=true \\\n-log.enableStdout=false -log.enableFile=true -log.timeFormat=\"2006-01-02 15:04:05.000\"\n

    \u5173\u4e8eloggie\u751f\u6210\u65e5\u5fd7\u7684genfiles\u5b50\u547d\u4ee4\uff0c\u66f4\u591a\u7684\u4f7f\u7528\u65b9\u5f0f\u53ef\u4ee5\u53c2\u8003\u8fd9\u91cc\u3002

    \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0cLoggie\u4f1a\u5f88\u5feb\u91c7\u96c6\u8fd9\u4e9b\u65e5\u5fd7\uff0c\u7136\u540e\u53d1\u9001\u81f3VictoriaLogs\u3002

    \u5f53\u7136\u6211\u4eec\u4e5f\u53ef\u4ee5\u8fdb\u5165Loggie terminal\u63a7\u5236\u53f0\u786e\u8ba4\u4e00\u4e0b\u91c7\u96c6\u8fdb\u5ea6\uff1a

    kubectl -nloggie -it exec $(kubectl -nloggie get po -l app=loggie -o jsonpath=\"{.items[0].metadata.name}\") -- ./loggie inspect\n

    \u5982\u4e0a\u56fe\u6240\u793a\uff0c\u6587\u4ef6\u91c7\u96c6\u8fdb\u5ea6\u4e3a100%\uff0c\u8868\u793a\u5df2\u7ecf\u91c7\u96c6\u5b8c\u6bd5\uff0c\u5e76\u4e14\u53d1\u9001\u65e5\u5fd7\u5230\u4e86VictoriaLogs\u4e2d\u3002

    Loggie terminal\u5177\u4f53\u7684\u64cd\u4f5c\u65b9\u5f0f\uff0c\u4e5f\u53ef\u4ee5\u53c2\u8003\u6211\u4eec\u7684\u65e5\u5fd7\u91c7\u96c6\u5feb\u901f\u6392\u969c\u6307\u5357\u3002

    \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528VictoriaLogs\u5185\u7f6e\u7684UI\u67e5\u770b\u91c7\u96c6\u7684\u65e5\u5fd7\u4e86\u3002

    "},{"location":"blog/victorialogs/loggie_victorialogs/#logsql","title":"LogsQL\u548c\u65e5\u5fd7\u67e5\u8be2","text":"

    \u7531\u4e8e\u672c\u5730\u548cKubernetes\u96c6\u7fa4\u5185\u90e8\u7f51\u7edc\u4e0d\u901a\uff0c\u7b80\u5355\u8d77\u89c1\uff0c\u6211\u4eec\u76f4\u63a5port-forward\u4e00\u4e0b\uff1a

    export POD_NAME=$(kubectl get pods --namespace victoria-logs -l \"app=server\" -o jsonpath=\"{.items[0].metadata.name}\")\nkubectl --namespace victoria-logs port-forward $POD_NAME 9428\n

    \u7136\u540e\u672c\u5730\u8bbf\u95ee\u4ee5\u4e0b\u9875\u9762\uff1a[http://localhost:9428/select/vmui/](http://localhost:9428/select/vmui/)

    VictoriaLogs\u5f53\u524d\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u5355\u7684UI\u9875\u9762\uff0c\u53ef\u7528\u4e8e\u67e5\u8be2\u65e5\u5fd7\u3002\u4e3a\u4e86\u6f14\u793a\u5982\u4f55\u67e5\u8be2\u521a\u624d\u91c7\u96c6\u7684\u65e5\u5fd7\uff0c\u6211\u4eec\u5148\u5feb\u901f\u4e86\u89e3\u4e00\u4e0b\u67e5\u8be2\u8bed\u6cd5\u3002

    \u8003\u8651\u5230\u6700\u5927\u5316\u67e5\u8be2\u7684\u6027\u80fd\uff0c\u5efa\u8bae\u4e00\u822c\u5199LogsQL\u89c4\u8303\u6027\u5957\u8def\u4e3a\uff1a

    1. \u786e\u5b9alog stream

    _stream\u8fd9\u91cc\u7684\u8fc7\u6ee4\u5b57\u6bb5\uff0c\u5c31\u662f\u521a\u624d\u5728sink\u4e0aparameters._stream_fields\u914d\u7f6e\u7684\uff0c\u6bd4\u5982\u67e5\u8be2\u54ea\u4e2a\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\uff0c\u54ea\u4e2aPod\u7b49\u3002\u793a\u4f8b\u4e2d\u6211\u4eec\u6839\u636elog stream\u4e2d\u7684logconfig label\u67e5\u8be2\u4e86\u521a\u624d\u521b\u5efa\u7684\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\u4e0b\u7684\u6240\u6709\u65e5\u5fd7\uff0cLogsQL\u5982\u4e0b\uff1a

    _stream:{logconfig=genfiles}

    \u5982\u679clogconfig\u5339\u914d\u4e86\u5f88\u591a\u7684Pod\uff0c\u8fd9\u91cc\u8fd8\u53ef\u4ee5\u52a0\u4e0a\u5bf9\u5e94\u7684podname\u7b49\u5b57\u6bb5\u6765\u8fdb\u4e00\u6b65\u8fc7\u6ee4\u3002\u6bd4\u5982\uff1a_stream:{logconfig=genfiles, podname=\"genfiles-66f5c86fdb-mrfzc\"}\u3002

    2. \u52a0\u4e0a\u65f6\u95f4\u533a\u95f4

    \u63a5\u7740\u6211\u4eec\u8fd8\u53ef\u4ee5\u589e\u52a0\u65f6\u95f4\u533a\u95f4\uff0c\u8fdb\u4e00\u6b65\u7f29\u51cf\u8fd4\u56de\u7684\u65e5\u5fd7\u6761\u6570\u3002

    LogsQL: _stream:{logconfig=genfiles} _time:[now-1h,now]

    \u8bf7\u6ce8\u610f\uff0c\u8fd9\u91cc\u901a\u8fc7\u7a7a\u683c\u6765\u95f4\u9694\uff0c\u53e6\u5916_stream\u548c_time\u4e3a\u5185\u7f6e\u7684\u5b57\u6bb5\uff0c\u65e0\u5148\u540e\u987a\u5e8f\u533a\u5206\u3002

    3. \u8fdb\u4e00\u6b65\u7684\u8fc7\u6ee4

    \u4e0a\u9762\u6211\u4eec\u8ba9Victoria\u5148\u5feb\u901f\u786e\u5b9a\u4e00\u4e2alog stream\u7684\u65e5\u5fd7\u8303\u56f4\uff0c\u7136\u540e\u5728\u6b64\u57fa\u7840\u4e0a\uff0c\u8fdb\u884c\u5173\u952e\u5b57\u5339\u914d\uff0c\u5b57\u6bb5\u8fc7\u6ee4\u7b49\u5176\u4ed6\u590d\u6742\u7684\u65e5\u5fd7\u68c0\u7d22\u3002

    \u6bd4\u5982\uff1a

    \u2026

    LogsQL\u7684\u529f\u80fd\u8fd8\u662f\u6bd4\u8f83\u591a\u7684\uff0c\u66f4\u8be6\u7ec6\u7684LogsQL\u4f7f\u7528\u59ff\u52bf\uff0c\u53ef\u4ee5\u53c2\u8003\u5b98\u65b9\u6587\u6863\u3002

    "},{"location":"blog/victorialogs/loggie_victorialogs/#_2","title":"\u603b\u7ed3","text":"

    \u867d\u7136VictoriaLogs\u53ea\u53d1\u5e03\u4e86\u4e00\u4e2a\u9884\u89c8\u7248\uff0c\u4f46\u662f\u4ece\u5f53\u524d\u7684\u8bbe\u8ba1\u548c\u4f53\u9a8c\u6765\u770b\uff0c\u8fd8\u662f\u8981\u4f18\u4e8eLoki\u7684\uff0c\u6bd5\u7adf\u7ad9\u5728\u4e86Loki\u7684\u80a9\u8180\u4e0a\uff0c\u6709\u540e\u53d1\u4f18\u52bf\u3002

    \u4f46\u662f\u8f6f\u4ef6\u8bbe\u8ba1\u6ca1\u6709\u94f6\u5f39\uff0c\u771f\u5b9e\u7684\u4e16\u754c\u91cc\uff0c\u662f\u5426\u9009\u62e9\u4f7f\u7528\u67d0\u4e2a\u9879\u76ee\uff0c\u6700\u91cd\u8981\u7684\u8fd8\u662f\u9002\u4e0d\u9002\u5408\uff0c\u800c\u4e0d\u5728\u4e0e\u9879\u76ee\u672c\u8eab\u529f\u80fd\u662f\u5426\u5f3a\u5927\u3002

    \u53ef\u4ee5\u9884\u6599\u5230\u7684\u662f\uff0c\u5728\u5f88\u957f\u7684\u4e00\u6bb5\u65f6\u95f4\u5185\uff0cElasticsearch\u8fd9\u4e9b\u8001\u724c\u4eec\u8fd8\u662f\u4f1a\u5360\u636e\u5927\u90e8\u5206\u7684\u5e02\u573a\uff0c\u56e0\u4e3a\u5728\u4f01\u4e1a\u4e2d\uff0c\u5f88\u591a\u90fd\u6709\u5df2\u7ecf\u957f\u671f\u7a33\u5b9a\u8fd0\u884c\u7684Elasticsearch\u6216\u8005Clickhouse\uff0c\u540c\u65f6\u8fd8\u6709\u76f8\u5e94\u7684\u8fd0\u7ef4\u4eba\u5458\u548c\u914d\u5957\u652f\u6491\u3002

    \u90a3\u4ec0\u4e48\u60c5\u51b5\u9002\u5408VictoriaLogs\u5462\uff1f

    \u5982\u679c\u4f60\u4eec\u6b63\u5728\u4ece\u5934\u5f00\u59cb\u642d\u5efa\u81ea\u5df1\u7684\u65e5\u5fd7\u7cfb\u7edf\uff0c\u613f\u610f\u63a5\u53d7\u65b0\u4e8b\u7269\u7684\u6f5c\u5728\u98ce\u9669\uff0c\u5bf9VictoriaLogs\u7684\u672a\u6765\u5145\u6ee1\u4fe1\u5fc3\uff0c\u90a3\u4e48\u8fd8\u662f\u503c\u5f97\u4e00\u8bd5\u7684\u3002

    \u6b63\u662f\u7531\u4e8eVictoriaLogs\u8fd9\u4e9b\u65b0\u661f\u4eec\u8fdb\u573a\uff0c\u8ba9\u65e5\u5fd7\u9886\u57df\u66f4\u52a0\u5185\u5377\u7684\u540c\u65f6\uff0c\u4e5f\u8ba9\u5e7f\u5927\u7684\u4eba\u6c11\u7fa4\u4f17\u53d7\u76ca\u3002\u6bd5\u7adf\u6211\u4eec\u591a\u4e86\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\uff0c\u56fd\u5185\u7684\u300c\u5f00\u6e90\u5b9a\u5236\u5316\u5f00\u53d1\u300d\u5e02\u573a\u53c8\u6709\u66f4\u591a\u7684\u6d3b\u53ef\u4ee5\u5e72\u4e86\u3002

    \u5982\u679c\u4f60\u6709\u66f4\u591a\u5173\u4e8eVictoriaLogs\u7684\u60f3\u6cd5\u53ef\u4ee5\u4ea4\u6d41\uff0c\u6b22\u8fce\u626b\u7801\uff0c\u52a0\u5165Loggie\u4ea4\u6d41\u7fa4\uff0c\u8ba8\u8bba\u6240\u6709\u548c\u65e5\u5fd7\u76f8\u5173\u7684\u6280\u672f\u3002

    "},{"location":"developer-guide/build/","title":"\u7f16\u8bd1\u6784\u5efa","text":""},{"location":"developer-guide/build/#_2","title":"\u6301\u4e45\u5316\u5f15\u64ce\u9009\u62e9","text":"

    Loggie\u5728v1.5\u53ca\u4e4b\u540e\u7248\u672c\uff0c\u63d0\u4f9b\u4e86\u9664sqlite\u5916\u7684badger\u5f15\u64ce\u3002

    sqlite\u548cbadger\u4e24\u79cd\u6301\u4e45\u5316\u5f15\u64ce\u914d\u7f6e\uff0c\u8bf7\u53c2\u8003\u8fd9\u91cc\u3002

    \u4e3a\u4ec0\u4e48\u5f15\u5165badger\u5f15\u64ce\uff1f\u4f7f\u7528sqlite\u548cCGO\u7684\u95ee\u9898\u6709\uff1a

    "},{"location":"developer-guide/build/#_3","title":"\u5bb9\u5668\u955c\u50cf\u6784\u5efa","text":"

    \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cLoggie\u7684\u4f1a\u7ed9\u6240\u6709\u7684release\u5206\u652f\u548cmain\u5206\u652f\u6784\u5efa\u955c\u50cf\uff0c\u5e76\u63a8\u9001\u5230dockerhub\u4e0a\u3002\u4f46\u662f\u4ecedockerhub\u4e0a\u62c9\u955c\u50cf\u53ef\u80fd\u5b58\u5728\u88ab\u9650\u6d41\u7b49\u95ee\u9898\uff0c\u6240\u4ee5\u63a8\u8350\u5927\u5bb6\u81ea\u884c\u6784\u5efa\u955c\u50cf\uff0c\u6216\u8005\u91cd\u65b0\u63a8\u9001\u5230\u81ea\u5df1\u7684\u955c\u50cf\u4ed3\u5e93\u4e2d\u3002

    Loggie\u9879\u76ee\u4e0b\u63d0\u4f9b\u4e86\u4e24\u4e2aDockerfile:

    \u9664\u4e86\u4f7f\u7528docker build\u5916\uff0c\u8fd8\u53ef\u4f7f\u7528make\u6765\u6784\u5efa\uff1a

    make docker-build REPO=<YourRepoHost>/loggie TAG=v1.x.x\nmake docker-push REPO=<YourRepoHost>/loggie TAG=v1.x.x\n
    \u6216\u8005\u76f4\u63a5\u6784\u5efa\u548c\u63a8\u9001\u591a\u67b6\u6784\u955c\u50cf\uff1a
    make docker-multi-arch REPO=<YourRepoHost>/loggie TAG=v1.x.x\n

    \u6ce8\uff1a

    \u591a\u67b6\u6784

    Loggie\u9879\u76ee\u4e2d\u7684Dockerfile\u5747\u652f\u6301\u591a\u67b6\u6784\u7684\u6784\u5efa\u3002dockerhub\u4e0a\u7684Loggie\u955c\u50cf\u4e3aamd64\u548carm64\u7684\u591a\u67b6\u6784\uff0c\u62c9\u53d6\u65f6\u4f1a\u81ea\u52a8\u8bc6\u522b\u672c\u5730\u67b6\u6784\u3002

    \u4e0d\u8fc7\u5982\u679c\u4f60\u5e0c\u671b\u4fee\u6539tag\u5e76\u91cd\u65b0\u63a8\u5230\u81ea\u5df1\u7684\u4ed3\u5e93\uff0c\u8bf7\u52ff\u76f4\u63a5docker pull & docker tag & docker push\uff0c\u8fd9\u4f1a\u53eapush\u4f60\u672c\u5730\u67b6\u6784\u7684\u955c\u50cf\uff0c\u5bfc\u81f4\u4ed3\u5e93\u4e2d\u7684\u955c\u50cf\u591a\u67b6\u6784\u5931\u6548\u3002 \u5982\u679c\u5e0c\u671b\u63a8\u9001\u591a\u67b6\u6784\u955c\u50cf\u5230\u81ea\u5df1\u7684\u4ed3\u5e93\uff0c\u53ef\u4f7f\u7528\u5176\u4ed6\u7684\u4e00\u4e9b\u5f00\u6e90\u5de5\u5177\uff0c\u6bd4\u5982regctl\uff0c\u53ef\u5728\u672c\u5730\u4f7f\u7528\u7c7b\u4f3cregctl image copy loggieio/loggie:xxx <YourRepoImage>\u7684\u547d\u4ee4\u6765\u63a8\u9001\u3002

    \u5982\u679c\u63a5\u5165\u81ea\u5df1\u7684\u6784\u5efa\u6d41\u7a0b\u6216\u8005\u5de5\u5177\uff0c\u591a\u67b6\u6784\u955c\u50cf\u8bf7\u4f7f\u7528make docker-multi-arch\u6216\u8005docker buildx\u6784\u5efa\u3002

    "},{"location":"developer-guide/build/#_4","title":"\u4e8c\u8fdb\u5236\u6784\u5efa","text":"

    \u4e8c\u8fdb\u5236\u53ef\u7528\u4e8e\u5728\u4e3b\u673a\u90e8\u7f72\u7684\u573a\u666f\u3002

    \u5982\u679c\u9700\u8981\u4ea4\u53c9\u7f16\u8bd1\uff0c\u8bf7\u52a0\u4e0aGOOS\u548cGOARCH\u3002

    \u5982\u679c\u672c\u5730\u4f7f\u7528make build\u6784\u5efa\u5931\u8d25\uff0c\u53ef\u4fee\u6539makefile\u4e2d\u7684extra_flags\u989d\u5916\u6784\u5efa\u53c2\u6570\uff0c\u8bf7\u5c1d\u8bd5\u5c06\u5176\u4e2d\u7684-extldflags \"-static\"\u53bb\u9664\u3002

    "},{"location":"developer-guide/contributing/","title":"\u4ee3\u7801\u8d21\u732e","text":"

    Note

    \u5982\u679c\u4f60\uff1a

    \u5efa\u8bae\u5148\u63d0Issues\uff0c\u63cf\u8ff0\u4f60\u7684\u76ee\u7684\u6216\u8005\u95ee\u9898\u3002

    "},{"location":"developer-guide/contributing/#_2","title":"\u4ee3\u7801/\u6587\u6863\u8d21\u732e\u6d41\u7a0b","text":""},{"location":"developer-guide/contributing/#1","title":"1. \u521b\u5efa\u672c\u5730\u5de5\u7a0b","text":""},{"location":"developer-guide/contributing/#fork","title":"fork\u4ee3\u7801","text":"

    \u8bbf\u95eehttps://github.com/loggie-io/loggie\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684Fork\uff0cfork\u5230\u81ea\u5df1\u7684github\u4ed3\u5e93\u4e2d\u3002

    "},{"location":"developer-guide/contributing/#clone","title":"clone\u5230\u672c\u5730","text":"

    \u5c06fork\u540e\u7684\u5de5\u7a0bclone\u5230\u672c\u5730\uff1a

    cd ${go-workspace}\n\ngit clone git@github.com:${yourAccountId}/loggie.git\n

    "},{"location":"developer-guide/contributing/#2","title":"2. \u672c\u5730\u5f00\u53d1","text":""},{"location":"developer-guide/contributing/#add-upstream","title":"add upstream","text":"

    \u5728\u672c\u5730\u5de5\u7a0b\u4e2d\uff0c\u6dfb\u52a0upstream remote\uff1a

    git remote add upstream https://github.com/loggie-io/loggie.git\ngit remote set-url --push upstream no_push\n

    \u53ef\u4ee5\u4f7f\u7528git remote -v\u67e5\u770b\uff0corigin\u4e3a\u4f60\u4e2a\u4eba\u8d26\u53f7fork\u7684git\u5730\u5740\uff0cupstream\u4e3aLoggie\u5b98\u65b9\u4ed3\u5e93\u5730\u5740\uff0cuptream\u4ec5\u4e3a\u672c\u5730\u540c\u6b65\u4ee3\u7801\u4f7f\u7528\uff0c\u6b63\u5e38\u65e0push\u6743\u9650\u3002

    "},{"location":"developer-guide/contributing/#create-branch","title":"create branch","text":"

    \u57fa\u4e8e\u6700\u65b0\u7684main\u5206\u652f\uff0c\u521b\u5efa\u51fa\u4f60\u7684\u5206\u652f\uff0c\u901a\u5e38\u4ee5feat/fix/chore\u7b49\u5f00\u5934\u3002

    git checkout -b feat-mywork\n

    \u5728\u8be5\u5206\u652f\u5f00\u53d1\u5b8c\u540e\uff0c\u5f85\u63d0\u4ea4\u524d\uff0c\u5efa\u8bae\u4fdd\u6301\u4ee3\u7801\u548c\u4e0a\u6e38\u4e00\u81f4\uff1a

    git pull upstream -r\n
    "},{"location":"developer-guide/contributing/#_3","title":"\u63d0\u4ea4\u4ee3\u7801","text":"
    git commit\n\ngit push origin feat-mywork\n

    Commit\u89c4\u8303

    \u901a\u5e38\u6211\u4eec\u4f7f\u7528<type>(<scope>): <subject>\u7684\u5f62\u5f0f\uff1a

    <type>:\uff08\u5fc5\u987b\uff09

    <scope>:\uff08\u53ef\u9009\uff09

    <subject>: \uff08\u5fc5\u987b\uff09\u5373commit\u7684\u5185\u5bb9\u63cf\u8ff0

    "},{"location":"developer-guide/contributing/#3-pr","title":"3. \u521b\u5efaPR","text":""},{"location":"developer-guide/contributing/#github","title":"\u63d0\u4ea4\u81f3Github","text":"

    \u8bbf\u95ee\u4f60\u7684\u4e2a\u4ebagithub\u8d26\u53f7\u91ccfork\u7684Loggie\u9879\u76ee\uff0c\u5e76Open pull request\u3002 \u5c3d\u91cf\u63cf\u8ff0\u6e05\u695aPR\u7684\u80cc\u666f\u3001\u76ee\u7684\u548c\u6539\u52a8\u70b9\u3002 \u5982\u679c\u6709\u76f8\u5173Issues\uff0c\u9700\u5173\u8054\u3002

    \u63d0\u4ea4\u524d\u8bf7\u68c0\u67e5\uff1a

    "},{"location":"developer-guide/contributing/#merge","title":"\u5bfb\u6c42Merge","text":"

    \u4f60\u53ef\u4ee5\u5728OWNERS\u627e\u4eba\uff0c\u6216\u8005\u9ed8\u8ba4\u6dfb\u52a0loggie-robot\u8d26\u53f7\u4f5c\u4e3a\u4f60PR\u7684Reviewers\u6216Assigneees\u3002

    "},{"location":"developer-guide/development/","title":"\u672c\u5730\u5f00\u53d1","text":"

    \u672c\u6587\u4ecb\u7ecd\u5982\u4f55\u5728\u672c\u5730\u5f00\u53d1\u548c\u8c03\u8bd5Loggie\u5de5\u7a0b\u3002

    "},{"location":"developer-guide/development/#_2","title":"\u672c\u5730\u5de5\u7a0b","text":""},{"location":"developer-guide/development/#golang","title":"golang\u5f00\u53d1\u73af\u5883","text":"

    Loggie\u4f7f\u7528Golang\u7f16\u5199\uff0c\u8bf7\u786e\u4fdd\u672c\u5730\u6709Golang\u5f00\u53d1\u73af\u5883\u3002

    go version\n
    "},{"location":"developer-guide/development/#_3","title":"\u4ee3\u7801\u5de5\u7a0b","text":"

    \u8bf7\u4f7f\u7528\u81ea\u5df1\u7684github\u8d26\u53f7fork Loggie\u5de5\u7a0b\u3002\u7136\u540egit clone\u5230\u672c\u5730\u3002

    git clone git@github.com:<Account>/loggie.git\n
    "},{"location":"developer-guide/development/#_4","title":"\u672c\u5730\u73af\u5883","text":"

    \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u672c\u5730\u65e0\u7279\u6b8a\u4f9d\u8d56\u3002

    \u9488\u5bf9\u4e0d\u540c\u7684\u529f\u80fd\u573a\u666f\uff0c\u9700\u8981\u6839\u636e\u5177\u4f53\u60c5\u51b5\u5b89\u88c5\u6216\u8005\u4f7f\u7528\u5916\u90e8\u7684\u4f9d\u8d56\u3002

    \u5efa\u8bae\u672c\u5730\u8fd0\u884cKubernetes\u8fdb\u884c\u90e8\u7f72\u548c\u7ba1\u7406\u3002

    "},{"location":"developer-guide/development/#kubernetes","title":"Kubernetes","text":"

    \u642d\u5efaKubernetes

    \u63a8\u8350\u4f7f\u7528Kind\u3002

    \u90e8\u7f72\u4f9d\u8d56\u7ec4\u4ef6

    \u63a8\u8350\u4f7f\u7528Helm\u6765\u90e8\u7f72\u3002\u76f8\u5173\u7684\u7ec4\u4ef6\u53ef\u4f7f\u7528\u516c\u5f00\u7684Helm\u4ed3\u5e93\u6765\u6dfb\u52a0\u548c\u90e8\u7f72\u3002

    \u672c\u5730Loggie\u8fde\u63a5Kubernetes

    \u5982\u679c\u9700\u8981\u4f7f\u7528LogConfig\u7b49CRD\uff0c\u6216\u8005\u8c03\u8bd5Kubernetes\u4e0b\u7684\u4f7f\u7528\u65b9\u5f0f\uff0c\u9700\u8981\u5728\u7cfb\u7edf\u914d\u7f6e\u4e2d\uff0cenable Kubernetes Discovery\u3002

    loggie.yml

      discovery:\nenabled: true\nkubernetes:\nkubeconfig: ${home}/.kube/config\n

    \u6307\u5b9akubeconfig\u8fde\u63a5\u672c\u5730\u7684Kubernetes APIServer\u3002

    \u53e6\u5916\uff0cAgent\u5f62\u6001\u7684Loggie\uff0c\u4f1a\u53ea\u76d1\u542c\u672c\u8282\u70b9\u7684Kubernetes Pod\u4e8b\u4ef6\uff0c\u9700\u8981\u5728Loggie\u542f\u52a8\u53c2\u6570\u4e2d\u6dfb\u52a0-meta.nodeName\u6765\u6a21\u62df\u6240\u5728\u7684\u8282\u70b9\u3002

    \u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528kubectl get node\u67e5\u770b\u6240\u6709\u8282\u70b9\u540d\u79f0\uff1a

    NAME                 STATUS   ROLES    AGE     VERSION\nkind-control-plane   Ready    master   2y50d   v1.21.0\n
    \u7136\u540e\u542f\u52a8\u53c2\u6570\u589e\u52a0-meta.nodeName=kind-control-plane\uff0c\u53ef\u4ee5\u4f7fLoggie\u542f\u52a8\u540e\u88ab\u8ba4\u4e3a\u90e8\u7f72\u5728\u8be5\u8282\u70b9\u3002

    "},{"location":"developer-guide/development/#_5","title":"\u9a8c\u8bc1\u4e0e\u8c03\u8bd5","text":"

    Loggie\u9ed8\u8ba4\u542f\u52a8\u540e\uff0c\u8f93\u51fa\u7684\u65e5\u5fd7\u683c\u5f0f\u4e3aJSON\uff0c\u5982\u679c\u4f60\u4e0d\u4e60\u60ef\uff0c\u53ef\u5728\u542f\u52a8\u53c2\u6570\u4e2d\u6dfb\u52a0-log.jsonFormat=false\u6765\u5173\u95ed\u3002

    \u672c\u5730\u5c3d\u91cf\u4f7f\u7528\u6a21\u62df\u7684\u65b9\u5f0f\uff0c\u5408\u7406\u5229\u7528dev source\u548cdev sink\u3002\u6bd4\u5982\uff1a

    \u793a\u4f8b\uff1a\u5728pipelines\u4e2d\uff0c\u4f7f\u7528dev sink\uff0c\u67e5\u770b\u6700\u7ec8\u8f93\u51fa\u53d1\u9001\u81f3\u4e0b\u6e38\u7684\u6570\u636e\u3002

    pipelines.yml

        sink:\ntype: \"dev\"\nprintEvents: true\ncodec:\npretty: true\n
    "},{"location":"developer-guide/release/","title":"\u7248\u672c\u548cRelease\u53d1\u5e03\u6d41\u7a0b","text":""},{"location":"developer-guide/release/#_1","title":"\u7248\u672c\u53d1\u5e03\u6d89\u53ca\u5de5\u7a0b","text":""},{"location":"developer-guide/release/#_2","title":"\u4ee3\u7801\u5206\u652f\u7b56\u7565","text":""},{"location":"developer-guide/release/#_3","title":"\u53d1\u5e03\u65b0\u7248\u672c\u6b65\u9aa4","text":""},{"location":"developer-guide/release/#1-release","title":"1. \u521b\u5efa\u65b0\u7684release\u5206\u652f","text":"

    \u786e\u8ba4\u7248\u672c\u9700\u8981\u7684\u6240\u6709\u529f\u80fd\u5df2\u7ecf\u5408\u5165\uff0cmain\u5206\u652f\u4e3a\u6700\u65b0\u63d0\u4ea4\uff1a

    git checkout main\ngit pull upstream main -r\n

    \u57fa\u4e8emain\u5206\u652f\u521b\u5efa\u65b0\u7684release\u5206\u652f\uff0c\u4f8b\u5982release-v1.1\uff1a

    git checkout -b release-v${A.B}\n

    "},{"location":"developer-guide/release/#2-changelog","title":"2. \u586b\u5199CHANGELOG","text":"

    \u57fa\u4e8e\u8be5\u5206\u652f\u586b\u5199CHANGELOG\uff0c\u63d0\u4ea4\u81f3\u5de5\u7a0b\u4e2d\u5408\u5165

    git add .\ngit commit -m'Release: add v${A.B.C} changelog'\ngit push upstream release-v${A.B.C}\n
    "},{"location":"developer-guide/release/#3-release-loggie-installation","title":"3. release Loggie-installation","text":"

    release Loggie-installationation\u90e8\u7f72\u811a\u672c\u5de5\u7a0b\uff0c\u548c\u4e0a\u8ff01\uff0c2\u6b65\u9aa4\u76f8\u540c

    \u8bf7\u6ce8\u610f\uff1a

    "},{"location":"developer-guide/release/#4","title":"4. \u56de\u5f52\u6d4b\u8bd5","text":"

    \u57fa\u4e8erelease\u5206\u652f\u8fdb\u884c\u56de\u5f52\u6d4b\u8bd5\u3002 release\u5206\u652fpush\u81f3Github\u540e\uff0c\u4f1a\u89e6\u53d1action\u8fdb\u884c\u955c\u50cf\u6784\u5efa\uff0c\u4f7f\u7528\u8be5\u955c\u50cf\u8fdb\u884c\u56de\u5f52\u6d4b\u8bd5\u3002 \u8fd9\u91cc\u7684\u6d4b\u8bd5\u4f1a\u4f7f\u7528loggie-installationation\u90e8\u7f72\u811a\u672c\u91cc\u76f8\u5e94\u7684release\u5206\u652f\uff0c\u540c\u65f6\u56de\u5f52\u9a8c\u8bc1\u90e8\u7f72\u811a\u672c\u6b63\u786e\u6027\u3002 \u5982\u679c\u6d4b\u8bd5\u53d1\u73b0Bug\uff0c\u63d0\u4ea4PR\u5408\u5165release\u5206\u652f\uff0c\u91cd\u65b0\u8fdb\u884c\u56de\u5f52\u3002

    "},{"location":"developer-guide/release/#5-tag","title":"5. \u6253\u4e0a\u7248\u672ctag","text":"

    \u6d4b\u8bd5\u901a\u8fc7\u540e\uff0c\u57fa\u4e8e\u8be5release\u5206\u652f\u6253\u4e0a\u76f8\u5e94\u7684\u7248\u672ctag\uff0c\u6bd4\u5982v1.1.0

    git pull upstream release-v${A.B.C}\ngit tag v${A.B.C}\ngit push v${A.B.C}\n
    \u6ce8\u610fLoggie\u5de5\u7a0b\u548cLoggie-installationation\u90e8\u7f72\u811a\u672c\u5747\u9700\u8981\u3002

    "},{"location":"developer-guide/release/#6-githubrelease","title":"6. \u5728Github\u4e0a\u53d1\u5e03release","text":""},{"location":"developer-guide/release/#7-loggie-docs","title":"7. \u66f4\u65b0Loggie docs\u6587\u6863","text":""},{"location":"developer-guide/release/#8-releasemain","title":"8. \u5c06release\u5206\u652f\u5408\u5165main","text":"

    \u63d0PR\u5c06release\u5206\u652f\u5408\u5165main\uff0c\u53ef\u7b49\u7a33\u5b9a\u4e00\u6bb5\u65f6\u95f4\u540e\u518d\u5408\u5165\uff0c\u6ce8\u610fLoggie\u5de5\u7a0b\u548cLoggie-installation\u90e8\u7f72\u811a\u672c\u5747\u9700\u8981\u3002

    "},{"location":"developer-guide/release/#bugfix","title":"\u6709BugFix","text":""},{"location":"developer-guide/code/coding-guide/","title":"\u4ee3\u7801\u89c4\u8303","text":""},{"location":"developer-guide/code/coding-guide/#_2","title":"\u5f00\u53d1\u89c4\u5219","text":""},{"location":"developer-guide/code/coding-guide/#golang","title":"\u901a\u7528Golang\u89c4\u8303","text":"

    \u53c2\u8003\uff1a

    "},{"location":"developer-guide/code/coding-guide/#loggie","title":"Loggie\u7684\u89c4\u8303","text":"
    1. \u804c\u8d23\u5355\u4e00\u539f\u5219\uff0c\u4e00\u4e2acomponent\u53ea\u505a\u4e00\u4ef6\u4e8b\uff0c\u4e14\u505a\u597d\u4e00\u4ef6\u4e8b
    2. \u542f\u52a8\u4efb\u4f55\u4e00\u4e2agoroutine\u90fd\u8981\u5148\u60f3\u597d\u5982\u4f55\u9000\u51fa\uff0c\u4ee5\u53ca\u7f16\u7801\u9000\u51fa\u903b\u8f91
    3. return err\u7684\u65f6\u5019\u60f3\u60f3\u662f\u5426\u9700\u8981\u6e05\u7406\u672c\u65e0\u9700\u542f\u52a8\u7684goroutine
    4. \u6c38\u8fdc\u8bb0\u4f4fgo\u4e2d\u7684\u64cd\u4f5c\u90fd\u4e0d\u4fdd\u8bc1\u539f\u5b50\u6027\uff08\u4f8b\u5982\u5b57\u7b26\u4e32\u62fc\u63a5\uff09\uff0c\u9664\u4e86chan\u3001sync\u5305\u7b49
    5. for\uff08for each\uff09\u5faa\u73af\u7684\u65f6\u5019\uff0c\u6ce8\u610f\u51fd\u6570\u53d8\u91cf\u662f\u5171\u4eab\u76f8\u540c\u7684\u5730\u5740
    6. \u51cf\u5c11\u4f7f\u7528\u5168\u5c40\u7684done chan\uff08\u5927\u91cfgoroutine\u8f6e\u8be2\u540c\u4e00\u4e2adone chan\u6027\u80fd\u4f1a\u6025\u5267\u4e0b\u964d\uff09\u3002 \u66f4\u5efa\u8bae\u4f7f\u7528\u7ec4\u4ef6struct\u72ec\u7acb\u7684done chan\u548c\u63d0\u4f9bStop()\u65b9\u6cd5\u6765\u4f9b\u4e0a\u5c42\u8c03\u7528\u6765\u5173\u95ed\u4ee5\u907f\u514dgoroutine\u6cc4\u9732
    7. Component\u60f3\u597d\u5982\u4f55\u5408\u7406\u4f18\u96c5Stop\uff08\u7279\u522b\u662f\u4e0d\u8981\u53d1\u751fpanic\u5bfc\u81f4\u6574\u4e2a\u8fdb\u7a0b\u6302\u6389\uff09
    8. \u4e0d\u8981\u5173\u95ed(close)\u4e00\u4e2a\u7528\u4e8e\u8bfb\u5199\u7684chan\u6765\u8fbe\u5230\u9000\u51fagoroutine\u6216\u8005\u505c\u6b62Component\u7684\u76ee\u6807\uff0c\u53ef\u80fd\u5728close chan\u540e\u8fd8\u6709\u5199\u64cd\u4f5c\u4f1a\u9020\u6210panic\u3002 \u4f7f\u7528\u4e00\u4e2a\u5355\u72ec\u7684done chan\u6765\u6807\u793a\u662f\u5426\u9000\u51fa
    9. \u5173\u95ed(Stop)Component\u7684\u65f6\u5019\u6ce8\u610f\u5173\u95ed\u7684\u987a\u5e8f\u548c\u8d44\u6e90\u91ca\u653e\uff0c \u4e0d\u8981\u9020\u6210\u5176\u4ed6goroutine\u592f\u4f4f(\u4f8b\u5982\u4f9b\u5916\u90e8\u5199\u76840\u5bb9\u91cf\u7684chan\u6ca1\u6709\u5904\u7406\uff0c\u4f46\u662f\u8bfb\u7684goroutine\u9000\u51fa\u4e86\uff0c\u5bfc\u81f4\u5916\u90e8\u5199\u7684goroutine\u4e00\u76f4\u963b\u585e)
    10. \u5c06chan\u7684\u751f\u547d\u5468\u671f\u5c01\u88c5\u5728chan\u6240\u6709\u8005\u5185\u90e8
    11. \u4f7f\u7528done chan\u9000\u51fagoroutine\u7684\u65f6\u5019\uff0c\u4e0d\u8981\u505a\u4efb\u4f55\u6e05\u7406\u8d44\u6e90\u7684\u64cd\u4f5c\u3002\u6e05\u7406\u8d44\u6e90\u4f18\u5148\u4f7f\u7528defer\uff0c\u56e0\u4e3a\u5f53goroutine panic\u7684\u65f6\u5019\uff0c defer\u8fd8\u80fd\u591f\u6e05\u7406\u8d44\u6e90\uff0c\u800cdone chan\u4e2d\u7684\u6e05\u7406\u903b\u8f91\u53ef\u80fd\u6c38\u8fdc\u4e0d\u4f1a\u88ab\u6267\u884c
    12. \u4e0d\u5141\u8bb8\u4f7f\u7528time.after()\u3002\u4f7f\u7528time.NewTicker()\u4ee3\u66ff\uff0c\u5e76\u53ca\u65f6\u6e05\u7406ticker
    "},{"location":"developer-guide/code/coding-guide/#_3","title":"\u65e5\u5fd7","text":""},{"location":"developer-guide/code/coding-guide/#_4","title":"\u65e5\u5fd7\u7ea7\u522b","text":"

    PANIC\u548cFATAL\u533a\u522b

    PANIC\u6700\u7ec8\u8c03\u7528\u7684\u662fpanic(msg)

    FATAL\u6700\u7ec8\u8c03\u7528\u7684\u662fos.Exit(1)

    "},{"location":"developer-guide/code/coding-guide/#_5","title":"\u76d1\u63a7","text":""},{"location":"developer-guide/code/coding-guide/#_6","title":"\u5355\u5143\u6d4b\u8bd5","text":""},{"location":"developer-guide/code/coding-guide/#_7","title":"\u4ee3\u7801\u98ce\u683c","text":""},{"location":"developer-guide/code/coding-guide/#_8","title":"\u5411\u540e\u517c\u5bb9","text":""},{"location":"developer-guide/code/coding-guide/#copyright-profile","title":"Copyright profile","text":"

    Copyright-text

    /*\nCopyright 2022 Loggie Authors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n
    "},{"location":"developer-guide/component/component-guide/","title":"\u7ec4\u4ef6\u5f00\u53d1","text":"

    \u63a8\u8350\u53c2\u8003\u5df2\u6709\u7684\u7ec4\u4ef6\u5f00\u53d1\u4e00\u4e2a\u65b0\u7684\u7ec4\u4ef6

    "},{"location":"developer-guide/component/component-guide/#_1","title":"\u516c\u5171\u63a5\u53e3","text":"
    // \u751f\u547d\u5468\u671f\u63a5\u53e3\ntype Lifecycle interface {\n// \u521d\u59cb\u5316\uff0c\u4f8b\u5982\u521d\u59cb\u5316Kafka\u8fde\u63a5\nInit(context Context)\n// \u542f\u52a8\u8fd0\u884c\uff0c\u4f8b\u5982\u5f00\u59cb\u6d88\u8d39Kafka\nStart()\n// \u505c\u6b62\nStop()\n}\n\n// \u63cf\u8ff0\u63a5\u53e3\ntype Describable interface {\n// \u7c7b\u522b\uff0c\u4f8b\u5982source\nCategory() Category\n// \u7c7b\u578b\uff0c\u4f8b\u5982kafka\nType() Type\n// \u81ea\u5b9a\u4e49\u63cf\u8ff0\nString() string\n}\n\n// \u914d\u7f6e\u83b7\u53d6\u63a5\u53e3\ntype Config interface {\n// \u83b7\u53d6\u914d\u7f6e\nConfig() interface{}\n}\n\n// \u7ec4\u4ef6\u63a5\u53e3\ntype Component interface {\n// \u751f\u547d\u5468\u671f\u7ba1\u7406\nLifecycle\n// \u63cf\u8ff0\u7ba1\u7406\nDescribable\n// \u914d\u7f6e\u7ba1\u7406\nConfig\n}\n
    "},{"location":"developer-guide/component/component-guide/#source","title":"source\u7ec4\u4ef6","text":"

    source\u7ec4\u4ef6\u5bf9\u63a5\u6570\u636e\u6e90\u8f93\u5165\uff0c\u5f00\u53d1\u4e00\u4e2a\u65b0\u7684source\u63d2\u4ef6\u9700\u8981\u5b9e\u73b0\u5982\u4e0b\u63a5\u53e3

    // source\u7ec4\u4ef6\u63a5\u53e3\ntype Source interface {\nComponent\nProducer\n// \u63d0\u4ea4\u63a5\u53e3\uff0c\u786e\u8ba4sink\u7aef\u6210\u529f\u7136\u540e\u63d0\u4ea4\nCommit(events []Event)\n}\n\n// \u751f\u4ea7\u63a5\u53e3\uff0csource\u7ec4\u4ef6\u9700\u8981\u5b9e\u73b0\ntype Producer interface {\n// \u5bf9\u63a5\u6570\u636e\u6e90\nProductLoop(productFunc ProductFunc)\n}\n

    "},{"location":"developer-guide/component/component-guide/#sink","title":"sink\u7ec4\u4ef6","text":"

    sink\u7ec4\u4ef6\u5bf9\u63a5\u8f93\u51fa\u7aef\uff0c\u5f00\u53d1\u4e00\u4e2a\u65b0\u7684sink\u63d2\u4ef6\u9700\u8981\u5b9e\u73b0\u5982\u4e0b\u63a5\u53e3

     // sink\u7ec4\u4ef6\u63a5\u53e3\ntype Sink interface {\nComponent\nConsumer\n}\n\n// \u6d88\u8d39\u63a5\u53e3\uff0csink\u7ec4\u4ef6\u9700\u8981\u5b9e\u73b0\ntype Consumer interface {\n// \u5bf9\u63a5\u8f93\u51fa\u7aef\nConsume(batch Batch) Result\n}\n

    "},{"location":"developer-guide/component/component-guide/#interceptor","title":"interceptor\u7ec4\u4ef6","text":"

    interceptor\u7ec4\u4ef6\u5bf9\u4e8b\u4ef6\u8fdb\u884c\u62e6\u622a\u5904\u7406\uff0c\u5f00\u53d1\u4e00\u4e2a\u65b0\u7684interceptor\u63d2\u4ef6\u9700\u8981\u5b9e\u73b0\u5982\u4e0b\u63a5\u53e3

    // interceptor\u7ec4\u4ef6\u63a5\u53e3\ntype Interceptor interface {\nComponent\n// \u62e6\u622a\u5904\u7406\nIntercept(invoker Invoker, invocation Invocation) api.Result\n}\n

    Note

    \u8bf7\u6ce8\u610f\u65b0\u589e\u7684\u7ec4\u4ef6\u9700\u8981\u653e\u5230pkg/include/include.go\u7684import\u5f53\u4e2d\u6ce8\u518c

    "},{"location":"getting-started/overview/","title":"Loggie\u6f2b\u6e38\u6307\u5357","text":"

    \u6b22\u8fce\u6765\u5230Loggie\u7684\u4e16\u754c\u3002

    "},{"location":"getting-started/overview/#_1","title":"\u4e86\u89e3","text":"

    \u60f3\u77e5\u9053\u4ec0\u4e48\u662fLoggie\uff1f\u4e86\u89e3\u4e00\u4e0b\u300c\u6838\u5fc3\u6982\u5ff5\u300d\u3002

    \u5982\u679c\u4f60\u5e0c\u671b\u5feb\u901f\u4f53\u9a8cLoggie\uff0c\u8bf7\u53c2\u8003\u300c\u5feb\u901f\u4e0a\u624b\u300d\u3002

    \u6709\u66f4\u591a\u5174\u8da3\uff1f\u60f3\u77e5\u9053\u6211\u4eec\u4e3a\u4ec0\u4e48\u7814\u53d1Loggie\u3001Loggie\u6709\u4ec0\u4e48\u4f18\u52bf\u3001\u548c\u540c\u7c7b\u9879\u76ee\u7684\u5bf9\u6bd4\uff1f\u8bf7\u6233\u8fd9\u91cc\u3002

    "},{"location":"getting-started/overview/#_2","title":"\u4f7f\u7528","text":"

    \u5982\u679c\u4f60\u5e0c\u671b\u5c1d\u8bd5\u4e00\u4e0bLoggie\uff0c\u4f46\u4e0d\u77e5\u9053\u5982\u4f55\u5f00\u59cb\uff1f

    \u53ef\u4ee5\u5148\u4ece\u6574\u4f53\u601d\u8003\u4e00\u4e0b\uff1a\u5982\u4f55\u91c7\u96c6\u4e1a\u52a1\u7684\u65e5\u5fd7\uff0c\u5982\u4f55\u5f62\u6210\u4e00\u4e2a\u5b8c\u5584\u5e76\u9002\u5408\u5b9e\u9645\u9700\u6c42\u7684\u65e5\u5fd7\u67b6\u6784\uff1f \u8fd9\u91cc\u6709\u4e00\u4e2a\u53c2\u8003\u3002

    \u63a5\u7740\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u9002\u5408\u7684\u4e1a\u52a1\u300c\u573a\u666f\u300d\uff0c\u67e5\u770bLoggie\u5728Kubernetes\u4e0b\u7684\u6700\u4f73\u5b9e\u8df5\u3002

    \u8fd9\u91cc\u8fd8\u6d89\u53ca\u5230\u5982\u4f55\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u300c\u90e8\u7f72\u300dLoggie\u3002

    \u53e6\u5916\uff0c\u60f3\u67e5\u770b\u5177\u4f53\u7ec4\u4ef6\u7684\u4f7f\u7528\u65b9\u5f0f\uff0c\u8bf7\u53c2\u8003\u300c\u914d\u7f6e\u300d\u3002

    "},{"location":"getting-started/overview/#_3","title":"\u89e3\u7b54","text":"

    \u5728\u4f7f\u7528Loggie\u7684\u65f6\u5019\u9047\u5230\u95ee\u9898\uff1f \u8bf7\u63d0issues\u6216\u8005\u8054\u7cfb\u6211\u4eec\u3002

    \u5fae\u4fe1\u626b\u7801\u52a0\u5165Loggie\u8ba8\u8bba\u7fa4\uff1a\uff08\u8001\u7684\u5fae\u4fe1\u5df2\u6ee1\uff0c\u672a\u901a\u8fc7\u7684\u8bf7\u91cd\u65b0\u626b\u7801\uff09

    "},{"location":"getting-started/overview/#_4","title":"\u53c2\u4e0e","text":"

    \u5982\u679c\u4f60\u5bf9Loggie\u7684\u5177\u4f53\u5b9e\u73b0\u611f\u5174\u8da3\uff0c\u60f3\u53c2\u4e0eLoggie\u5f00\u6e90\u7684\u7814\u53d1\uff1f\u60f3\u81ea\u7814\u63d2\u4ef6\uff1f\u8bf7\u770b\u300c\u5f00\u53d1\u624b\u518c\u300d\u3002

    "},{"location":"getting-started/install/kubernetes/","title":"Kubernetes\u90e8\u7f72","text":""},{"location":"getting-started/install/kubernetes/#loggie-daemonset","title":"\u90e8\u7f72Loggie DaemonSet","text":"

    \u8bf7\u786e\u4fdd\u672c\u5730\u6709kubectl\u548chelm\u53ef\u6267\u884c\u547d\u4ee4\u3002

    "},{"location":"getting-started/install/kubernetes/#helm-chart","title":"\u4e0b\u8f7dhelm-chart\u5305","text":"

    VERSION=v1.4.0\nhelm pull https://github.com/loggie-io/installation/releases/download/$VERSION/loggie-$VERSION.tgz && tar xvzf loggie-$VERSION.tgz\n
    \u8bf7\u5c06\u4ee5\u4e0a\u7684<VERSION>\u66ff\u6362\u6210\u5177\u4f53\u7684\u7248\u672c\u53f7\u3002\u6bd4\u5982v1.4.0\u3002 \u53ef\u4ecerelease tag\u91cc\u627e\u3002

    "},{"location":"getting-started/install/kubernetes/#_1","title":"\u4fee\u6539\u914d\u7f6e","text":"

    \u8fdb\u5165chart\u76ee\u5f55\uff1a

    cd installation/helm-chart\n

    \u67e5\u770bvalues.yml\uff0c\u5e76\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u4fee\u6539\u3002

    \u76ee\u524d\u53ef\u914d\u7f6e\u7684\u53c2\u6570\u5982\u4e0b\u6240\u793a\uff1a

    "},{"location":"getting-started/install/kubernetes/#_2","title":"\u955c\u50cf","text":"

    image: loggieio/loggie:main\n
    loggie\u7684\u955c\u50cf\u3002\u53ef\u4ecedocker hub\u4e2d\u67e5\u770b\u6240\u6709\u955c\u50cf\u3002

    "},{"location":"getting-started/install/kubernetes/#_3","title":"\u8d44\u6e90","text":"

    resources:\nlimits:\ncpu: 2\nmemory: 2Gi\nrequests:\ncpu: 100m\nmemory: 100Mi\n
    Loggie Agent\u7684limit/request\u8d44\u6e90\uff0c\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\u3002

    "},{"location":"getting-started/install/kubernetes/#_4","title":"\u989d\u5916\u542f\u52a8\u53c2\u6570","text":"

    extraArgs: {}\n
    Loggie\u7684\u989d\u5916\u542f\u52a8\u53c2\u6570\uff0c\u6bd4\u5982\u5e0c\u671b\u4fee\u6539\u914d\u7f6e\u4f7f\u7528debug\u7684\u65e5\u5fd7\u7ea7\u522b\uff0c\u4e0d\u4f7f\u7528json\u683c\u5f0f\u7684\u65e5\u5fd7\u6253\u5370\u5f62\u5f0f\uff0c\u53ef\u4ee5\u4fee\u6539\u4e3a:
    extraArgs:\nlog.level: debug\nlog.jsonFormat: false\n

    "},{"location":"getting-started/install/kubernetes/#_5","title":"\u989d\u5916\u6302\u8f7d","text":"

    extraVolumeMounts:\n- mountPath: /var/log/pods\nname: podlogs\n- mountPath: /var/lib/kubelet/pods\nname: kubelet\n- mountPath: /var/lib/docker\nname: docker\n\n\nextraVolumes:\n- hostPath:\npath: /var/log/pods\ntype: DirectoryOrCreate\nname: podlogs\n- hostPath:\npath: /var/lib/kubelet/pods\ntype: DirectoryOrCreate\nname: kubelet\n- hostPath:\npath: /var/lib/docker\ntype: DirectoryOrCreate\nname: docker\n
    \u5efa\u8bae\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u9ed8\u8ba4\u6302\u8f7d\u4ee5\u4e0a\u76ee\u5f55\u3002 \u7279\u522b\u5f3a\u8c03\u7684\u662f\uff1a\u7531\u4e8eLoggie\u672c\u8eab\u4e5f\u662f\u5bb9\u5668\u5316\u90e8\u7f72\uff0c\u6240\u4ee5Loggie\u4e5f\u9700\u8981\u6302\u8f7d\u8282\u70b9\u7684\u4e00\u4e9bvolume\u6765\u91c7\u96c6\u65e5\u5fd7\uff0c\u5426\u5219Loggie\u5bb9\u5668\u5185\u90e8\u770b\u4e0d\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u66f4\u6ca1\u529e\u6cd5\u53bb\u91c7\u96c6\u3002

    \u8fd9\u91cc\u7b80\u5355\u5217\u4e3e\u4e00\u4e0b\u91c7\u96c6\u4ec0\u4e48\u6837\u7684\u65e5\u5fd7\u9700\u8981\u6302\u8f7d\u4ec0\u4e48\u8def\u5f84\uff1a

    volumeMounts:\n- mountPath: /data/logs\nname: logs\n\nvolumes:\n- hostPath:\npath: /data/logs\ntype: DirectoryOrCreate\nname: logs\n
    volumeMounts:\n- mountPath: /var/lib/kubelet/pods\nname: kubelet\n\nvolumes:\n- hostPath:\npath: /var/lib/kubelet/pods\ntype: DirectoryOrCreate\nname: kubelet\n

    \u5176\u4ed6\uff1a

    "},{"location":"getting-started/install/kubernetes/#_6","title":"\u8c03\u5ea6","text":"

    nodeSelector: {}\n\naffinity: {}\n# podAntiAffinity:\n#   requiredDuringSchedulingIgnoredDuringExecution:\n#   - labelSelector:\n#       matchExpressions:\n#       - key: app\n#         operator: In\n#         values:\n#         - loggie\n#     topologyKey: \"kubernetes.io/hostname\"\n
    \u53ef\u4f7f\u7528nodeSelector\u548caffinity\u6765\u63a7\u5236Loggie Pod\u7684\u8c03\u5ea6\uff0c\u5177\u4f53\u8bf7\u53c2\u8003Kubernetes\u6587\u6863\u3002

    tolerations: []\n# - effect: NoExecute\n#   operator: Exists\n# - effect: NoSchedule\n#   operator: Exists\n
    \u5982\u679c\u8282\u70b9\u6709\u81ea\u5df1\u7684taints\uff0c\u4f1a\u5bfc\u81f4Loggie Pod\u65e0\u6cd5\u8c03\u5ea6\u5230\u8be5\u8282\u70b9\uff0c\u5982\u679c\u9700\u8981\u5ffd\u7565taints\uff0c\u53ef\u4ee5\u52a0\u4e0a\u5bf9\u5e94\u7684tolerations\u3002

    "},{"location":"getting-started/install/kubernetes/#_7","title":"\u66f4\u65b0\u7b56\u7565","text":"

    updateStrategy:\ntype: RollingUpdate\n
    \u53ef\u4e3aRollingUpdate\u6216\u8005OnDelete\u3002

    "},{"location":"getting-started/install/kubernetes/#_8","title":"\u5168\u5c40\u914d\u7f6e","text":"

    config:\nloggie:\nreload:\nenabled: true\nperiod: 10s\nmonitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nsink: ~\ndiscovery:\nenabled: true\nkubernetes:\ncontainerRuntime: containerd\nfields:\ncontainer.name: containername\nlogConfig: logconfig\nnamespace: namespace\nnode.name: nodename\npod.name: podname\nhttp:\nenabled: true\nport: 9196\n
    \u5177\u4f53\u53c2\u6570\u8bf4\u660e\u53ef\u53c2\u8003\u7ec4\u4ef6\u914d\u7f6e\u3002 \u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u4f60\u5728\u672c\u5730\u4f7f\u7528Kind\u7b49\u5de5\u5177\u90e8\u7f72Kubernetes\uff0cKind\u9ed8\u8ba4\u4f1a\u4f7f\u7528containerd runtime\uff0c\u6b64\u65f6\u9700\u8981\u5728discovery.kubernetes\u4e2d\u589e\u52a0 containerRuntime: containerd\uff0c\u6307\u5b9a\u5bb9\u5668\u8fd0\u884c\u65f6\u3002

    "},{"location":"getting-started/install/kubernetes/#service","title":"service","text":"

    \u5982\u679cLoggie\u5e0c\u671b\u63a5\u6536\u5176\u4ed6\u670d\u52a1\u53d1\u9001\u7684\u6570\u636e\uff0c\u9700\u8981\u5c06\u81ea\u8eab\u7684\u670d\u52a1\u901a\u8fc7service\u66b4\u9732\u51fa\u6765\u3002

    \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528Agent\u6a21\u5f0f\u7684Loggie\u53ea\u9700\u8981\u66b4\u9732\u81ea\u8eab\u7ba1\u7406\u7aef\u53e3\u3002

    servicePorts:\n- name: monitor\nport: 9196\ntargetPort: 9196\n
    "},{"location":"getting-started/install/kubernetes/#_9","title":"\u90e8\u7f72","text":"

    \u521d\u6b21\u90e8\u7f72\uff0c\u6211\u4eec\u6307\u5b9a\u90e8\u7f72\u5728loggie namespace\u4e0b\uff0c\u5e76\u8ba9helm\u81ea\u52a8\u521b\u5efa\u8be5namespace\u3002

    helm install loggie ./ -nloggie --create-namespace\n

    \u5982\u679c\u4f60\u7684\u73af\u5883\u4e2d\u5df2\u7ecf\u521b\u5efa\u4e86loggie namespace\uff0c\u53ef\u4ee5\u5ffd\u7565\u5176\u4e2d\u7684-nloggie\u548c--create-namespace\u53c2\u6570\u3002\u5f53\u7136\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u81ea\u5df1\u7684namespace\uff0c\u5c06\u5176\u4e2dloggie\u66ff\u6362\u5373\u53ef\u3002

    Kubernetes\u7248\u672c\u95ee\u9898

    failed to install CRD crds/crds.yaml: unable to recognize \"\": no matches for kind \"CustomResourceDefinition\" in version \"apiextensions.k8s.io/v1\"\n
    \u5982\u679c\u4f60\u5728helm install\u7684\u65f6\u5019\u51fa\u73b0\u7c7b\u4f3c\u7684\u95ee\u9898\uff0c\u8bf4\u660e\u4f60\u7684Kubernetes\u7248\u672c\u8f83\u4f4e\uff0c\u4e0d\u652f\u6301apiextensions.k8s.io/v1\u7248\u672cCRD\u3002Loggie\u6682\u65f6\u4fdd\u7559\u4e86v1beta1\u7248\u672c\u7684CRD\uff0c\u8bf7\u5220\u9664charts\u4e2dv1beta1\u7248\u672c\uff0crm loggie/crds/crds.yaml\uff0c\u91cd\u65b0install\u3002

    "},{"location":"getting-started/install/kubernetes/#_10","title":"\u67e5\u770b\u90e8\u7f72\u72b6\u6001","text":"

    \u6267\u884c\u5b8c\u540e\uff0c\u901a\u8fc7\u4f7f\u7528helm\u547d\u4ee4\u6765\u67e5\u770b\u90e8\u7f72\u72b6\u6001\uff1a

    helm list -nloggie\n
    \u7c7b\u4f3c\u5982\u4e0b\u6240\u793a\uff1a
    NAME    NAMESPACE   REVISION    UPDATED                                 STATUS      CHART           APP VERSION\nloggie  loggie      1           2021-11-30 18:06:16.976334232 +0800 CST deployed    loggie-v0.1.0   v0.1.0\n

    \u540c\u65f6\u4e5f\u53ef\u4ee5\u901a\u8fc7kubectl\u547d\u4ee4\u67e5\u770bPod\u662f\u5426\u5df2\u7ecf\u88ab\u521b\u5efa\u3002

    kubectl -nloggie get po\n
    \u7c7b\u4f3c\u5982\u4e0b\u6240\u793a\uff1a
    loggie-sxxwh   1/1     Running   0          5m21s   10.244.0.5   kind-control-plane   <none>           <none>\n

    "},{"location":"getting-started/install/kubernetes/#loggie-aggregator","title":"\u90e8\u7f72Loggie Aggregator","text":"

    \u90e8\u7f72Aggregator\u57fa\u672c\u548cAgent\u4e00\u81f4\uff0c\u5728helm chart\u4e2d\u6211\u4eec\u63d0\u4f9b\u4e86aggregator config\u90e8\u5206\uff0c\u53ea\u9700\u6539\u6210enabled: true\u5373\u53ef\u3002

    helm chart\u4e2d\u63d0\u4f9b\u4e86statefulSet\u7684\u90e8\u7f72\u65b9\u5f0f\uff0c\u4f60\u4e5f\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u4fee\u6539\u6210deployment\u7b49\u65b9\u5f0f\u3002

    \u540c\u65f6\uff0c\u8bf7\u6ce8\u610f\u5728values.yaml\u4e2d\u6839\u636e\u60c5\u51b5\u589e\u52a0\uff1a

    \u6267\u884c\u90e8\u7f72\u547d\u4ee4\u53c2\u8003\uff1a

    helm install loggie-aggregator ./ -nloggie-aggregator --create-namespace\n

    Note

    Loggie\u4e2d\u8f6c\u673a\u540c\u6837\u53ef\u4ee5\u4f7f\u7528Deployment\u6216\u8005StatefulSet\u6765\u90e8\u7f72\uff0c\u8bf7\u53c2\u8003DaemonSet\u81ea\u884c\u4fee\u6539helm chart\u3002

    "},{"location":"getting-started/install/node/","title":"\u4e3b\u673a\u90e8\u7f72","text":"

    Loggie\u4f7f\u7528Golang\u7f16\u8bd1\u6210\u4e8c\u8fdb\u5236\uff0c\u53ef\u6839\u636e\u81ea\u8eab\u9700\u6c42\u5bf9\u63a5\u5404\u7c7b\u90e8\u7f72\u7cfb\u7edf\u3002 \u8fd9\u91cc\u6211\u4eec\u63d0\u4f9b\u4e00\u4e2a\u4f7f\u7528systemd\u90e8\u7f72Loggie\u7684\u53c2\u8003\u3002

    "},{"location":"getting-started/install/node/#_2","title":"\u524d\u7f6e\u68c0\u67e5","text":"

    \u76ee\u524drelease\u4ec5\u5305\u542bGOOS=linux GOARCH=amd64\u751f\u6210\u7684\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6\u3002\u5176\u4ed6\u7cfb\u7edf\u548c\u67b6\u6784\uff0c\u8bf7\u81ea\u884c\u57fa\u4e8e\u6e90\u7801\u4ea4\u53c9\u7f16\u8bd1\u3002

    "},{"location":"getting-started/install/node/#_3","title":"\u4e0b\u8f7d\u4e8c\u8fdb\u5236","text":"
    VERSION=v1.4.0\nmkdir /opt/loggie && curl https://github.com/loggie-io/loggie/releases/download/$VERSION/loggie -o /opt/loggie/loggie && chmod +x /opt/loggie/loggie\n

    \u8bf7\u5c06\u4ee5\u4e0a\u7684<VERSION>\u66ff\u6362\u6210\u5177\u4f53\u7684\u7248\u672c\u53f7\u3002

    "},{"location":"getting-started/install/node/#_4","title":"\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6","text":"

    \u8bf7\u6839\u636e\u5b9e\u9645\u9700\u6c42\u521b\u5efa\u914d\u7f6e\uff0c\u4ee5\u4e0b\u4e3a\u53c2\u8003\uff1a

    "},{"location":"getting-started/install/node/#loggieyml","title":"\u521b\u5efaloggie.yml","text":"

    loggie.yml

    cat << EOF > /opt/loggie/loggie.yml\nloggie:\nmonitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nsink: ~\n\nreload:\nenabled: true\nperiod: 10s\n\nhttp:\nenabled: true\nport: 9196\nEOF\n
    "},{"location":"getting-started/install/node/#pipelinesyml","title":"\u521b\u5efapipelines.yml","text":"

    pipelines.yml

    cat << EOF > /opt/loggie/pipelines.yml\npipelines:\n- name: local\nsources:\n- type: file\nname: demo\npaths:\n- /tmp/log/*.log\nsink:\ntype: dev\nprintEvents: true\ncodec:\npretty: true\nEOF\n
    "},{"location":"getting-started/install/node/#systemd","title":"\u6dfb\u52a0systemd\u914d\u7f6e","text":"
    cat << EOF > /lib/systemd/system/loggie.service\n[Unit]\nDescription=Loggie\nDocumentation=https://loggie-io.github.io/docs/getting-started/install/node/\n\n[Service]\nMemoryMax=200M\nExecStart=/opt/loggie/loggie -config.system=/opt/loggie/loggie.yml -config.pipeline=/opt/loggie/pipelines.yml\nRestart=always\n\n[Install]\nWantedBy=multi-user.target\nEOF\n
    "},{"location":"getting-started/install/node/#_5","title":"\u542f\u52a8","text":"

    \u9996\u5148\u751f\u6548\u914d\u7f6e\uff1a

    systemctl daemon-reload\n

    \u7136\u540e\u8bbe\u7f6e\u4e3a\u5f00\u673a\u542f\u52a8\uff1a

    systemctl enable loggie\n

    \u63a5\u7740\u5c31\u53ef\u4ee5\u6b63\u5f0f\u542f\u52a8Loggie\u4e86\uff1a

    systemctl start loggie\n

    \u542f\u52a8\u540e\uff0c\u4f60\u53ef\u4ee5\u968f\u65f6\u67e5\u770b\u8fdb\u7a0b\u72b6\u6001\uff1a

    systemctl status loggie\n

    "},{"location":"getting-started/intro/core-concept/","title":"\u6838\u5fc3\u6982\u5ff5","text":"

    Loggie\u662f\u4e00\u4e2a\u57fa\u4e8eGolang\u7684\u8f7b\u91cf\u7ea7\u3001\u9ad8\u6027\u80fd\u3001\u4e91\u539f\u751f\u65e5\u5fd7\u91c7\u96c6Agent\u548c\u4e2d\u8f6c\u5904\u7406Aggregator\uff0c\u652f\u6301\u591aPipeline\u548c\u7ec4\u4ef6\u70ed\u63d2\u62d4\uff0c\u63d0\u4f9b\u4e86\uff1a

    "},{"location":"getting-started/intro/core-concept/#_2","title":"\u67b6\u6784","text":""},{"location":"getting-started/intro/core-concept/#_3","title":"\u6982\u5ff5","text":""},{"location":"getting-started/intro/core-concept/#_4","title":"\u6838\u5fc3\u6570\u636e\u6d41","text":""},{"location":"getting-started/intro/core-concept/#_5","title":"\u7ba1\u7406\u4e0e\u63a7\u5236","text":""},{"location":"getting-started/quick-start/kubernetes/","title":"\u5feb\u901f\u4e0a\u624b\uff1a\u91c7\u96c6Kubernetes Pod\u65e5\u5fd7","text":"

    \u4e0b\u9762\u5c06\u5e26\u4f60\u6f14\u793a\u5728\u4e00\u4e2aKubernetes\u96c6\u7fa4\u4e2d\uff0c\u901a\u8fc7\u521b\u5efaLogConfig CRD\u5feb\u901f\u91c7\u96c6Pod\u7684\u65e5\u5fd7\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#1-kubernetes","title":"1. \u51c6\u5907Kubernetes\u73af\u5883","text":"

    \u53ef\u4ee5\u4f7f\u7528\u73b0\u6709Kubernetes\u96c6\u7fa4\uff0c\u6216\u8005\u90e8\u7f72Kubernetes\u3002\u672c\u5730\u63a8\u8350\u4f7f\u7528Kind\u642d\u5efaKubernetes\u96c6\u7fa4\u3002

    \u672c\u6587\u7684\u64cd\u4f5c\u9700\u8981\u5728\u672c\u5730\u4f7f\u7528:

    \u8bf7\u786e\u4fdd\u672c\u5730\u6709kubectl\u548chelm\u53ef\u6267\u884c\u547d\u4ee4\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#2-loggie-daemonset","title":"2. \u90e8\u7f72Loggie DaemonSet","text":"

    \u4f60\u53ef\u4ee5\u5728 installation \u9875\u9762\u67e5\u770b\u6240\u6709\u53d1\u5e03\u7684\u90e8\u7f72chart\u3002

    \u53ef\u4ee5\u9009\u62e9\uff1a

    "},{"location":"getting-started/quick-start/kubernetes/#chart","title":"\u4e0b\u8f7dchart\u518d\u90e8\u7f72","text":"

    VERSION=v1.4.0\nhelm pull https://github.com/loggie-io/installation/releases/download/$VERSION/loggie-$VERSION.tgz && tar xvzf loggie-$VERSION.tgz\n
    \u5c1d\u8bd5\u4fee\u6539\u4e00\u4e0b\u5176\u4e2d\u7684values.yaml\u3002 \u8bf7\u5c06\u4ee5\u4e0a\u7684<VERSION>\u66ff\u6362\u6210\u5177\u4f53\u7684\u7248\u672c\u53f7\u3002

    \u7136\u540e\u90e8\u7f72\u5b89\u88c5\uff1a

    helm install loggie ./loggie -nloggie --create-namespace\n

    \u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\uff1a

    "},{"location":"getting-started/quick-start/kubernetes/#_1","title":"\u76f4\u63a5\u90e8\u7f72\uff1a","text":"

    helm install loggie -nloggie --create-namespace https://github.com/loggie-io/installation/releases/download/$VERSION/loggie-$VERSION.tgz\n
    \u8bf7\u5c06\u4ee5\u4e0a\u7684<VERSION>\u66ff\u6362\u6210\u5177\u4f53\u7684\u7248\u672c\u53f7\u3002

    \u60f3\u4f7f\u7528\u5176\u4ed6\u7248\u672c\u955c\u50cf\uff1f

    \u4e3a\u4e86\u65b9\u4fbf\u4f53\u9a8c\u6700\u65b0\u7684Fix\u548c\u7279\u6027\uff0c\u6211\u4eec\u63d0\u4f9b\u4e86main\u5206\u652f\u6bcf\u6b21\u5408\u5e76\u540e\u7684\u955c\u50cf\u7248\u672c\uff0c\u53ef\u901a\u8fc7 \u8fd9\u91cc \u8fdb\u884c\u9009\u62e9\u3002 \u540c\u65f6\u4f60\u53ef\u4ee5\u5728helm install\u547d\u4ee4\u4e2d\u589e\u52a0--set image=loggieio/loggie:vX.Y.Z\u6765\u6307\u5b9a\u5177\u4f53\u7684Loggie\u955c\u50cf\u3002

    \u90e8\u7f72\u6709\u95ee\u9898\uff1f

    \u5982\u679c\u5c1d\u8bd5\u90e8\u7f72\u540e\u51fa\u73b0\u95ee\u9898\uff0c\u6216\u8005\u5728\u4f60\u7684\u73af\u5883\u4e2d\u4ee5\u4e0b\u6f14\u793a\u64cd\u4f5c\u672a\u6210\u529f\uff0c\u8bf7\u53c2\u8003Kubernetes\u4e0b\u90e8\u7f72Loggie\uff0c\u4fee\u6539\u76f8\u5173\u914d\u7f6e\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#3","title":"3. \u91c7\u96c6\u65e5\u5fd7","text":"

    Loggie\u5b9a\u4e49\u4e86Kubernetes CRD LogConfig\uff0c\u4e00\u4e2aLogConfig\u8868\u793a\u91c7\u96c6\u4e00\u7c7bPods\u7684\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#31-pods","title":"3.1 \u521b\u5efa\u88ab\u91c7\u96c6\u7684Pods","text":"

    \u6211\u4eec\u5148\u521b\u5efa\u4e00\u4e2aPod\u7528\u4e8e\u88ab\u91c7\u96c6\u65e5\u5fd7\u7684\u5bf9\u8c61\u3002

    kubectl create deploy nginx --image=nginx\n
    \u63a5\u4e0b\u6765\u5c06\u91c7\u96c6\u8fd9\u4e2aNginx Pod\u7684\u6807\u51c6\u8f93\u51fastdout\u65e5\u5fd7\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#32-sink","title":"3.2 \u5b9a\u4e49\u8f93\u51fa\u6e90Sink","text":"

    \u63a5\u7740\uff0c\u6211\u4eec\u521b\u5efa\u4e00\u4e2aLoggie\u5b9a\u4e49\u7684CRD Sink\u5b9e\u4f8b\uff0c\u8868\u660e\u65e5\u5fd7\u53d1\u9001\u7684\u540e\u7aef\u3002 \u4e3a\u4e86\u65b9\u4fbf\u6f14\u793a\uff0c\u8fd9\u91cc\u6211\u4eec\u5c06\u65e5\u5fd7\u53d1\u9001\u81f3Loggie Agent\u81ea\u8eab\u7684\u65e5\u5fd7\u4e2d\u5e76\u6253\u5370\u3002

    cat << EOF | kubectl apply -f -\napiVersion: loggie.io/v1beta1\nkind: Sink\nmetadata:\nname: default\nspec:\nsink: |\ntype: dev\nprintEvents: true\nEOF\n

    \u53ef\u4ee5\u901a\u8fc7kubectl get sink\u67e5\u770b\u5230\u5df2\u521b\u5efa\u7684Sink\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#33","title":"3.3 \u5b9a\u4e49\u91c7\u96c6\u4efb\u52a1","text":"

    Loggie\u5b9a\u4e49CRD LogConfig\uff0c\u8868\u793a\u4e00\u4e2a\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\u3002\u6211\u4eec\u521b\u5efa\u4e00\u4e2aLogConfig\u793a\u4f8b\u5982\u4e0b\u6240\u793a\uff1a

    cat << EOF | kubectl apply -f -\napiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: nginx\nnamespace: default\nspec:\nselector:\ntype: pod\nlabelSelector:\napp: nginx\npipeline:\nsources: |\n- type: file\nname: mylog\npaths:\n- stdout\nsinkRef: default\nEOF\n

    \u53ef\u4ee5\u770b\u5230\uff0c\u4e0a\u9762\u4f7f\u7528\u4e86sinkRef\u5f15\u7528\u4e86\u521a\u624d\u521b\u5efa\u7684sink default CR\u3002\u5f53\u7136\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u76f4\u63a5\u5728Logconfig\u4e2d\u4f7f\u7528sink\u5b57\u6bb5\uff0c\u793a\u4f8b\u5982\u4e0b\uff1a

    cat << EOF | kubectl apply -f -\napiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: nginx\nnamespace: default\nspec:\nselector:\ntype: pod\nlabelSelector:\napp: nginx\npipeline:\nsources: |\n- type: file\nname: mylog\npaths:\n- stdout\nsink: |\ntype: dev\nprintEvents: true\ncodec:\ntype: json\npretty: true\nEOF\n

    \u521b\u5efa\u5b8c\u4e4b\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528kubectl get lgc\u67e5\u770b\u5230\u521b\u5efa\u7684CRD\u5b9e\u4f8b\u3002

    \u540c\u65f6\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u901a\u8fc7kubectl describe lgc nginx\u67e5\u770bLogConfig\u7684\u4e8b\u4ef6\uff0c\u4ee5\u83b7\u53d6\u6700\u65b0\u7684\u72b6\u6001\u3002

    Events:\n  Type    Reason       Age   From                       Message\n  ----    ------       ----  ----                       -------\n  Normal  syncSuccess  52s   loggie/kind-control-plane  Sync type pod [nginx-6799fc88d8-5cb67] success\n

    \u4e0a\u9762\u7684nginx LogConfig\u901a\u8fc7\u5176\u4e2d\u7684spec.selector\u6765\u5339\u914d\u91c7\u96c6\u54ea\u4e9bPod\u7684\u65e5\u5fd7\uff0c\u8fd9\u91cc\u6211\u4eec\u4f7f\u7528app: nginx\u9009\u62e9\u4e86\u521a\u624d\u521b\u5efa\u7684nginx Pod\u3002 spec.pipeline\u5219\u8868\u793aLoggie\u7684Pipeline\u914d\u7f6e\uff0c\u6211\u4eec\u53ea\u91c7\u96c6\u5bb9\u5668\u6807\u51c6\u8f93\u51fa\u7684\u65e5\u5fd7\uff0c\u6240\u4ee5\u5728paths\u4e2d\u586b\u5199stdout\u5373\u53ef\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#4","title":"4. \u67e5\u770b\u65e5\u5fd7","text":"

    \u9996\u5148\u627e\u5230\u6240\u5728\u7684nginx pod\u8282\u70b9\uff1a

    kubectl get po -owide -l app=nginx\n

    \u7136\u540e\u6211\u4eec\u627e\u5230\u8be5\u8282\u70b9\u7684Loggie\uff1a

    kubectl -nloggie get po -owide |grep ${node}\n
    \u53ef\u4ee5\u901a\u8fc7\uff1a
    kubectl -nloggie logs -f ${logge-pod}\n
    \u67e5\u770bLoggie\u6253\u5370\u51fa\u7684\u65e5\u5fd7\uff0c\u91cc\u9762\u5c55\u793a\u4e86\u91c7\u96c6\u5230\u7684nginx\u6807\u51c6\u8f93\u51fa\u65e5\u5fd7\u3002

    "},{"location":"getting-started/quick-start/kubernetes/#_2","title":"\u66f4\u591a","text":"

    \u4e0a\u6587\u53ea\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u5feb\u901f\u6f14\u793a\uff0c\u90e8\u7f72\u51fa\u73b0\u95ee\u9898\u6216\u8005\u60f3\u4e86\u89e3\u66f4\u591aKubernetes\u4e0bLoggie\u5982\u4f55\u4f7f\u7528\uff1f

    "},{"location":"getting-started/quick-start/node/","title":"\u5feb\u901f\u4e0a\u624b\uff1a\u8282\u70b9\u65e5\u5fd7\u91c7\u96c6","text":"

    \u4e0b\u9762\u6211\u4eec\u5c06\u6f14\u793a\u4e00\u4e2a\u6700\u7b80\u5355\u7684\u91c7\u96c6\u8282\u70b9\u65e5\u5fd7\u6587\u4ef6\u7684\u573a\u666f\u3002

    "},{"location":"getting-started/quick-start/node/#1","title":"1. \u4e0b\u8f7d\u53ef\u6267\u884c\u6587\u4ef6","text":"

    \u8bf7\u627e\u4e00\u53f0Linux\u670d\u52a1\u5668\u8282\u70b9\uff0c\u4e0b\u8f7dLoggie\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6

    VERSION=v1.4.0\ncurl -LJ https://github.com/loggie-io/loggie/releases/download/$VERSION/loggie -o loggie\n

    \u8bf7\u5c06\u4ee5\u4e0a\u7684<VERSION>\u66ff\u6362\u6210\u5177\u4f53\u7684\u7248\u672c\u53f7\u3002

    "},{"location":"getting-started/quick-start/node/#2","title":"2. \u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6","text":"

    \u6211\u4eec\u5148\u4f7f\u7528dev sink\u5c06file source\u91c7\u96c6\u7684\u65e5\u5fd7\u6587\u4ef6\u6253\u5370\u5230\u6807\u51c6\u8f93\u51fa\uff0c\u590d\u5236\u4ee5\u4e0b\u5185\u5bb9\u4e3apipelines.yml\u6587\u4ef6\uff1a

    pipelines.yml

    cat << EOF > pipelines.yml\npipelines:\n- name: demo\nsources:\n- type: file\nname: mylog\npaths:\n- \"/var/log/*.log\"\nsink:\ntype: dev\nprintEvents: true\nEOF\n
    \u8fd9\u91cc\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u79f0\u4e3ademo\u7684pipeline\uff0c\u7136\u540e\u5b9a\u4e49\u4e86\u4e00\u4e2a\u7c7b\u578b\u4e3afile\u7684source\u8f93\u5165\u6e90\u7ec4\u4ef6\uff0c\u8868\u793a\u9700\u8981\u91c7\u96c6\u5728/var/log\u76ee\u5f55\u4e0b\u6ee1\u8db3*.log\u5339\u914d\u89c4\u5219\u7684\u65e5\u5fd7\u6587\u4ef6\u3002\u6587\u4ef6\u91c7\u96c6\u540e\uff0c\u6587\u4ef6\u4f1a\u88ab\u53d1\u9001\u81f3dev sink\u8f93\u51fa\u6e90\uff0c\u8be5sink\u4ec5\u4ec5\u5c06\u91c7\u96c6\u7684\u6587\u4ef6\u6253\u5370\u5230\u6807\u51c6\u8f93\u51fa\u3002

    pipeline\u6587\u4ef6\u8868\u793a\u6211\u4eec\u60f3\u8981\u7684\u8f93\u5165\u3001\u8f93\u51fa\u7b49\u4e1a\u52a1\u76f8\u5173\u7684\u914d\u7f6e\uff0c\u9664\u4e86pipeline\u914d\u7f6e\u6587\u4ef6\u5916\uff0cLoggie\u8fd8\u9700\u8981\u6709\u4e00\u4e2a\u5168\u5c40\u7684\u914d\u7f6e\u6587\u4ef6\u3002

    // loggie.yml\ncat << EOF > loggie.yml\nloggie:\nreload:\nenabled: true\nperiod: 10s\nEOF\n

    \u8fd9\u91cc\u6211\u4eec\u53ea\u5c55\u793a\u4e86\u4e00\u4e2a\u6bd4\u8f83\u7b80\u5355\u7684\u914d\u7f6e\uff0c\u8868\u793a\u6253\u5f00loggie\u7684\u52a8\u6001\u914d\u7f6ereload\u529f\u80fd\uff0c\u540c\u65f6\u95f4\u9694\u68c0\u67e5\u65f6\u95f4\u4e3a10s\u3002

    \u5728\u8282\u70b9\u4e0a\u589e\u52a0\u4ee5\u4e0a\u4e24\u4e2a\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f00\u59cb\u542f\u52a8Loggie\u4e86\u3002

    "},{"location":"getting-started/quick-start/node/#3","title":"3. \u8fd0\u884c","text":"
    ./loggie -config.system=./loggie.yml -config.pipeline=./pipelines.yml -log.jsonFormat=false\n

    \u542f\u52a8\u53c2\u6570\u91cc\uff0c\u586b\u5165\u4e0a\u9762\u7684loggie.yml\u548cpipelines.yml\u7684\u6587\u4ef6\u8def\u5f84\u3002

    \u770b\u5230\u6b63\u5e38\u7684\u542f\u52a8\u65e5\u5fd7\u540e\uff0c\u8868\u660eLoggie\u5c31\u5f00\u59cb\u6b63\u5e38\u7684\u5de5\u4f5c\u4e86\u3002\u540c\u65f6\u8282\u70b9/var/log/*.log\u4e0b\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u90fd\u4f1a\u88ab\u6253\u5370\u5230\u6807\u51c6\u8f93\u51fa\u3002

    "},{"location":"getting-started/quick-start/quick-start/","title":"\u5feb\u901f\u4e0a\u624b","text":"

    Loggie\u662f\u4e00\u4e2a\u65e5\u5fd7\u91c7\u96c6Agent\u548c\u4e2d\u8f6c\u5904\u7406\u7684Aggregator\uff0c\u5305\u542b\u591a\u4e2aPipeline\u7ba1\u9053\uff0c\u6bcf\u4e2aPipeline\u53c8\u7531Source\u8f93\u5165\u3001Interceptor\u62e6\u622a\u5904\u7406\u548cSink\u8f93\u51fa\u7ec4\u6210\u3002

    \u57fa\u4e8e\u8fd9\u79cd\u63d2\u4ef6\u5f0f\u8bbe\u8ba1\uff0cLoggie\u5e76\u4e0d\u5c40\u9650\u5728\u65e5\u5fd7\u91c7\u96c6\uff0c\u901a\u8fc7\u914d\u7f6e\u4e0d\u540c\u7684Source/Interceptor/Sink\uff0cLoggie\u53ef\u4ee5\u7ec4\u5408\u5b9e\u73b0\u5404\u79cd\u4e0d\u540c\u7684\u529f\u80fd\u3002

    \u7b80\u5355\u8d77\u89c1\uff0c\u8fd9\u91cc\u6211\u4eec\u4ece\u91c7\u96c6\u65e5\u5fd7\u5f00\u59cb\u3002

    \u9009\u62e9\u4f60\u7684\u90e8\u7f72\u73af\u5883\uff1a

    "},{"location":"getting-started/quick-start/quick-start/#kubernetes","title":"Kubernetes","text":""},{"location":"getting-started/quick-start/quick-start/#_2","title":"\u4e3b\u673a","text":""},{"location":"reference/","title":"Overview","text":""},{"location":"reference/#_1","title":"\u914d\u7f6e","text":"

    Loggie\u7684\u914d\u7f6e\u4e3b\u8981\u5206\u4e3a\u4e24\u7c7b\uff1a

    "},{"location":"reference/#_2","title":"\u7cfb\u7edf\u914d\u7f6e","text":"

    \u5168\u5c40\u7684\u7cfb\u7edf\u914d\u7f6e\uff0c\u542f\u52a8\u53c2\u6570\u4e2d\u4f7f\u7528-config.system\u6307\u5b9a\uff0c\u5305\u542b\u5982\u4e0b\uff1a

    loggie.yml
    # loggie.yml\nloggie:\nmonitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nsink: ~\n\ndiscovery:\nenabled: false\n\nreload:\nenabled: true\nperiod: 10s\n\ndefaults:\nsink:\ntype: dev\nhttp:\nenabled: true\nport: 9196\n
    "},{"location":"reference/#pipeline","title":"Pipeline\u914d\u7f6e","text":"

    Pipeline\u7684\u914d\u7f6e\uff0c\u901a\u8fc7\u542f\u52a8\u53c2\u6570-config.pipeline\u6307\u5b9a\u3002\u8868\u793a\u961f\u5217\u4f7f\u7528\u7684Source\u3001Sink\u3001Queue\u548cInterceptor\u3002

    pipeline.yml
    pipelines:\n- name: demo # pipeline name\u5fc5\u586b\nsources:\n- type: ${sourceType}\nname: access # source\u4e2dname\u5fc5\u586b\n...\ninterceptors:\n- type: ${interceptorType}\n...\nsink:\ntype: ${sinkType}\n...\n
    "},{"location":"reference/#kubernetes-crd","title":"Kubernetes CRD","text":"

    Loggie\u5b9a\u4e49\u4e86\u4ee5\u4e0b\u51e0\u4e2aCRD\u7528\u4e8e\u5728Kubernetes\u96c6\u7fa4\u73af\u5883\u91cc\u4e0b\u53d1\u914d\u7f6e\uff1a

    Note

    ClusterLogConfig/LogConfig\u4e2d\u7684pipeline\u53ef\u4ee5\u5b9a\u4e49sink\u548cinterceptor\uff0c\u7528\u4e8e\u8be5pipeline\u7684sink/interceptor\u3002 \u5982\u679c\u4f60\u5e0c\u671b\u5728\u591a\u4e2aClusterLogConfig/LogConfig\u4e2d\u590d\u7528sink\u6216\u8005interceptor\uff0c\u53ef\u4ee5\u521b\u5efaSink/Interceptor CR\uff0c\u5728ClusterLogConfig/LogConfig\u4e2d\u4f7f\u7528sinkRef/interceptorRef\u8fdb\u884c\u5f15\u7528\u3002

    "},{"location":"reference/apis/config/","title":"Pipeline config\u914d\u7f6e\u76f8\u5173\u63a5\u53e3","text":""},{"location":"reference/apis/config/#apiv1reloadconfig","title":"/api/v1/reload/config","text":""},{"location":"reference/apis/config/#url","title":"URL","text":"
    GET /api/v1/reload/config\n
    "},{"location":"reference/apis/config/#_1","title":"\u63cf\u8ff0","text":"

    \u67e5\u770bLoggie\u78c1\u76d8\u4e0a\u7684Pipeline\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9\u3002 \u6240\u4ee5\u6bcf\u6b21\u8c03\u7528\u8be5\u63a5\u53e3\u90fd\u4f1a\u4eceLoggie\u542f\u52a8\u53c2\u6570-config.pipeline\u4e2d\u6307\u5b9a\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bfb\u53d6\u4e00\u6b21\u3002 \u4f46\u662f\u8be5\u914d\u7f6e\u6587\u4ef6\u5e76\u4e0d\u4e00\u5b9a\u662f\u5f53\u524dLoggie\u5185\u5b58\u4e2d\u6240\u8bfb\u53d6\u5230\u7684\u914d\u7f6e\uff0c\u56e0\u4e3a\u5b58\u5728reload\u95f4\u9694\u65f6\u95f4\u3001\u914d\u7f6e\u6587\u4ef6\u683c\u5f0f\u9519\u8bef\u7b49\u60c5\u51b5\u3002

    "},{"location":"reference/apis/config/#_2","title":"\u8bf7\u6c42\u53c2\u6570","text":"

    \u65e0

    "},{"location":"reference/apis/config/#_3","title":"\u8fd4\u56de","text":"

    Pipeline\u914d\u7f6e\u6587\u4ef6\u6587\u672c\u5185\u5bb9\u3002

    "},{"location":"reference/apis/config/#apiv1controllerpipelines","title":"/api/v1/controller/pipelines","text":""},{"location":"reference/apis/config/#url_1","title":"URL","text":"
    GET /api/v1/controller/pipelines\n
    "},{"location":"reference/apis/config/#_4","title":"\u63cf\u8ff0","text":"

    \u67e5\u770bLoggie\u5185\u5b58\u4e2d\u88ab\u8bfb\u53d6\u5230\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4e5f\u662f\u6b63\u5728\u8fd0\u884c\u7684Pipeline\u914d\u7f6e\u3002 \u8be5\u63a5\u53e3\u8fd4\u56de\u7684\u914d\u7f6e\u5185\u5bb9\u548chelp\u63a5\u53e3\u4e2d\u7684\u4e00\u81f4\u3002

    "},{"location":"reference/apis/config/#_5","title":"\u8bf7\u6c42\u53c2\u6570","text":"

    \u65e0

    "},{"location":"reference/apis/config/#_6","title":"\u8fd4\u56de","text":"

    Pipeline\u914d\u7f6e\u6587\u4ef6\u6587\u672c\u5185\u5bb9\u3002

    "},{"location":"reference/apis/help/","title":"help\u63a5\u53e3","text":""},{"location":"reference/apis/help/#apiv1help","title":"/api/v1/help","text":""},{"location":"reference/apis/help/#url","title":"URL","text":"
    GET /api/v1/help\n
    "},{"location":"reference/apis/help/#_1","title":"\u63cf\u8ff0","text":"

    \u67e5\u8be2\u8be5Loggie Agent\u7684\u5185\u90e8\u914d\u7f6e\u65e5\u5fd7\u91c7\u96c6\u72b6\u6001

    "},{"location":"reference/apis/help/#_2","title":"\u8bf7\u6c42\u53c2\u6570","text":"

    \u793a\u4f8b\uff1a

    /api/v1/help?pipeline=test&status=pending\n
    \u8868\u793a\u53ea\u8fd4\u56depipeline\u4e3atest\u7684\u6b63\u5728\u91c7\u96c6\u7684\u6240\u6709\u65e5\u5fd7\u6587\u4ef6\u72b6\u6001

    "},{"location":"reference/apis/help/#_3","title":"\u8fd4\u56de","text":"

    \u793a\u4f8b\u5982\u4e0b\uff1a

    --------- Usage: -----------------------\n|--- view details: /api/v1/help?detail=<module>, module is one of: pipeline/log\n|--- query by pipeline name: /api/v1/help?pipeline=<name>\n|--- query by source name: /api/v1/help?source=<name>\n\n--------- Pipeline Status: --------------\nall 1 pipelines running\n  * pipeline: local, sources: [demo]\n\n\u2705 pipeline configurations consistency check passed\n\npipelines:\n- name: local\ncleanDataTimeout: 5s\n  queue:\n    type: channel\n  interceptors:\n  - name: global\n    type: schema\n    addMeta:\n      timestamp:\n        key: '@timestamp'\norder: 700\n- type: metric\n  - type: maxbytes\n  - type: retry\n  sources:\n  - name: demo\n    type: file\n    fieldsUnderKey: fields\n    fields:\n      topic: loggie\n    paths:\n    - /tmp/log/*.log\n    watcher:\n      maxOpenFds: 6000\nsink:\n    type: dev\n    parallelism: 1\ncodec:\n      type: json\n      printEvents: true\npretty: true\n\n| more details:\n|--- pipelines configuration in the path ref: /api/v1/reload/config\n|--- current running pipelines configuration ref: /api/v1/controller/pipelines\n\n--------- Log Collection Status: ---------\n\nall activeFdCount: 0, inActiveFdCount: 1\n\n> pipeline * source - filename | progress(offset/size) | modify\n  > local\n* demo\n      - /tmp/log/app.log | 100.00%(189/189) | 2023-07-17T17:10:33+08:00\n\n| more details:\n|--- registry storage ref: /api/v1/source/file/registry\n
    "},{"location":"reference/apis/help/#apiv1helplog","title":"/api/v1/help/log","text":""},{"location":"reference/apis/help/#url_1","title":"URL","text":"
    GET /api/v1/help/log\n
    "},{"location":"reference/apis/help/#_4","title":"\u63cf\u8ff0","text":"

    \u67e5\u8be2\u8be5Loggie Agent\u7684\u65e5\u5fd7\u91c7\u96c6\u72b6\u6001

    "},{"location":"reference/apis/help/#_5","title":"\u8bf7\u6c42\u53c2\u6570","text":"

    \u793a\u4f8b\uff1a

    /api/v1/help/log?pipeline=test&status=pending\n
    \u8868\u793a\u53ea\u8fd4\u56depipeline\u4e3atest\u7684\u6b63\u5728\u91c7\u96c6\u7684\u6240\u6709\u65e5\u5fd7\u6587\u4ef6\u72b6\u6001

    "},{"location":"reference/apis/help/#_6","title":"\u8fd4\u56de\u53c2\u6570","text":"\u53c2\u6570\u540d\u79f0 \u8bf4\u660e \u53c2\u6570\u7c7b\u578b \u5907\u6ce8 fdStatus \u6587\u4ef6\u53e5\u67c4\u72b6\u6001 fdStatus.activeFdCount \u6d3b\u8dc3\u7684fd\u4e2a\u6570 int fdStatus.inActiveFdCount \u4e0d\u6d3b\u8dc3\u7684fd\u4e2a\u6570 int fileStatus \u6587\u4ef6\u91c7\u96c6\u72b6\u6001 fileStatus.pipeline.<name> \u7ba1\u9053\u72b6\u6001\uff0c\u5bf9\u5e94\u914d\u7f6e\u4e2d\u7684pipeline name\uff0c\u53c2\u8003\u4e0b\u9762\u7684pipeline\u53c2\u6570 map"},{"location":"reference/apis/help/#pipeline","title":"pipeline","text":"\u53c2\u6570\u540d\u79f0 \u8bf4\u660e \u53c2\u6570\u7c7b\u578b \u5907\u6ce8 source.<name> pipeline\u4e2dsource\u7684\u72b6\u6001\uff0c\u53c2\u8003\u4e0b\u9762\u7684source\u53c2\u6570 map"},{"location":"reference/apis/help/#source","title":"source","text":"\u53c2\u6570\u540d\u79f0 \u8bf4\u660e \u53c2\u6570\u7c7b\u578b \u5907\u6ce8 paths \u914d\u7f6e\u6587\u4ef6source\u4e2d\u5b9a\u4e49\u7684path string\u6570\u7ec4 detail pipeline\u4e2dsource\u7684\u72b6\u6001 \u6570\u7ec4 detail[n].filename \u6587\u4ef6\u540d\u79f0 string detail[n].offset \u91c7\u96c6\u8fdb\u5ea6offset int detail[n].size \u6587\u4ef6\u5927\u5c0f int detail[n].modify \u6587\u4ef6\u6700\u8fd1\u7684\u66f4\u65b0\u65f6\u95f4 int unix milliseconds detail[n].ignored \u6587\u4ef6\u662f\u5426\u88ab\u5ffd\u7565\uff08\u7531file source\u4e2d\u7684ignoreOlder\u914d\u7f6e\u51b3\u5b9a\uff09 bool

    Example

    {\n\"fdStatus\": {\n\"activeFdCount\": 0,\n\"inActiveFdCount\": 1\n},\n\"fileStatus\": {\n\"pipeline\": {\n\"local\": {\n\"source\": {\n\"demo\": {\n\"paths\": [\n\"/tmp/log/*.log\"\n],\n\"detail\": [\n{\n\"filename\": \"/tmp/log/access.log\",\n\"offset\": 469,\n\"size\": 469,\n\"modify\": 1673436846523,\n\"ignored\": false\n}\n]\n}\n}\n}\n}\n}\n}\n
    "},{"location":"reference/apis/registry/","title":"registry\u6301\u4e45\u5316\u5b58\u50a8\u63a5\u53e3","text":""},{"location":"reference/apis/registry/#apiv1sourcefileregistry","title":"/api/v1/source/file/registry","text":""},{"location":"reference/apis/registry/#url","title":"URL","text":"
    GET /api/v1/source/file/registry\n
    "},{"location":"reference/apis/registry/#_1","title":"\u63cf\u8ff0","text":"

    \u67e5\u8be2Loggie\u5728\u672c\u8282\u70b9\u4e0b\u6587\u4ef6\u7684\u6301\u4e45\u5316\u91c7\u96c6\u8fdb\u5ea6\u3002 Loggie\u4f1a\u5c06\u6587\u4ef6\u91c7\u96c6\u4e86\u591a\u5c11\u7684\u8fdb\u5ea6\u7b49\u4fe1\u606f\u6301\u4e45\u5316\u5230\u672c\u5730\uff0c\u5982\u679cLoggie\u53d1\u751f\u4e86\u91cd\u542f\uff0c\u4f1a\u4ece\u6587\u4ef6\u8bb0\u5f55\u7684\u8fdb\u5ea6offset\u5f00\u59cb\u91c7\u96c6\uff0c\u907f\u514d\u91cd\u5934\u5f00\u59cb\u91c7\u96c6\u6587\u4ef6\u3002

    "},{"location":"reference/apis/registry/#_2","title":"\u8bf7\u6c42\u53c2\u6570","text":"

    \u793a\u4f8b\uff1a

    /api/v1/source/file/registry?format=text\n
    "},{"location":"reference/apis/registry/#_3","title":"\u8fd4\u56de","text":"

    \u793a\u4f8b\uff1a

    {Id:1 PipelineName:local SourceName:demo Filename:/tmp/log/app2.log JobUid:75064440-16777234 Offset:259 CollectTime:2023-07-17 20:19:04.846 Version:0.0.1 LineNumber:9} {Id:2 PipelineName:local SourceName:demo Filename:/tmp/log/app.log JobUid:75610913-16777234 Offset:0 CollectTime:2023-07-17 20:19:12.343 Version:0.0.1 LineNumber:0} 

    "},{"location":"reference/apis/version/","title":"version\u7248\u672c\u63a5\u53e3","text":""},{"location":"reference/apis/version/#url","title":"URL","text":"
    GET /version\n
    "},{"location":"reference/apis/version/#_1","title":"\u63cf\u8ff0","text":"

    \u67e5\u770bLoggie\u7248\u672c

    "},{"location":"reference/apis/version/#_2","title":"\u8bf7\u6c42\u53c2\u6570","text":"

    \u65e0

    "},{"location":"reference/apis/version/#_3","title":"\u8fd4\u56de\u53c2\u6570","text":"

    \u76f4\u63a5\u8fd4\u56deLoggie\u7684\u7248\u672c\u540d\u79f0\u3002

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/","title":"ClusterLogConfig","text":"

    Cluster\u7ea7\u522bCRD\uff0c\u53ef\u7528\u4e8e\uff1a

    Example

    apiVersion: loggie.io/v1beta1\nkind:  ClusterLogConfig\nmetadata:\nname: test\nspec:\nselector:\ntype: node\nnodeSelector:\nnodepool: test\npipeline:\nsources: |\n- type: file\nname: messages\npaths:\n- /var/log/messages\nsinkRef: default\n
    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#specselector","title":"spec.selector","text":"

    \u8868\u793aPipeline\u914d\u7f6e\u9002\u7528\u7684\u8303\u56f4

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#specnamespaceselector","title":"spec.namespaceSelector","text":"

    \u6280\u672f\u63d0\u4f9b\u65b9\uff1a\u64ce\u521b\u79d1\u6280

    \u8868\u793a\u5339\u914d\u6307\u5b9a\u547d\u540d\u7a7a\u95f4\u4e0b\u7684\u5168\u90e8POD

    !!! example

      namespaceSelector:\n- test1\n- test2\n

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#specexcludenamespaceselector","title":"spec.excludeNamespaceSelector","text":"

    \u6280\u672f\u63d0\u4f9b\u65b9\uff1a\u64ce\u521b\u79d1\u6280

    \u8868\u793a\u6392\u9664\u6307\u5b9a\u547d\u540d\u7a7a\u95f4\u4e0b\u7684\u5168\u90e8POD

    Example

      excludeNamespaceSelector:\n- test1\n- test2\n
    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#type-pod","title":"type: pod","text":"

    \u901a\u8fc7Pipeline\u914d\u7f6e\u9009\u62e9\u4e00\u6279Pod\u8fdb\u884c\u65e5\u5fd7\u91c7\u96c6

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 labelSelector map \u5fc5\u586b \u901a\u8fc7\u8be5label\u6765\u5339\u914dPods\uff0c\u652f\u6301\u4f7f\u7528*\u6765\u5339\u914d\u6240\u6709\u7684value\uff0c\u6bd4\u5982app: '*'

    Example

    spec: selector:\ntype: pod\nlabelSelector:\napp: nginx\n
    \u8868\u793a\u91c7\u96c6\u5e26\u6709\u6807\u7b7e app: nginx\u7684\u6240\u6709Pod\u7684\u65e5\u5fd7\u3002

    Warning

    \u5728type: pod\u65f6\uff0c\u4e0b\u9762\u7684Pipeline\u53ea\u80fd\u4f7f\u7528file source\uff0c\u6b64\u65f6\u7684\u573a\u666f\u53ea\u80fd\u662f\u91c7\u96c6\u65e5\u5fd7\u3002

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#type-node","title":"type: node","text":"

    \u4e0b\u53d1Pipeline\u914d\u7f6e\u81f3\u8be5\u6279\u8282\u70b9\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 nodeSelector map \u5fc5\u586b \u901a\u8fc7label\u9009\u62e9\u4e0b\u53d1\u914d\u7f6e\u7684node

    Example

    spec: selector:\ntype: node\nnodeSelector:\nnodepool: test\n
    \u8868\u793a\u5c06\u914d\u7f6e\u7684Pipelines\u4e0b\u53d1\u81f3\u5e26\u6709nodepool: test\u7684\u6240\u6709node\u4e0a\u3002

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#type-cluster","title":"type: cluster","text":"

    \u4e0b\u53d1Pipeline\u914d\u7f6e\u81f3\u67d0\u4e2aLoggie\u96c6\u7fa4\uff0c\u901a\u5e38\u9700\u8981\u914d\u5408cluster\u5b57\u6bb5\u6307\u5b9a\u96c6\u7fa4\u540d\u4f7f\u7528\u3002

    Example

    spec:\nselector:\ncluster: aggregator\ntype: cluster\n
    \u8868\u793a\u5c06\u914d\u7f6e\u7684Pipelines\u4e0b\u53d1\u81f3cluster\u4e3aaggregator\u7684Loggie\u96c6\u7fa4\u3002

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#type-workload","title":"type: workload","text":"

    \u6280\u672f\u63d0\u4f9b\u65b9\uff1a\u64ce\u521b\u79d1\u6280

    \u901a\u8fc7Pipeline\u914d\u7f6e\u9009\u62e9\u4e00\u6279\u8d1f\u8f7d\u8fdb\u884c\u65e5\u5fd7\u91c7\u96c6

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 type array \u975e\u5fc5\u586b \u76ee\u524d\u652f\u6301Deployment\u3001DaemonSet\u3001CronJob\u3001Job\u3001StatefulSet\uff0c\u4e0d\u5199\u5c31\u662f\u5168\u90e8 nameSelector array \u975e\u5fc5\u586b \u8d1f\u8f7d\u540d\u5b57\uff0c\u4e0d\u5199\u5c31\u662f\u5168\u90e8 namespaceSelector array \u975e\u5fc5\u586b \u547d\u540d\u7a7a\u95f4\uff0c\u53ea\u5339\u914d\u6307\u5b9a\u547d\u540d\u7a7a\u95f4\u4e0b\u7684\u8d1f\u8f7d\uff0c\u4e0d\u5199\u5c31\u662f\u5168\u90e8 excludeNamespaceSelector array \u975e\u5fc5\u586b \u6392\u9664\u4e00\u90e8\u5206\u547d\u540d\u7a7a\u95f4

    Example

    apiVersion: loggie.io/v1beta1\nkind:  ClusterLogConfig\nmetadata:\nname: globalstdout\nspec:\nselector:\ntype: workload\nworkload_selector:\n- type:\n- Deployment\nnameSelector:\n- default1\n- default2\nnameSpaceSelector:\n- default1\n- default2\n\npipeline:\nsources: |\n- type: file\nname: stdout\npaths:\n- stdout\nsinkRef: default\n
    \u8868\u793a\u91c7\u96c6default1\u548cdefault2\u7684Deployment\u4e0b\u540d\u5b57\u4e3adefault1\u548cdefault2\u7684\u6240\u6709Pod\u7684\u65e5\u5fd7\u3002

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#cluster","title":"cluster","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cluster string \u975e\u5fc5\u586b \"\" \u8868\u793a\u914d\u7f6e\u6307\u5b9a\u4e0b\u53d1\u7684Loggie\u96c6\u7fa4\u3002\u5f53\u90e8\u7f72\u591a\u5957Loggie\u65f6\uff0c\u548c\u5168\u5c40\u7cfb\u7edf\u914d\u7f6ediscovery.kubernetes.cluster\u914d\u5957\u4f7f\u7528"},{"location":"reference/discovery/kubernetes/clusterlogconfig/#specpipeline","title":"spec.pipeline","text":"

    \u57fa\u672c\u914d\u7f6e\u548cLogConfig\u4e00\u81f4\u3002

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#sources","title":"sources","text":"

    \u5728ClusterLogConfig\u4e2d\uff0csource\u65b0\u589e\u4ee5\u4e0b\u989d\u5916\u7684\u53c2\u6570\uff1a

    "},{"location":"reference/discovery/kubernetes/clusterlogconfig/#typenodefields","title":"typeNodeFields","text":"

    \u5982\u679c\u5f53type: node\u65f6\uff1a

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 typeNodeFields map \u975e\u5fc5\u586b \u548c\u5168\u5c40\u914d\u7f6ediscovery.kubernetes\u4e2d\u7684typeNodeFields\u4e00\u6837\uff0c\u533a\u522b\u662f\u8fd9\u91cc\u4e3aclusterlogconfig\u7ea7\u522b\u751f\u6548"},{"location":"reference/discovery/kubernetes/interceptors/","title":"Interceptor","text":"

    \u8868\u793a\u4e00\u4e2ainterceptor\u7ec4\u3002\u7528\u4e8e\u5728LogConfig/ClusterLogConfig\u4e2d\u88ab\u5f15\u7528\u3002

    Example

    apiVersion: loggie.io/v1beta1\nkind: Interceptor\nmetadata:\nname: default\nspec:\ninterceptors: |\n- type: rateLimit\nqps: 90000\n
    "},{"location":"reference/discovery/kubernetes/interceptors/#specinterceptors","title":"spec.interceptors","text":"

    \u4f7f\u7528\"|\"\u7b26\u53f7\u8868\u793a\u4e00\u6574\u6bb5interceptors\u914d\u7f6e\u5217\u8868\uff0c\u548cPipelines\u91cc\u7684\u914d\u7f6e\u4e00\u81f4\u3002

    "},{"location":"reference/discovery/kubernetes/logconfig/","title":"Logconfig","text":"

    namespace\u7ea7\u522bCRD\uff0c\u8868\u793a\u4e00\u4e2a\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\uff0c\u7528\u4e8e\u91c7\u96c6Pod\u5bb9\u5668\u65e5\u5fd7\u3002

    Example

    \u76f4\u63a5\u5b9a\u4e49sink/interceptor\u65b9\u5f0f\u5f15\u7528sink\u548cinterceptor\u65b9\u5f0f
    apiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: tomcat\nnamespace: default\nspec:\nselector:\ntype: pod\nlabelSelector:\napp: tomcat\npipeline:\nsources: |\n- type: file\nname: common\npaths:\n- stdout\nsink: |\ntype: dev\nprintEvents: false\ninterceptors: |\n- type: rateLimit\nqps: 90000\n
    apiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: nginx\nnamespace: default\nspec:\nselector:\ntype: pod\nlabelSelector:\napp: nginx\npipeline:\nsources: |\n- type: file\nname: mylog\npaths:\n- stdout\nsinkRef: default\ninterceptorRef: default 
    "},{"location":"reference/discovery/kubernetes/logconfig/#specselector","title":"spec.selector","text":"

    \u8868\u793aPipeline\u914d\u7f6e\u9002\u7528\u7684\u8303\u56f4\uff0c\u53ef\u4ee5\u9009\u62e9\u91c7\u96c6\u4e00\u6279Pods\u7684\u65e5\u5fd7

    "},{"location":"reference/discovery/kubernetes/logconfig/#type-pod","title":"type: pod","text":"

    \u91c7\u96c6Pods\u65e5\u5fd7

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 labelSelector map \u5fc5\u586b \u901a\u8fc7\u8be5label\u6765\u5339\u914dPods\uff0c\u652f\u6301\u4f7f\u7528*\u6765\u5339\u914d\u6240\u6709\u7684value\uff0c\u6bd4\u5982app: '*'

    Example

    spec: selector:\ntype: pod\nlabelSelector:\napp: nginx\n
    \u8868\u793a\u91c7\u96c6\u8be5namespace\u4e0b\u7684\u5e26\u6709label app: nginx\u7684\u6240\u6709Pods\u65e5\u5fd7\u3002

    Warning

    \u5728type: pod\u65f6\uff0c\u4e0b\u9762\u7684Pipeline\u53ea\u652f\u6301\u4f7f\u7528file source\uff0c\u6b64\u65f6\u7684\u573a\u666f\u53ea\u80fd\u662f\u91c7\u96c6\u65e5\u5fd7\u3002

    "},{"location":"reference/discovery/kubernetes/logconfig/#cluster","title":"cluster","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cluster string \u975e\u5fc5\u586b \"\" \u8868\u793a\u914d\u7f6e\u6307\u5b9a\u4e0b\u53d1\u7684Loggie\u96c6\u7fa4\u3002\u5f53\u90e8\u7f72\u591a\u5957Loggie\u65f6\uff0c\u548c\u5168\u5c40\u7cfb\u7edf\u914d\u7f6ediscovery.kubernetes.cluster\u914d\u5957\u4f7f\u7528"},{"location":"reference/discovery/kubernetes/logconfig/#specpipeline","title":"spec.pipeline","text":"

    \u8868\u793a\u4e00\u4e2aPipeline\uff0c\u4e0d\u652f\u6301\u586b\u5199\u591a\u4e2aPipeline\u3002

    \u548c\u5728\u914d\u7f6e\u6587\u4ef6\u4e2dPipelines\u7684\u533a\u522b\u5728\uff1a

    "},{"location":"reference/discovery/kubernetes/logconfig/#sources","title":"sources","text":"

    \u5728LogConfig\u4e2d\uff0c\u5982\u679ctype: pod\uff0cfile source\u65b0\u589e\u51e0\u4e2a\u4e13\u95e8\u9488\u5bf9\u5bb9\u5668\u5316\u7684\u53c2\u6570\uff1a

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 containerName string \u975e\u5fc5\u586b \u8868\u793a\u6307\u5b9a\u91c7\u96c6\u7684\u5bb9\u5668\u540d\u79f0\uff0c\u5efa\u8bae\u5728Pod\u91cc\u5305\u542b\u591a\u4e2a\u5bb9\u5668\u65f6\u586b\u5199 excludeContainerPatterns string\u6570\u7ec4 \u975e\u5fc5\u586b \u6392\u9664\u7684\u5bb9\u5668\u540d\u79f0\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u5f62\u5f0f matchFields struct \u975e\u5fc5\u586b \u5c06Pod\u4e2d\u7684label\u7b49\u4fe1\u606f\u52a0\u5165\u5230fields\u4e2d\u4f5c\u4e3a\u989d\u5916\u7684\u5b57\u6bb5\uff0c\u5177\u4f53\u8bf7\u53c2\u8003\u4e0b\u9762matchFields typePodFields map \u975e\u5fc5\u586b \u548c\u5168\u5c40\u914d\u7f6ediscovery.kubernetes\u4e2d\u7684typePodFields\u4e00\u6837\uff0c\u533a\u522b\u662f\u8fd9\u91cc\u4e3alogconfig\u7ea7\u522b\u751f\u6548"},{"location":"reference/discovery/kubernetes/logconfig/#matchfields","title":"matchFields","text":"

    \u975e\u5fc5\u586b, \u5c06Pod\u4e2d\u7684\u4fe1\u606f\u52a0\u5165\u5230Fields\u4e2d

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 labelKey string\u6570\u7ec4 \u975e\u5fc5\u586b \u6307\u5b9a\u589e\u52a0\u7684Pod\u4e0a\u7684Label Key\u503c\uff0c\u6bd4\u5982Pod\u4e0a\u5305\u542bLabel: app: demo\uff0c\u6b64\u5904\u586b\u5199labelKey: app\uff0c\u6b64\u65f6\u4f1a\u5c06Pod\u4e0a\u7684app: demo label\u589e\u52a0\u5230file source fields\u4e2d\uff0c\u91c7\u96c6\u5230\u7684\u65e5\u5fd7\u4f1a\u88ab\u52a0\u4e0a\u8be5label\u4fe1\u606f\u3002\u9002\u7528\u4e8e\u5339\u914d\u7684Pod\u7684label\u5b58\u5728\u4e0d\u4e00\u81f4\u7684\u573a\u666f\u3002\u652f\u6301\u914d\u7f6e\u4e3a\"*\"\u7684\u65b9\u5f0f\u83b7\u53d6\u6240\u6709\u7684label annotationKey string\u6570\u7ec4 \u975e\u5fc5\u586b \u548c\u4e0a\u9762labelKey\u7c7b\u4f3c\uff0c\u6ce8\u5165\u7684\u4e3aPod Annoatation\u7684\u503c\uff0c\u652f\u6301\u914d\u7f6e\u4e3a\"*\"\u7684\u65b9\u5f0f\u83b7\u53d6\u6240\u6709\u7684annotation env string\u6570\u7ec4 \u975e\u5fc5\u586b \u548c\u4e0a\u9762labelKey\u7c7b\u4f3c\uff0c\u6ce8\u5165\u7684\u4e3aPod Env\u73af\u5883\u53d8\u91cf\u7684\u503c\uff0c\u652f\u6301\u914d\u7f6e\u4e3a\"*\"\u7684\u65b9\u5f0f\u83b7\u53d6\u6240\u6709\u7684env reformatKeys \u975e\u5fc5\u586b \u91cd\u65b0\u683c\u5f0f\u5316key reformatKeys.label fmt\u53c2\u6570\u6570\u7ec4 \u975e\u5fc5\u586b \u91cd\u65b0\u683c\u5f0f\u5316label key\uff0c\uff0c\u8bf7\u53c2\u8003\u4e0b\u6587fmt\u53c2\u6570 reformatKeys.annotation fmt\u53c2\u6570\u6570\u7ec4 \u975e\u5fc5\u586b \u91cd\u65b0\u683c\u5f0f\u5316annotation key\uff0c\u8bf7\u53c2\u8003\u4e0b\u6587fmt\u53c2\u6570 reformatKeys.env fmt\u53c2\u6570\u6570\u7ec4 \u975e\u5fc5\u586b \u91cd\u65b0\u683c\u5f0f\u5316env key\uff0c\uff0c\u8bf7\u53c2\u8003\u4e0b\u6587fmt\u53c2\u6570"},{"location":"reference/discovery/kubernetes/logconfig/#fmt","title":"fmt","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 regex string \u975e\u5fc5\u586b \u5339\u914d\u7684\u6b63\u5219\u8868\u8fbe\u5f0f replace string \u975e\u5fc5\u586b \u91cd\u65b0\u6e32\u67d3\u7684\u683c\u5f0f

    reformatKeys

    \u5047\u8bbepod labels\u4e3aaa.bb/foo=bar \u914d\u7f6ereformatKeys\u5982\u4e0b\uff1a

    matchFields:\n reformatKeys:\n   label:\n   - regex: aa.bb/(.*)\n     replace: pre-${1}\n
    \u6700\u7ec8\u6dfb\u52a0\u5230\u65e5\u5fd7\u7684\u5143\u4fe1\u606f\u4e3a\uff1apre-foo=bar

    Example

    apiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: nginx\nnamespace: default\nspec:\nselector:\ntype: pod\nlabelSelector:\napp: nginx\npipeline:\nsources: |\n- type: file\nname: mylog\ncontainerName: nginx\nmatchFields:\nlabelKey: [\"app\"]\npaths:\n- stdout\n
    "},{"location":"reference/discovery/kubernetes/logconfig/#interceptors","title":"interceptors","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 interceptors string \u975e\u5fc5\u586b \u8868\u793a\u8be5Pipeline\u7684interceptor\uff0c\u4f7f\u7528\u65b9\u5f0f\u548c\u4ee5\u4e0asources\u7c7b\u4f3c"},{"location":"reference/discovery/kubernetes/logconfig/#sink","title":"sink","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sink string \u975e\u5fc5\u586b \u8868\u793a\u8be5Pipeline\u7684sink\uff0c\u4f7f\u7528\u65b9\u5f0f\u548c\u4ee5\u4e0a\u7684sources\u7c7b\u4f3c

    \u5982\u679c\u4f60\u5e0c\u671bsink\u548cinterceptor\u53ef\u4ee5\u5728\u4e0d\u540c\u7684ClusterLogConfig/LogConfig\u95f4\u590d\u7528\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0bref\u7684\u65b9\u5f0f\uff1a

    "},{"location":"reference/discovery/kubernetes/logconfig/#sinkref","title":"sinkRef","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sinkRef string \u975e\u5fc5\u586b \u8868\u793a\u8be5Pipeline\u5f15\u7528\u7684Sink CR"},{"location":"reference/discovery/kubernetes/logconfig/#interceptorref","title":"interceptorRef","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 interceptorRef string \u975e\u5fc5\u586b \u8868\u793a\u8be5Pipeline\u5f15\u7528\u7684Interceptor CR"},{"location":"reference/discovery/kubernetes/sink/","title":"Sink","text":"

    \u8868\u793a\u4e00\u4e2asink\u914d\u7f6e\u3002\u7528\u4e8e\u5728LogConfig/ClusterLogConfig\u4e2d\u88ab\u5f15\u7528\u3002

    Example

    apiVersion: loggie.io/v1beta1\nkind: Sink\nmetadata:\nname: default\nspec:\nsink: |\ntype: elasticsearch\nindex: \"loggie\"\nhosts: [\"elasticsearch-master.default.svc:9200\"]\n
    "},{"location":"reference/discovery/kubernetes/sink/#specsink","title":"spec.sink","text":"

    \u4f7f\u7528\"|\"\u7b26\u53f7\u8868\u793a\u4e00\u4e2asink\u914d\u7f6e\uff0c\u548cPipelines\u91cc\u7684\u914d\u7f6e\u4e00\u81f4\u3002

    "},{"location":"reference/global/args/","title":"\u542f\u52a8\u53c2\u6570","text":""},{"location":"reference/global/args/#_1","title":"\u7cfb\u7edf\u53c2\u6570","text":"

    Warning

    \u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679cconfig.pipeline=/etc/loggie\uff0cglob\u5339\u914d\u4f1a\u8ba4\u4e3a/etc/loggie\u4e3a/etc\u76ee\u5f55\u4e0b\u7684loggie\u6587\u4ef6\uff0c\u800c\u4e0d\u662f\u5339\u914d/etc/loggie\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\uff0c\u8bf7\u907f\u514d\u7c7b\u4f3c\u7684\u8bbe\u7f6e\u65b9\u5f0f

    "},{"location":"reference/global/args/#_2","title":"\u65e5\u5fd7\u53c2\u6570","text":"

    Info

    Loggie\u7684\u65e5\u5fd7\u8f6e\u8f6c\u4f7f\u7528lumberjack\u5e93

    "},{"location":"reference/global/db/","title":"db","text":"

    \u6301\u4e45\u5316\u6570\u636e\u7684\u914d\u7f6e\u3002\u4fdd\u5b58\u91c7\u96c6\u8fc7\u7a0b\u4e2d\u7684\u6587\u4ef6\u540d\u79f0\u3001\u6587\u4ef6inode\u3001\u6587\u4ef6\u91c7\u96c6\u7684offset\u7b49\u4fe1\u606f\u3002\u7528\u6765\u5728loggie reload\u6216\u8005\u91cd\u542f\u540e\u6062\u590d\u4e0a\u4e00\u6b21\u7684\u91c7\u96c6\u8fdb\u5ea6\u3002

    v1.5\u7248\u672c\u53ca\u4ee5\u540e\u65b0\u5f15\u5165\u4e86badger\u6301\u4e45\u5316\u5f15\u64ce\uff0c\u53ef\u66ff\u6362\u4e4b\u524d\u7684sqlite\uff0c\u907f\u514d\u4f7f\u7528CGO\u3002

    Caution

    \u8bf7\u6ce8\u610f\uff0c\u4e0d\u517c\u5bb9\u6539\u52a8\uff1a\u5728v1.5\u4e4b\u540e\uff08\u5305\u62ecv1.5\uff09\uff0cfile source\u4e2d\u7684db\u79fb\u52a8\u5230\u8fd9\u91cc\u4e3a\u5168\u5c40\u914d\u7f6e\u3002

    \u5982\u679c\u4ece\u4f4e\u7248\u672c\u5347\u7ea7\u5230v1.5\u53ca\u4ee5\u540e\u7248\u672c\uff0c\u8bf7\u52a1\u5fc5\u68c0\u67e5file source\u662f\u5426\u6709\u914d\u7f6e\u8fc7db\u3002\u5982\u679c\u6ca1\u6709\u914d\u7f6e\uff0c\u53ef\u5ffd\u7565\uff0c\u9ed8\u8ba4\u503c\u4f1a\u4fdd\u6301\u517c\u5bb9\u3002

    Example

    sqlitebadger
    db:\n  file: /opt/data/loggie.db\n
    db:\n  file: /opt/data/badger\n
    "},{"location":"reference/global/db/#file","title":"file","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 file string \u975e\u5fc5\u586b badger: ./data/badger\uff0csqlite: ./data/loggie.db \u6301\u4e45\u5316\u7684\u76ee\u5f55\u6587\u4ef6"},{"location":"reference/global/db/#flushtimeout","title":"flushTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 flushTimeout time.Duration \u975e\u5fc5\u586b 2s"},{"location":"reference/global/db/#buffersize","title":"bufferSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 bufferSize int \u975e\u5fc5\u586b 2048 \u6301\u4e45\u5316\u5199\u5165\u4f7f\u7528\u7684buffer"},{"location":"reference/global/db/#cleaninactivetimeout","title":"cleanInactiveTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cleanInactiveTimeout time.Duration \u975e\u5fc5\u586b 504h \u5982\u679c\u4e00\u6761\u8bb0\u5f55\u957f\u65f6\u95f4\u6ca1\u6709\u88ab\u66f4\u65b0\uff0c\u5219\u4f1a\u88ab\u6e05\u7406\uff0c\u9ed8\u8ba4\u4e3a21d(504h)"},{"location":"reference/global/db/#cleanscaninterval","title":"cleanScanInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cleanInactiveTimeout time.Duration \u975e\u5fc5\u586b 1h \u6e05\u7406\u903b\u8f91\u6267\u884c\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/global/defaults/","title":"Defaults","text":"

    defaults\u7528\u4e8e\u8bbe\u7f6ePipelines\u914d\u7f6e\u4e2d\u7684\u9ed8\u8ba4\u503c\u3002\u5f53Pipeline\u4e2d\u6ca1\u6709\u8bbe\u7f6e\u503c\u65f6\u751f\u6548\uff0c\u6216\u8005\u7528\u4e8e\u8986\u76d6\u9ed8\u8ba4\u7684\u53c2\u6570\u3002

    Example

    defaults:\nsources:\n- type: file\nwatcher:\ncleanFiles:\nmaxHistory: 10\nsink:\ntype: dev\nprintEvents: true\n
    "},{"location":"reference/global/defaults/#sources","title":"sources","text":"

    \u548cPipeline\u4e2d\u7684source\u4e00\u81f4\u3002\u5f53Pipelines\u914d\u7f6e\u4e86\u76f8\u540ctype\u7684source\u65f6\uff0c\u4f1a\u8986\u76d6\u5176\u4e2d\u672a\u586b\u5199\u5b57\u6bb5\u7684\u9ed8\u8ba4\u503c\u3002

    \u6bd4\u5982:

        sources:\n- type: file\nwatcher:\ncleanFiles:\nmaxHistory: 10\n
    \u5982\u679cPipeline\u914d\u7f6e\u4e86file source\uff0c\u6b64\u65f6\u53ef\u4ee5\u8bbe\u7f6e\u5168\u5c40\u7684\u6587\u4ef6\u6e05\u7406\u4fdd\u7559\u5929\u6570\u4e3a10\u5929\uff0c\u800c\u4e0d\u9700\u8981\u5728\u6bcf\u4e2aPipeline\u7684file source\u4e2d\u90fd\u8bbe\u7f6e\u4e00\u904d\u3002

    "},{"location":"reference/global/defaults/#sink","title":"sink","text":"

    \u548cPipeline\u4e2d\u7684sink\u4e00\u81f4\uff0c\u5982\u679c\u96c6\u7fa4\u53ea\u9700\u8981\u8bbe\u7f6e\u4e00\u4e2a\u5168\u5c40\u7684sink\u8f93\u51fa\u6e90\uff0c\u5219\u53ea\u9700\u8981\u5728\u8fd9\u91cc\u914d\u7f6e\u4e00\u6b21\uff0c\u907f\u514d\u5728\u6bcf\u4e2aPipeline\u4e2d\u586b\u5199\u3002

    "},{"location":"reference/global/defaults/#interceptors","title":"interceptors","text":"

    defaults\u4e2d\u914d\u7f6e\u7684interceptors\u4f1a\u6dfb\u52a0\u5230pipeline\u4e2d\u5b9a\u4e49\u7684interceptors\u4e2d\uff0c\u4f46pipeline\u4e2d\u7684interceptor\u4f1a\u8986\u76d6defaults\u4e2d\u7684\u540c\u4e00\u4e2atype\u7684interceptor\u3002 \u5982\u679c\u4e0d\u5e0c\u671b\u8986\u76d6\u76f8\u540c\u7c7b\u578b\u7684interceptor\uff0c\u800c\u662f\u6dfb\u52a0\u76f8\u540ctype\u7684interceptor\uff0c\u4f9d\u6b21\u8fdb\u884c\u5904\u7406\uff0c\u9700\u8981\u989d\u5916\u586b\u5199name\u5b57\u6bb5\uff0c\u8fdb\u884c\u552f\u4e00\u6027\u6807\u8bc6\u3002

    \u5728defaults\u4e2d\u5df2\u7ecf\u5b9a\u4e49normalize interceptor\u5982\u4e0b:

    defaults:\ninterceptors:\n- type: normalize\nprocessor:\n- addMeta: ~\n

    \u5982\u679c\u5728pipelines\u4e2d\u5b9a\u4e49\u5982\u4e0bnormalize interceptor\uff1a

    pipelines:\ninterceptors:\n- type: normalize\nprocessor:\n- drop:\n...\n

    \u6b64\u65f6defaults\u4e2d\u7684normalize interceptor\u4f1a\u88ab\u8986\u76d6\uff0c\u4e0d\u4f1a\u751f\u6548\u3002

    \u5982\u679c\u6211\u4eec\u5e0c\u671b\u5148\u6267\u884cdefaults\u4e2d\u7684normalize interceptor\uff0c\u63a5\u7740\u518d\u6267\u884cpipeline\u4e2d\u7684normalize interceptor\uff0c\u53ef\u4ee5\u5728defaults\u4e2d\u6539\u4e3a\uff1a

    defaults:\ninterceptors:\n- type: normalize\nname: global # \u7528\u4e8e\u533a\u5206pipelines\u4e2d\u7684normalize\norder: 500   # \u9ed8\u8ba4normalize\u7684order\u503c\u4e3a900\uff0c\u8fd9\u91cc\u5b9a\u4e49\u4e00\u4e2a\u76f8\u5bf9\u8f83\u5c0f\u503c\uff0c\u53ef\u63a7\u5236\u5148\u6267\u884cdefaults\u4e2d\u7684normalize\nprocessor:\n- addMeta: ~\n

    Loggie\u4f1a\u9ed8\u8ba4\u8bbe\u7f6emetric\u3001maxbytes\u3001retry3\u4e2a\u7cfb\u7edf\u5185\u7f6einterceptors\u3002 \u5982\u679c\u9700\u8981\u6dfb\u52a0\u5176\u4ed6\u7684\u9ed8\u8ba4interceptors\uff0c\u4f1a\u8986\u76d6\u6389\u4ee5\u4e0a\u7684\u5185\u7f6einterceptors\uff0c\u6240\u4ee5\u5f3a\u70c8\u5efa\u8bae\u6b64\u65f6\u5c06\u5185\u7f6einterceptors\u52a0\u4e0a\uff0c\u9664\u975e\u4f60\u786e\u8ba4\u4e0d\u9700\u8981\u4ee5\u4e0a\u7cfb\u7edf\u5185\u7f6e\u7684interceptors\u3002

    "},{"location":"reference/global/defaults/#queue","title":"queue","text":"

    \u9ed8\u8ba4\u4e3achannel queue\u3002

    "},{"location":"reference/global/discovery/","title":"Discovery","text":"

    \u670d\u52a1\u53d1\u73b0\u548c\u914d\u7f6e\u4e0b\u53d1\u76f8\u5173\u7684\u914d\u7f6e\u3002\u76ee\u524d\u4e3b\u8981\u4e3aKubernetes\u76f8\u5173\u5168\u5c40\u914d\u7f6e\u3002

    Example

    discovery:\nenabled: true\nkubernetes:\n# Choose: docker or containerd\ncontainerRuntime: containerd\n# Collect log files inside the container from the root filesystem of the container, no need to mount the volume\nrootFsCollectionEnabled: false\n# Automatically parse and convert the wrapped container standard output format into the original log content\nparseStdout: false\n# If set to true, it means that the pipeline configuration generated does not contain specific Pod paths and meta information,\n# and these data will be dynamically obtained by the file source, thereby reducing the number of configuration changes and reloads.\ndynamicContainerLog: false\n# Automatically add fields when selector.type is pod in logconfig/clusterlogconfig\ntypePodFields:\nlogconfig: \"${_k8s.logconfig}\"\nnamespace: \"${_k8s.pod.namespace}\"\nnodename: \"${_k8s.node.name}\"\npodname: \"${_k8s.pod.name}\"\ncontainername: \"${_k8s.pod.container.name}\"\ntypeNodeFields:\nnodename: \"${_k8s.node.name}\"\nclusterlogconfig: \"${_k8s.clusterlogconfig}\"\nos: \"${_k8s.node.nodeInfo.osImage}\"\n
    "},{"location":"reference/global/discovery/#enabled","title":"enabled","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u670d\u52a1\u53d1\u73b0\u914d\u7f6e\u4e0b\u53d1\u6a21\u5757"},{"location":"reference/global/discovery/#kubernetes","title":"Kubernetes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cluster string \u975e\u5fc5\u586b \"\" \u6807\u8bc6Loggie\u96c6\u7fa4\u540d\u79f0\u3002Loggie\u652f\u6301\u5728\u4e00\u4e2aKubernetes\u96c6\u7fa4\u4e2d\u90e8\u7f72\u591a\u5957Loggie\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728LogConfig CRD\u4e2d\u6307\u5b9aselector.cluster\uff0c\u6307\u5b9a\u914d\u7f6e\u4e0b\u53d1\u7684Loggie\u96c6\u7fa4 kubeconfig string \u975e\u5fc5\u586b \u6307\u5b9a\u8bf7\u6c42Kubernetes\u96c6\u7fa4API\u7684kubeconfig\u6587\u4ef6\u3002\u901a\u5e38\u5728Loggie\u90e8\u7f72\u5230Kubernetes\u96c6\u7fa4\u4e2d\u65e0\u9700\u586b\u5199\uff0c\u6b64\u65f6\u4e3ainCluster\u6a21\u5f0f\u3002\u5982\u679cLoggie\u90e8\u7f72\u5728Kubernetes\u96c6\u7fa4\u5916\uff08\u4f8b\u5982\u672c\u5730\u8c03\u8bd5\u65f6\uff09\uff0c\u9700\u8981\u6307\u5b9a\u8be5kubeconfig\u6587\u4ef6\u3002 master string \u975e\u5fc5\u586b \u6307\u5b9a\u8bf7\u6c42Kubernetes\u96c6\u7fa4API\u7684master\u5730\u5740\uff0cinCluster\u6a21\u5f0f\u4e00\u822c\u65e0\u9700\u586b\u5199 containerRuntime string \u975e\u5fc5\u586b docker \u5bb9\u5668\u8fd0\u884c\u65f6\uff0c\u53ef\u9009docker\u3001containerd\u3001none rootFsCollectionEnabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u91c7\u96c6root filesystem\u91cc\u7684\u65e5\u5fd7\uff0c\u7528\u4e8e\u4e0d\u6302\u8f7d\u65e5\u5fd7volume\u7684\u573a\u666f parseStdout bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u81ea\u52a8\u63d0\u53d6\u5bb9\u5668\u6807\u51c6\u8f93\u51fa\u539f\u59cb\u5185\u5bb9 dynamicContainerLog bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u52a8\u6001\u5bb9\u5668\u65e5\u5fd7\u914d\u7f6e\uff0c\u6253\u5f00\u540e\u914d\u7f6e\u6587\u4ef6\u4e0d\u4f1a\u6e32\u67d3\u5177\u4f53\u7684path\u548c\u52a8\u6001fields\u5b57\u6bb5\uff0c\u53ef\u4ee5\u6709\u6548\u907f\u514d\u5927\u89c4\u6a21\u5bb9\u5668\u5316\u573a\u666f\u91ccPod\u53d8\u52a8\u4ece\u800c\u5bfc\u81f4\u914d\u7f6e\u7684\u9891\u7e41\u6e32\u67d3\uff0c\u663e\u8457\u51cf\u5c11reload\u6b21\u6570\uff0c\u7279\u522b\u662f\u5728\u5355\u8282\u70b9\u7684Pod\u4e2a\u6570\u8f83\u591a\u548c\u4f7f\u7528clusterlogconfig\u5339\u914d\u5927\u91cf\u7684Pod\u65f6\u3002\u4e00\u822c\u5efa\u8bae\u8bbe\u7f6e\u4e3atrue\u3002 kubeletRootDir string \u975e\u5fc5\u586b /var/lib/kubelet kubelet\u7684root\u8def\u5f84 podLogDirPrefix string \u975e\u5fc5\u586b /var/log/pods kubernetes\u9ed8\u8ba4\u653e\u7f6e\u7684pod\u6807\u51c6\u8f93\u51fa\u8def\u5f84 hostRootMountPath string \u975e\u5fc5\u586b \u4f7f\u7528Loggie\u76f4\u63a5\u6302\u8f7d\u8282\u70b9root\u6839\u76ee\u5f55\u7684\u6a21\u5f0f\uff0c\u90e8\u7f72\u811a\u672c\u548c\u5347\u7ea7\u53c2\u8003\u8fd9\u91cc typePodFields map \u975e\u5fc5\u586b \u5f53logconfig/clusterlogconfig\u91ccselector\u4e3atype: pod\u65f6\uff0c\u81ea\u52a8\u6dfb\u52a0\u7684kubernetes\u76f8\u5173\u5143\u4fe1\u606f\uff0ckey\u5373\u4e3a\u6dfb\u52a0\u7684\u5143\u4fe1\u606fkey\uff0cvalue\u8bf7\u4f7f\u7528${_k8s.XX}\u7684\u65b9\u5f0f\u6307\u5b9a\uff0c\u540c\u65f6\u652f\u6301\u586b\u5199\u56fa\u5b9a\u503c\u7684key:value\u5b57\u6bb5 typeNodeFields map \u975e\u5fc5\u586b \u5f53logconfig/clusterlogconfig\u91ccselector\u4e3atype: node\u65f6\uff0c\u81ea\u52a8\u6dfb\u52a0\u7684kubernetes\u76f8\u5173\u5143\u4fe1\u606f\uff0ckey\u5373\u4e3a\u6dfb\u52a0\u7684\u5143\u4fe1\u606fkey\uff0cvalue\u8bf7\u4f7f\u7528${_k8s.XX}\u7684\u65b9\u5f0f\u6307\u5b9a\uff0c\u540c\u65f6\u652f\u6301\u586b\u5199\u56fa\u5b9a\u503c\u7684key:value\u5b57\u6bb5 fieldsOmitEmpty bool \u975e\u5fc5\u586b \u5ffd\u7565\u7a7a\u503c\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\uff0c\u6bd4\u5982\u5982\u679cevent\u4e2d\u6709logconfig: \"\"\uff0c\u5219\u6574\u4e2a\u5b57\u6bb5\u4e0d\u6dfb\u52a0 defaults \u975e\u5fc5\u586b defaults.sinkRef string \u975e\u5fc5\u586b \u5982\u679cLogConfig/clusterLogConfig\u4e2d\u6ca1\u6709\u914d\u7f6esinkRef\uff0c\u6240\u6709\u7684LogConfig/clusterLogConfig\u9ed8\u8ba4\u4f7f\u7528\u8be5sink\u3002 \u8bf7\u6ce8\u610f\u4f18\u5148\u7ea7\u8986\u76d6\u5173\u7cfb\uff1alogconfig\u4e2d\u7684sinkRef \u4f18\u5148\u4e8e default.sinkRef \u4f18\u5148\u4e8e \u5168\u5c40defaults\u91cc\u914d\u7f6e\u7684sink"},{"location":"reference/global/discovery/#typepodfields","title":"typePodFields\u652f\u6301\u7684\u53d8\u91cf","text":"

    \"${_k8s.XX}\"\u7684\u65b9\u5f0f\u53ef\u586b\u5199\u4ee5\u4e0b\u53c2\u6570\uff1a

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ${_k8s.logconfig} string \u975e\u5fc5\u586b \u6dfb\u52a0LogConfig name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.clusterlogconfig} string \u975e\u5fc5\u586b \u6dfb\u52a0ClusterLogConfig name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.name} string \u975e\u5fc5\u586b \u6dfb\u52a0\u6240\u5728\u8282\u70b9node name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.ip} string \u975e\u5fc5\u586b \u6dfb\u52a0\u6240\u5728\u8282\u70b9node ip\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.namespace} string \u975e\u5fc5\u586b \u6dfb\u52a0namespace\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.name} string \u975e\u5fc5\u586b \u6dfb\u52a0pod name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.ip} string \u975e\u5fc5\u586b \u6dfb\u52a0pod ip\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.uid} string \u975e\u5fc5\u586b \u6dfb\u52a0pod uid\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.container.name} string \u975e\u5fc5\u586b \u6dfb\u52a0container name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.container.id} string \u975e\u5fc5\u586b \u6dfb\u52a0container id\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.pod.container.image} string \u975e\u5fc5\u586b \u6dfb\u52a0container image\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.workload.kind} string \u975e\u5fc5\u586b \u6dfb\u52a0pod\u5f52\u5c5e\u7684Deployment/Statefulset/DaemonSet/Job\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.workload.name} string \u975e\u5fc5\u586b \u6dfb\u52a0pod\u5f52\u5c5e\u7684Deployment/Statefulset/DaemonSet/Job\u540d\u79f0\u4f5c\u4e3a\u5143\u4fe1\u606f"},{"location":"reference/global/discovery/#typenodefields","title":"typeNodeFields\u652f\u6301\u7684\u53d8\u91cf","text":"

    \"${_k8s.XX}\"\u7684\u65b9\u5f0f\u53ef\u586b\u5199\u4ee5\u4e0b\u53c2\u6570\uff1a

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ${_k8s.clusterlogconfig} string \u975e\u5fc5\u586b \u6dfb\u52a0clusterlogconfig name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.name} string \u975e\u5fc5\u586b \u6dfb\u52a0\u6240\u5728\u8282\u70b9node name\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.addresses.InternalIP} string \u975e\u5fc5\u586b \u6dfb\u52a0node InternalIP \u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.addresses.Hostname} string \u975e\u5fc5\u586b \u6dfb\u52a0node Hostname\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.kernelVersion} string \u975e\u5fc5\u586b \u6dfb\u52a0node kernelVersion\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.osImage} string \u975e\u5fc5\u586b \u6dfb\u52a0node osImage\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.containerRuntimeVersion} string \u975e\u5fc5\u586b \u6dfb\u52a0node containerRuntimeVersion\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.kubeletVersion} string \u975e\u5fc5\u586b \u6dfb\u52a0node kubeletVersion\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.kubeProxyVersion} string \u975e\u5fc5\u586b \u6dfb\u52a0node kubeProxyVersion\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.operatingSystem} string \u975e\u5fc5\u586b \u6dfb\u52a0node operatingSystem\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.nodeInfo.architecture} string \u975e\u5fc5\u586b \u6dfb\u52a0node architecture\u4f5c\u4e3a\u5143\u4fe1\u606f ${_k8s.node.labels.<key>} string \u975e\u5fc5\u586b \u6dfb\u52a0node\u7684\u67d0\u4e2alabel\u4f5c\u4e3a\u5143\u4fe1\u606f\uff0c\u5176\u4e2d\u7684<key>\u8bf7\u66ff\u6362\u6210\u5177\u4f53\u7684label key ${_k8s.node.annotations.<key>} string \u975e\u5fc5\u586b \u6dfb\u52a0node\u7684\u67d0\u4e2aannotation\u4f5c\u4e3a\u5143\u4fe1\u606f\uff0c\u5176\u4e2d\u7684<key>\u8bf7\u66ff\u6362\u6210\u5177\u4f53\u7684annotation key"},{"location":"reference/global/http/","title":"Http","text":"

    Loggie\u81ea\u8eab\u63d0\u4f9b\u7684Http\u7aef\u53e3\uff0c\u5305\u542b\u76d1\u63a7metrics\uff0c\u5185\u90e8\u8fd0\u7ef4\u7b49\u63a5\u53e3\u3002

    Example

    http:\nenabled: true\nhost: \"0.0.0.0\"\nport: 9196\n
    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542fhttp host string \u975e\u5fc5\u586b 0.0.0.0 http\u76d1\u542c\u7684host port http \u975e\u5fc5\u586b 9196 http\u76d1\u63a7\u7684\u7aef\u53e3

    Tips

    \u4e00\u822c\u63a8\u8350\u6253\u5f00http\u7aef\u53e3\uff0c\u4f46\u662f\u5982\u679cKubernetes\u6216\u8005\u5bb9\u5668\u90e8\u7f72\u65f6\uff0c\u4f7f\u7528hostNetwork\u8bf7\u6ce8\u610f\u7aef\u53e3\u51b2\u7a81\uff0c\u4ee5\u53ca\u76d1\u542chost\u662f\u5426\u66b4\u9732\u7ed9\u516c\u7f51\u3001\u662f\u5426\u6709\u5b89\u5168\u9690\u60a3\u3002

    "},{"location":"reference/global/monitor/","title":"Monitor","text":"

    \u76d1\u63a7\u4e8b\u4ef6\u603b\u7ebf\uff0c\u6240\u6709\u7684\u7ec4\u4ef6\u90fd\u53ef\u4ee5\u53d1\u51fa\u81ea\u5df1\u7684metrics\u6307\u6807\u6570\u636e\uff0c\u7531listeners\u6d88\u8d39\u5904\u7406\u3002

    \u5177\u4f53\u8bf7\u53c2\u8003\u8fd9\u91cc\u3002

    Example

    monitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nsink: ~    
    "},{"location":"reference/global/reload/","title":"Reload","text":"

    reload\u4f1a\u5b9a\u65f6\u68c0\u67e5\u542f\u52a8\u53c2\u6570-config.pipeline\u6307\u5b9a\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5982\u679c\u68c0\u6d4b\u5230\u6587\u4ef6\u5185\u5bb9\u53d1\u751f\u53d8\u52a8\uff0c\u4f1a\u91cd\u542f\u6709\u53d8\u52a8\u914d\u7f6e\u7684Pipeline\uff0c\u672a\u88ab\u4fee\u6539\u7684Pipeline\u4e0d\u4f1a\u53d7\u5f71\u54cd\u3002

    Example

      reload:\nenabled: true\nperiod: 10s\n
    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542freload period time.Duration \u975e\u5fc5\u586b 10s reload\u68c0\u6d4b\u914d\u7f6e\u7684\u65f6\u95f4\u95f4\u9694\uff0c\u4e0d\u5efa\u8bae\u8bbe\u7f6e\u8fc7\u77ed\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u589e\u52a0CPU\u7684\u6d88\u8017"},{"location":"reference/global/subcmd/","title":"\u5b50\u547d\u4ee4","text":""},{"location":"reference/global/subcmd/#genfiles","title":"genfiles","text":"

    \u6a21\u62df\u4ea7\u751f\u65e5\u5fd7\u3002\u53ef\u7528\u4e8e\u65e5\u5fd7\u91c7\u96c6\u7684\u538b\u6d4b\u548c\u6d4b\u8bd5\u573a\u666f\u3002

    "},{"location":"reference/global/subcmd/#_2","title":"\u53c2\u6570","text":""},{"location":"reference/global/subcmd/#_3","title":"\u4f7f\u7528\u65b9\u5f0f","text":""},{"location":"reference/global/subcmd/#loggie","title":"\u4f7f\u7528loggie\u53ef\u6267\u884c\u6587\u4ef6","text":"
    LOG_DIR=/tmp/log ## log directory\nLOG_MAXSIZE=10 ## max size in MB of the logfile before it's rolled\nLOG_QPS=0 ## qps of line generate\nLOG_TOTAL=5 ## total line count\nLOG_LINE_BYTES=1024 ## bytes per line\nLOG_MAX_BACKUPS=5 ## max number of rolled files to keep\n\n./loggie genfiles -totalCount=${LOG_TOTAL} -lineBytes=${LOG_LINE_BYTES} -qps=${LOG_QPS} \\\n-log.maxBackups=${LOG_MAX_BACKUPS} -log.maxSize=${LOG_MAXSIZE} -log.directory=${LOG_DIR} -log.noColor=true \\\n-log.enableStdout=false -log.enableFile=true -log.timeFormat=\"2006-01-02 15:04:05.000\"\n

    \u793a\u4f8b\uff1a

    # Generate a log file loggie.log under /tmp/log, \n# which contains 1000 logs, each line of log is 1KB, and the total size is about 1.1MB\n\n\n./loggie genfiles -totalCount=1000 -lineBytes=1024 -qps=0 \\\n-log.maxBackups=1 -log.maxSize=1000 -log.directory=/tmp/log -log.noColor=true \\\n-log.enableStdout=false -log.enableFile=true -log.timeFormat=\"2006-01-02 15:04:05.000\"\n

    \u5728\u5bb9\u5668\u4e2d\u4f7f\u7528\uff0c\u8bf7\u53c2\u8003\u90e8\u7f72catalog\u4e2d\u7684deployment\uff0c\u5e76exec\u5230\u5176\u4e2d\u7684Pod\u4e2d\u6267\u884c\u4ee5\u4e0a\u547d\u4ee4\u3002

    "},{"location":"reference/global/subcmd/#_4","title":"\u672c\u5730\u6d4b\u8bd5","text":"

    \u793a\u4f8b\uff1a

    make genfiles LOG_TOTAL=1000\n
    \u5177\u4f53\u5176\u4ed6\u53c2\u6570\u53ef\u4ee5\u53c2\u8003\u9879\u76ee\u4e2d\u7684makefiles\u3002

    "},{"location":"reference/global/subcmd/#version","title":"version","text":"

    \u67e5\u770bLoggie\u7684\u7248\u672c\u3002

    "},{"location":"reference/global/subcmd/#_5","title":"\u53c2\u6570","text":"

    \u65e0

    "},{"location":"reference/global/subcmd/#_6","title":"\u4f7f\u7528\u65b9\u5f0f","text":"
    ./loggie version\n
    "},{"location":"reference/global/var/","title":"\u5b57\u6bb5\u52a8\u6001\u53d8\u91cf","text":"

    \u5728\u5f88\u591a\u573a\u666f\u4e0b\uff0c\u6211\u4eec\u5f80\u5f80\u9700\u8981\u52a8\u6001\u7684\u83b7\u53d6event\u91cc\u7684\u67d0\u4e2a\u5b57\u6bb5\u3002 \u6bd4\u5982\uff1a

    \u4ee5\u4e0bevent\u4e3a\u4f8b:

    {\n\"fields\": {\n\"svc\": \"test\",\n}\n}\n

    kafka sink topic\u914d\u7f6e\u4e3a\uff1alog-${fields.svc}\uff0c\u5219\u6700\u7ec8\u6e32\u67d3\u751f\u6210\u7684\u4e3alog-test\u3002

    Caution

    \u4e00\u822c\u53ef\u4ee5\u4f7f\u7528.\u70b9\u53f7\u6765\u8868\u793a\u5d4c\u5957\u7684\u5b57\u6bb5\u3002\u4f46\u662f\uff0c\u5982\u679c\u5b57\u6bb5\u672c\u8eab\u5c31\u5305\u62ec.\u53f7\uff0c\u5219\u9700\u8981\u4f7f\u7528[]\u5305\u56f4\u8d77\u6765\uff0c\u907f\u514d\u8bef\u8ba4\u4e3a\u662f\u4e00\u4e2a\u5d4c\u5957\u7684\u5b57\u6bb5\u3002 \u6bd4\u5982\uff1a

    {\n\"fields\": {\n\"a.b\": \"demo\",\n}\n}\n
    \u9700\u8981\u4f7f\u7528${fields.[a.b]}\u6765\u8868\u793a\u5b57\u6bb5a.b\u3002

    "},{"location":"reference/monitor/filesource/","title":"filesource listener","text":"

    \u5b9e\u65f6\u6587\u4ef6\u91c7\u96c6\u7684\u76d1\u63a7\uff0c\u8868\u793a\u5f53\u524d\u65e5\u5fd7\u91c7\u96c6\u7684\u8fdb\u5ea6\u4e0e\u72b6\u6001\uff0c\u5305\u62ec\u6587\u4ef6\u7684\u540d\u79f0\u3001\u91c7\u96c6\u8fdb\u5ea6\u3001QPS\u7b49\u3002

    "},{"location":"reference/monitor/filesource/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 period time.Duration \u975e\u5fc5\u586b 10s listener\u6d88\u8d39\u5904\u7406\u6570\u636e\u7684\u65f6\u95f4\u95f4\u9694 fieldsRef string\u6570\u7ec4 \u975e\u5fc5\u586b \u652f\u6301\u4ecesource fields\u914d\u7f6e\u5f53\u4e2d\u83b7\u53d6key value\u52a0\u5165\u5230metrics\u4e2d\u4e3alabel"},{"location":"reference/monitor/filesource/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/filesource/#file_size","title":"file_size","text":"
    # HELP file size\n# TYPE loggie_filesource_file_size gauge\nloggie_filesource_file_size{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\"} 2048\n
    "},{"location":"reference/monitor/filesource/#file_offset","title":"file_offset","text":"
    # HELP file offset\n# TYPE loggie_filesource_file_offset gauge\nloggie_filesource_file_offset{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\"} 1024\n
    "},{"location":"reference/monitor/filesource/#line_number","title":"line_number","text":"
    # HELP current read line number\n# TYPE loggie_filesource_line_number gauge\nloggie_filesource_line_number{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\"} 20\n
    "},{"location":"reference/monitor/filesource/#line_qps","title":"line_qps","text":"
    # HELP current read line qps\n# TYPE loggie_filesource_line_qps gauge\nloggie_filesource_line_qps{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\"} 48\n
    "},{"location":"reference/monitor/filewatcher/","title":"filewatcher listener","text":"

    \u5bf9\u6587\u4ef6\u91c7\u96c6\u60c5\u51b5\u7684\u5b9a\u65f6\u68c0\u67e5\u5e76\u66b4\u9732\u6307\u6807\uff0c\u5305\u62ec\u6587\u4ef6\u540d\u79f0\u3001ackOffset\u3001\u4fee\u6539\u65f6\u95f4\u3001\u5927\u5c0f\u7b49\u3002

    "},{"location":"reference/monitor/filewatcher/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 period time.Duration \u975e\u5fc5\u586b 5m \u5b9a\u65f6\u68c0\u67e5\u95f4\u9694\u65f6\u95f4 checkUnFinishedTimeout time.Duration \u975e\u5fc5\u586b 24h \u68c0\u67e5\u6587\u4ef6\u662f\u5426\u91c7\u96c6\u5b8c\u6bd5\u7684\u8d85\u65f6\u65f6\u95f4\uff0c\u5982\u679c\u68c0\u6d4b\u5230\u6587\u4ef6\u7684\u6700\u8fd1\u4fee\u6539\u65f6\u95f4\u4e3acheckUnFinishedTimeout\u4e4b\u524d\uff0c\u540c\u65f6\u6587\u4ef6\u7684\u5e76\u672a\u91c7\u96c6\u5b8c\u6bd5\uff0c\u5219\u4f1a\u5728metrics\u4e2d\u88ab\u6807\u8bb0\u4e3aunfinished\u72b6\u6001\uff0c\u53ef\u7528\u4e8e\u68c0\u67e5\u662f\u5426\u6709\u957f\u65f6\u95f4\u672a\u88ab\u91c7\u96c6\u7684\u65e5\u5fd7\u6587\u4ef6"},{"location":"reference/monitor/filewatcher/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/filewatcher/#_2","title":"\u5168\u5c40\u7ea7\u522b","text":""},{"location":"reference/monitor/filewatcher/#total_file_count","title":"total_file_count","text":"
    # HELP file count total\n# TYPE loggie_filewatcher_total_file_count gauge\nloggie_filewatcher_total_file_count{} 20\n
    "},{"location":"reference/monitor/filewatcher/#inactive_file_count","title":"inactive_file_count","text":"
    # HELP inactive file count\n# TYPE loggie_filewatcher_inactive_file_count gauge\nloggie_filewatcher_inactive_file_count{} 20\n
    "},{"location":"reference/monitor/filewatcher/#_3","title":"\u6587\u4ef6\u7ea7\u522b","text":"

    \u6587\u4ef6\u7ea7\u522b\u5305\u62ec\u4e86\u4ee5\u4e0bprometheus labels:

    \u7531\u4e8e\u5b9a\u65f6\u626b\u63cf\u7684\u65f6\u95f4\u95f4\u9694period\u9ed8\u8ba4\u4e3a5min\uff0c\u4ee5\u4e0b\u6307\u6807\u53ef\u80fd\u5b58\u5728\u4e00\u5b9a\u7a0b\u5ea6\u7684\u5ef6\u8fdf\u3002

    "},{"location":"reference/monitor/filewatcher/#file_size","title":"file_size","text":"
    # HELP file size\n# TYPE loggie_filewatcher_file_size gauge\nloggie_filewatcher_file_size{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\", status=\"pending\"} 2048\n
    "},{"location":"reference/monitor/filewatcher/#file_ack_offset","title":"file_ack_offset","text":"
    # HELP file ack offset\n# TYPE loggie_filewatcher_file_ack_offset gauge\nloggie_filewatcher_file_ack_offset{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\", status=\"pending\"} 1024\n
    "},{"location":"reference/monitor/filewatcher/#file_last_modify","title":"file_last_modify","text":"
    # HELP file last modify timestamp\n# TYPE loggie_filewatcher_file_last_modify gauge\nloggie_filewatcher_file_last_modify{pipeline=\"xxx\", source=\"access\", filename=\"/var/log/a.log\", status=\"pending\"} 2343214422\n
    "},{"location":"reference/monitor/info/","title":"info listener","text":"

    \u5c55\u793aLoggie\u672c\u8eab\u7684\u4e00\u4e9b\u4fe1\u606f\u3002

    "},{"location":"reference/monitor/info/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 period time.Duration \u975e\u5fc5\u586b 10s \u66b4\u9732\u6307\u6807\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/monitor/info/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/info/#loggie_info_stat","title":"loggie_info_stat","text":"

    # HELP loggie_info_stat Loggie info\n# TYPE loggie_info_stat gauge\nloggie_info_stat{version=v1.4} 1\n
    \u5176\u4e2d\u7684version\u8868\u793aLoggie\u81ea\u8eab\u7684\u7248\u672c\u53f7\uff08\u7248\u672c\u53f7\u5728Loggie\u6784\u5efa\u7684\u65f6\u5019\u88ab\u6ce8\u5165\uff0c\u5982\u679c\u672a\u51fa\u73b0\u6b63\u786e\u7684\u7248\u672c\u53f7\uff0c\u8bf7\u68c0\u67e5\u4f7f\u7528go\u6784\u5efa\u7f16\u8bd1\u7684\u53c2\u6570\uff09\u3002

    "},{"location":"reference/monitor/logalert/","title":"logAlert listener","text":"

    \u7528\u4e8e\u65e5\u5fd7\u62a5\u8b66\u7684\u53d1\u9001\u3002 \u4f7f\u7528\u793a\u4f8b\u8bf7\u53c2\u8003\u65e5\u5fd7\u62a5\u8b66\u3002

    Example

    logAlert:\naddr: [ \"http://127.0.0.1:8080/loggie\" ]\nbufferSize: 100\nbatchTimeout: 10s\nbatchSize: 1\nlineLimit: 10\ntemplate: |\n*****\n
    "},{"location":"reference/monitor/logalert/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addr string\u6570\u7ec4 \u5fc5\u586b \u53d1\u9001alert\u7684http\u5730\u5740 bufferSize int \u975e\u5fc5\u586b 100 \u65e5\u5fd7\u62a5\u8b66\u53d1\u9001\u7684buffer\u5927\u5c0f\uff0c\u5355\u4f4d\u4e3a\u62a5\u8b66\u4e8b\u4ef6\u4e2a\u6570 batchTimeout time.Duration \u975e\u5fc5\u586b 10s \u6bcf\u4e2a\u62a5\u8b66\u53d1\u9001batch\u7684\u6700\u5927\u53d1\u9001\u65f6\u95f4 batchSize int \u975e\u5fc5\u586b 10 \u6bcf\u4e2a\u62a5\u8b66\u53d1\u9001batch\u7684\u6700\u5927\u5305\u542b\u62a5\u8b66\u8bf7\u6c42\u4e2a\u6570 template string \u975e\u5fc5\u586b \u6e32\u67d3\u53d1\u9001\u7684alert\u7ed3\u6784\u4f53\u7684go template\u6a21\u677f timeout time.Duration \u975e\u5fc5\u586b 30s \u53d1\u9001alert\u7684http timeout headers map \u975e\u5fc5\u586b \u53d1\u9001alert\u7684http header method string \u975e\u5fc5\u586b POST \u53d1\u9001alert\u7684http method, \u5982\u679c\u4e0d\u586bput(\u4e0d\u533a\u5206\u5927\u5c0f\u5199)\uff0c\u90fd\u8ba4\u4e3a\u662fPOST lineLimit int \u975e\u5fc5\u586b 10 \u591a\u884c\u65e5\u5fd7\u91c7\u96c6\u60c5\u51b5\u4e0b\uff0c\u6bcf\u4e2aalert\u4e2d\u5305\u542b\u7684\u6700\u5927\u65e5\u5fd7\u884c\u6570"},{"location":"reference/monitor/overview/","title":"Monitor","text":"

    \u76d1\u63a7\u4e8b\u4ef6\u603b\u7ebf\uff0c\u6240\u6709\u7684\u7ec4\u4ef6\u90fd\u53ef\u4ee5\u53d1\u51fa\u81ea\u5df1\u7684metrics\u6307\u6807\u6570\u636e\uff0c\u7531listeners\u6d88\u8d39\u5904\u7406\u3002

    Example

    monitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nsink: ~    
    "},{"location":"reference/monitor/overview/#logger","title":"logger","text":"

    Loggie\u652f\u6301\u5c06metrics\u6307\u6807\u8f93\u51fa\u5230\u65e5\u5fd7\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7logger\u914d\u7f6e\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 logger.enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f logger.period time.Duration \u975e\u5fc5\u586b 10s \u6307\u6807\u6253\u5370\u7684\u65f6\u95f4\u95f4\u9694\uff0c\u6570\u636e\u91cf\u8f83\u5927\u65f6\u5efa\u8bae\u5c06\u95f4\u9694\u5ef6\u957f\uff0c\u598230s\u30015m logger.pretty bool \u975e\u5fc5\u586b false \u6253\u5370\u7684\u6307\u6807json\u662f\u5426\u9700\u8981\u53cb\u597d\u5c55\u793a logger.additionLogEnabled bool \u975e\u5fc5\u586b false \u662f\u5426\u9700\u8981\u5c06\u6253\u5370\u7684\u6307\u6807\u5355\u72ec\u8f93\u51fa\u5230\u53e6\u5916\u7684\u65e5\u5fd7\u6587\u4ef6\u4e2d\uff0c\u5728\u6570\u636e\u91cf\u6bd4\u8f83\u591a\u7684\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u6211\u4eec\u914d\u7f6e\u7684\u6253\u5370\u65f6\u95f4\u95f4\u9694\u8f83\u77ed\uff0c\u53ef\u4ee5\u6253\u5f00\u8be5\u5f00\u5173\uff0c\u907f\u514d\u592a\u591a\u7684metrics\u65e5\u5fd7\u5e72\u6270 logger.additionLogConfig \u975e\u5fc5\u586b \u989d\u5916\u8f93\u51fa\u7684\u65e5\u5fd7\u914d\u7f6e\u53c2\u6570 logger.additionLogConfig.directory bool \u975e\u5fc5\u586b /data/loggie/log \u989d\u5916\u8f93\u51fa\u7684\u65e5\u5fd7\u76ee\u5f55 logger.additionLogConfig.maxBackups int \u975e\u5fc5\u586b metrics.log \u65e5\u5fd7\u8f6e\u8f6c\u6700\u591a\u4fdd\u7559\u7684\u6587\u4ef6\u4e2a\u6570\uff0c\u9ed8\u8ba4\u4e3a3 logger.additionLogConfig.maxSize int \u975e\u5fc5\u586b 1024 \u65e5\u5fd7\u8f6e\u8f6c\u7684\u65f6\u5019\uff0c\u6700\u5927\u7684\u6587\u4ef6\u5927\u5c0f\uff0c\u5355\u4f4d\u4e3aMB logger.additionLogConfig.maxAge int \u975e\u5fc5\u586b 14 \u65e5\u5fd7\u8f6e\u8f6c\u6700\u5927\u4fdd\u7559\u7684\u5929\u6570 logger.additionLogConfig.timeFormat string \u975e\u5fc5\u586b 2006-01-02 15:04:05 \u6bcf\u884c\u65e5\u5fd7\u8f93\u51fa\u7684\u65f6\u95f4\u683c\u5f0f"},{"location":"reference/monitor/overview/#listeners","title":"listeners","text":"

    \u8868\u793a\u5177\u4f53\u542f\u52a8\u7684listeners\u3002 \u914d\u7f6e\u4e0d\u586b\u5199\u5373\u4e3a\u5173\u95ed\uff0c\u4e0d\u542f\u52a8\u8be5Listener\uff0c\u76f8\u5173\u7684\u7684\u6307\u6807\u4e5f\u4e0d\u4f1a\u88ab\u5904\u7406\u548c\u66b4\u9732\u3002

    "},{"location":"reference/monitor/queue/","title":"queue listener","text":""},{"location":"reference/monitor/queue/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 period time.Duration \u975e\u5fc5\u586b 10s listener\u6d88\u8d39\u5904\u7406\u6570\u636e\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/monitor/queue/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/queue/#capacity","title":"capacity","text":"
    # HELP queue capacity\n# TYPE loggie_queue_capacity gauge\nloggie_queue_capacity{pipeline=\"xxx\", type=\"channel\"} 2048\n
    "},{"location":"reference/monitor/queue/#size","title":"size","text":"
    # HELP queue size\n# TYPE loggie_queue_size gauge\nloggie_queue_size{pipeline=\"xxx\", type=\"channel\"} 2048\n
    "},{"location":"reference/monitor/queue/#fill_percentage","title":"fill_percentage","text":"
    # HELP how full is queue\n# TYPE loggie_queue_fill_percentage gauge\nloggie_queue_fill_percentage{pipeline=\"xxx\", type=\"channel\"} 50\n
    "},{"location":"reference/monitor/reload/","title":"reload listener","text":"

    reload\u7684\u6307\u6807\uff0c\u603b\u7684reload\u6b21\u6570\u3002

    "},{"location":"reference/monitor/reload/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/reload/#total","title":"total","text":"
    # HELP Loggie reload total count\n# TYPE loggie_reload_total gauge\nloggie_reload_total{} 10\n
    "},{"location":"reference/monitor/sink/","title":"sink listener","text":"

    sink\u53d1\u9001\u7aef\u7684\u76d1\u63a7\u6307\u6807\u5904\u7406\uff0c\u5305\u62ec\u53d1\u9001\u6210\u529f\u7684event\u6570\u91cf\u3001\u53d1\u9001\u5931\u8d25\u7684event\u6570\u91cf\u3001event qps\u7b49

    "},{"location":"reference/monitor/sink/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 period time.Duration \u975e\u5fc5\u586b 10s listener\u6d88\u8d39\u5904\u7406\u6570\u636e\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/monitor/sink/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/sink/#success_event","title":"success_event","text":"
    # HELP send event success count\n# TYPE loggie_sink_success_event gauge\nloggie_sink_success_event{pipeline=\"xxx\", source=\"access\"} 2048\n
    "},{"location":"reference/monitor/sink/#failed_event","title":"failed_event","text":"
    # HELP send event failed count\n# TYPE loggie_sink_failed_event gauge\nloggie_sink_failed_event{pipeline=\"xxx\", source=\"access\"} 2048\n
    "},{"location":"reference/monitor/sink/#event_qps","title":"event_qps","text":"
    # HELP send success event failed count\n# TYPE loggie_sink_event_qps gauge\nloggie_sink_event_qps{pipeline=\"xxx\", source=\"access\"} 2048\n
    "},{"location":"reference/monitor/sys/","title":"sys listener","text":"

    Loggie\u672c\u8eab\u7684CPU\u548cMemory\u6307\u6807

    "},{"location":"reference/monitor/sys/#_1","title":"\u914d\u7f6e","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 period time.Duration \u975e\u5fc5\u586b 10s listener\u6d88\u8d39\u5904\u7406\u6570\u636e\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/monitor/sys/#metrics","title":"Metrics","text":""},{"location":"reference/monitor/sys/#cpu_percent","title":"cpu_percent","text":"
    # HELP loggie_sys_cpu_percent Loggie cpu percent\n# TYPE loggie_sys_cpu_percent gauge\nloggie_sys_cpu_percent 0.37\n
    "},{"location":"reference/monitor/sys/#mem_rss","title":"mem_rss","text":"
    # HELP loggie_sys_mem_rss Loggie memory rss bytes\n# TYPE loggie_sys_mem_rss gauge\nloggie_sys_mem_rss 2.5853952e+07\n
    "},{"location":"reference/pipelines/interceptor/addhostmeta/","title":"addHostMeta","text":"

    \u7528\u4e8e\u4e3b\u673a\u90e8\u7f72\u60c5\u51b5\u4e0b\uff0c\u65b0\u589e\u4e3b\u673a\u7684\u4e00\u4e9b\u5143\u4fe1\u606f\u53c2\u6570\u3002

    Example

    interceptors:\n- type: addHostMeta\naddFields:\nhostname: \"${hostname}\"\nip: \"${ip}\"\nos: \"${os}\"\nplatform: \"${platform}\"\nkernelVersion: \"${kernelVersion}\"\nkernelArch: \"${kernelArch}\"\n
    "},{"location":"reference/pipelines/interceptor/addhostmeta/#addfields","title":"addFields","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addFields map \u5fc5\u586b \u9700\u8981\u6dfb\u52a0\u7684\u5143\u4fe1\u606f

    \u76ee\u524d\u652f\u6301\u6dfb\u52a0\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\u6709\uff1a

    \u52a0\u4e0a\u4ee5\u4e0a\u7684\u5143\u4fe1\u606f\uff0c\u5c55\u793a\u51fa\u7684\u65e5\u5fd7\u793a\u4f8b\uff1a

    Example

     {\n\"@timestamp\": \"2023-07-13T07:13:50.394Z\",\n\"host\": {\n\"kernelVersion\": \"22.2.0\",\n\"os\": \"darwin\",\n\"platform\": \"darwin\",\n\"platformFamily\": \"Standalone Workstation\",\n\"platformVersion\": \"13.1\",\n\"hostname\": \"xxxMacBook-Pro.local\",\n\"ip\": [\n\"10.xxx.xxx.221\",\n\"192.xxx.xxx.1\"\n],\n\"kernelArch\": \"arm64\"\n},\n\"body\": \"xxx\"\n}\n
    "},{"location":"reference/pipelines/interceptor/addhostmeta/#fieldsname","title":"fieldsName","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fieldsName string \u975e\u5fc5\u586b host \u6dfb\u52a0\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\u540d\u79f0"},{"location":"reference/pipelines/interceptor/addk8smeta/","title":"addK8sMeta","text":"

    \u7528\u4e8e\u4eceevent\u4e2d\u7684\u67d0\u4e9b\u5b57\u6bb5\uff08\u6bd4\u5982\u65e5\u5fd7\u6587\u4ef6\u7684\u8def\u5f84\u4e2d\uff09\uff0c\u83b7\u53d6\u5230\uff1a

    \u4ee5\u4e0a3\u79cd\u4efb\u610f\u5176\u4e00\u7684\u7d22\u5f15\u4fe1\u606f\uff0c\u6b64\u65f6Loggie\u53ef\u6839\u636e\u8be5\u7d22\u5f15\u67e5\u8be2\u5230\u5177\u4f53\u7684Pod\uff0c\u5e76\u6dfb\u52a0\u989d\u5916\u7684kubernetes${node.name}\u3001${namespace}\u3001${pod.uid}\u3001${pod.name}\u7b49\u5143\u4fe1\u606f\u4f5c\u52a0\u5165\u5230event\u4e2d\uff0c\u7528\u4e8e\u540e\u7eed\u7684\u5206\u6790\u5904\u7406\u3002 \u5c5e\u4e8esource interceptor\u3002

    Example

    interceptors:\n- type: addK8sMeta\npattern: \"/var/log/${pod.uid}/${pod.name}/\"\naddFields:\nnodename: \"${node.name}\"\nnamespace: \"${namespace}\"\npodname: \"${pod.name}\"\n
    "},{"location":"reference/pipelines/interceptor/addk8smeta/#pattern","title":"pattern","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 pattern string \u5fc5\u586b \u63d0\u53d6\u5b57\u6bb5\u7684\u5339\u914d\u6a21\u578b

    \u5fc5\u987b\u5305\u542b\u6709\uff1a

    \u5176\u4e2d\u4e4b\u4e00\u3002

    \u6bd4\u5982\uff1a/var/log/${pod.uid}/${pod.name}/

    "},{"location":"reference/pipelines/interceptor/addk8smeta/#patternfields","title":"patternFields","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 patternFields string \u975e\u5fc5\u586b \u9ed8\u8ba4\u4f1a\u4eceevent\u4e2d\u83b7\u53d6\u7cfb\u7edf\u5b57\u6bb5\u91cc\u7684filename\uff0c\u6b64\u65f6\u9700\u8981\u4f7f\u7528file source \u4eceevent\u4e2d\u7528\u4e8e\u63d0\u53d6\u7684pattern\u7684\u5b57\u6bb5"},{"location":"reference/pipelines/interceptor/addk8smeta/#fieldsname","title":"fieldsName","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fieldsName string \u975e\u5fc5\u586b kubernetes \u6dfb\u52a0\u5143\u4fe1\u606f\u7684\u5b57\u6bb5"},{"location":"reference/pipelines/interceptor/addk8smeta/#addfields","title":"addFields","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addFields map \u975e\u5fc5\u586b \u9700\u8981\u6dfb\u52a0\u7684\u5143\u4fe1\u606f

    \u76ee\u524d\u652f\u6301\u6dfb\u52a0\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\u6709\uff1a

    "},{"location":"reference/pipelines/interceptor/limit/","title":"rateLimit","text":"

    \u7528\u4e8e\u65e5\u5fd7\u9650\u6d41\u3002 \u5c5e\u4e8esource interceptor\u3002

    Example

    interceptors:\n- type: rateLimit\nqps: 4000\n
    "},{"location":"reference/pipelines/interceptor/limit/#qps","title":"qps","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 qps int \u975e\u5fc5\u586b 2048 \u9650\u6d41qps"},{"location":"reference/pipelines/interceptor/logalert/","title":"logAlert","text":"

    \u7528\u4e8e\u65e5\u5fd7\u62a5\u8b66\u68c0\u6d4b\u3002 \u5c5e\u4e8esource interceptor\u3002 \u4f7f\u7528\u793a\u4f8b\u8bf7\u53c2\u8003\u65e5\u5fd7\u62a5\u8b66\u3002

    Example

    interceptors:\n- type: logAlert\nmatcher:\ncontains: [\"error\", \"err\"]\nregexp: ['.*example.*']\nignore: ['.*INFO.*']\nsendOnlyMatched: true\nadditions:\nmodule: \"loggie\"\nalertname: \"alert-test\"\ncluster: \"local-cluster\"\nnamespace: \"default\"\nadvanced:\nenabled: true\nmode: [ \"noData\",\"regexp\" ]\nduration: 6h\nmatchType: \"any\"\nrules:\n- regexp: '(?<date>.*?) (?<time>[\\S|\\\\.]+)  (<status>[\\S|\\\\.]+) (?<u>.*?) --- (?<thread>\\[*?\\]) (?<pkg>.*) : (?<message>(.|\\n|\\t)*)'\nmatchType: \"any\"\ngroups:\n- key: status\noperator: \"eq\"\nvalue: WARN\n- key: thread\noperator: \"eq\"\nvalue: 200\n- regexp: '(?<date>.*?) (?<time>[\\S|\\\\.]+) (?<status>[\\S|\\\\.]+) (?<u>.*?) --- (?<thread>\\[.*?\\]) (?<pkg>.*) : (?<message>(.|\\n|\\t)*)'\nmatchType: \"any\"\ngroups:\n- key: status\noperator: \"eq\"\nvalue: ERROR\n
    "},{"location":"reference/pipelines/interceptor/logalert/#matcher","title":"matcher","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 matcher.contains string\u6570\u7ec4 \u975e\u5fc5\u586b \u65e5\u5fd7\u6570\u636e\u5305\u542b\u5b57\u7b26\u4e32\u68c0\u6d4b matcher.regexp string\u6570\u7ec4 \u975e\u5fc5\u586b \u65e5\u5fd7\u6570\u636e\u6b63\u5219\u68c0\u6d4b matcher.target string \u975e\u5fc5\u586b body \u6839\u636e\u65e5\u5fd7\u6570\u636e\u7684\u8be5\u5b57\u6bb5\u8fdb\u884c\u68c0\u6d4b\uff0c\u5982\u679c\u8fdb\u884c\u65e5\u5fd7\u5207\u5206\u6216\u8005drop body\u5b57\u6bb5\uff0c\u8bf7\u586b\u5199\u6240\u9700\u5b57\u6bb5"},{"location":"reference/pipelines/interceptor/logalert/#ignore","title":"ignore","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ignore string\u6570\u7ec4 \u975e\u5fc5\u586b \u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u82e5\u5339\u914d\uff0c\u5219\u5ffd\u7565\u8fd9\u6761\u65e5\u5fd7\uff0c\u5411\u4e0b\u4f20\u9012\uff0c\u53ef\u7528\u4e8e\u544a\u8b66\u65f6\u6392\u9664\u67d0\u4e9b\u65e5\u5fd7"},{"location":"reference/pipelines/interceptor/logalert/#additions","title":"additions","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 additions map \u975e\u5fc5\u586b \u53d1\u9001alert\u65f6\uff0c\u989d\u5916\u6dfb\u52a0\u7684\u5b57\u6bb5\uff0c\u4f1a\u653e\u5728_additions\u5b57\u6bb5\u4e2d\uff0c\u53ef\u7528\u4f5c\u6e32\u67d3\u3002"},{"location":"reference/pipelines/interceptor/logalert/#sendonlymatched","title":"sendOnlyMatched","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sendOnlyMatched bool \u975e\u5fc5\u586b false \u662f\u5426\u4ec5\u5c06\u5339\u914d\u6210\u529f\u7684\u6570\u636e\u53d1\u9001\u81f3sink"},{"location":"reference/pipelines/interceptor/logalert/#advanced","title":"advanced","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u9ad8\u7ea7\u5339\u914d\u6a21\u5f0f mode string\u5217\u8868 \u975e\u5fc5\u586b \u5339\u914d\u6a21\u5f0f \u652f\u6301regexp\u548cnoData\u4e24\u79cd\uff0c\u53ef\u540c\u65f6\u751f\u6548\u3002 duration time.Duration \u975e\u5fc5\u586b noData\u6a21\u5f0f\u5fc5\u586b\uff0c\u5728\u4e00\u5b9a\u65f6\u95f4\u5185\uff0c\u6ca1\u6709\u65e5\u5fd7\u4f1a\u53d1\u51fa\u544a\u8b66\u3002 matchType string \u975e\u5fc5\u586b regexp\u6a21\u5f0f\u5fc5\u586b\uff0c\u53ef\u9009any\u6216\u8005all\uff0c\u8868\u793a\u5339\u914d\u4efb\u610f\u6216\u8005\u5168\u90e8\u89c4\u5219rule rules Rule\u5217\u8868 \u975e\u5fc5\u586b regexp\u6a21\u5f0f\u5fc5\u586b\uff0c\u5339\u914d\u89c4\u5219\u5217\u8868"},{"location":"reference/pipelines/interceptor/logalert/#advancedrule","title":"advanced.rule","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 regexp string \u5fc5\u586b \u6b63\u5219\u5206\u7ec4\u8868\u8fbe\u5f0f matchType string \u5fc5\u586b \u53ef\u9009any\u6216\u8005all\uff0c\u8868\u793a\u5339\u914d\u4efb\u610f\u6216\u8005\u5168\u90e8\u5339\u914d\u7ec4group groups group\u5217\u8868 \u5fc5\u586b \u5339\u914d\u7ec4\u5217\u8868"},{"location":"reference/pipelines/interceptor/logalert/#advancedrulegroup","title":"advanced.rule.group","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 key string \u5fc5\u586b \u5206\u7ec4\u5339\u914d\u4e4b\u540e\u7684\u952e\u503c operator string \u5fc5\u586b \u64cd\u4f5c\u7b26\uff0c\u76ee\u524d\u652f\u6301eq\uff0cgt\uff0clt value string \u5fc5\u586b \u76ee\u6807\u503c"},{"location":"reference/pipelines/interceptor/maxbytes/","title":"maxbytes","text":"

    \u5bf9\u539f\u59cb\u5355\u884c\u65e5\u5fd7\u7684\u5927\u5c0f\u8fdb\u884c\u9650\u5236\uff0c\u907f\u514d\u5355\u884c\u65e5\u5fd7\u6570\u636e\u91cf\u592a\u5927\u5f71\u54cdLoggie\u5185\u5b58\u548c\u7a33\u5b9a\u6027\u3002 \u7cfb\u7edf\u5185\u7f6e\uff0c\u9ed8\u8ba4\u52a0\u8f7d\uff0c\u5c5e\u4e8esource interceptor\u3002

    Example

    interceptors:\n- type: maxbytes\nmaxBytes: 102400\n
    "},{"location":"reference/pipelines/interceptor/maxbytes/#maxbytes_1","title":"maxBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxBytes int \u975e\u5fc5\u586b 131072(128KB) \u5355\u884c\u6700\u5927\u5b57\u8282\u4e2a\u6570\uff0c\u8d85\u51fa\u7684\u90e8\u5206\u5c06\u4f1a\u88ab\u4e22\u5f03"},{"location":"reference/pipelines/interceptor/maxbytes/#target","title":"target","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 target string \u975e\u5fc5\u586b body \u76ee\u6807\u5b57\u6bb5"},{"location":"reference/pipelines/interceptor/metrics/","title":"metric","text":"

    \u5bf9\u6570\u636e\u4f20\u8f93\u8fdb\u884c\u91c7\u6837metics\uff0c\u63d0\u4f9b\u7ed9monitor eventbus\u4e2dlistener\u4f7f\u7528\u3002 \u7cfb\u7edf\u5185\u7f6e\uff0c\u9ed8\u8ba4\u52a0\u8f7d\uff0c\u5c5e\u4e8esink interceptor\u3002

    Example

    interceptors:\n- type: metric\n
    "},{"location":"reference/pipelines/interceptor/normalize/","title":"normalize","text":"

    \uff08\u8be5interceptor\u540e\u7eed\u4e0d\u518d\u7ef4\u62a4\uff0c\u5efa\u8bae\u4f7f\u7528transformer\u66ff\u6362\uff09

    \u7528\u4e8e\u65e5\u5fd7\u5207\u5206\u5904\u7406\u3002 \u5c5e\u4e8esource interceptor\u3002\u53ef\u6307\u5b9a\u53ea\u88ab\u67d0\u4e9bsource\u4f7f\u7528\u3002

    "},{"location":"reference/pipelines/interceptor/normalize/#processors","title":"processors","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 processors \u6570\u7ec4 \u5fc5\u586b \u65e0 \u6240\u6709\u7684\u5904\u7406processor\u5217\u8868

    \u914d\u7f6e\u7684processor\u5c06\u6309\u7167\u987a\u5e8f\u4f9d\u6b21\u6267\u884c\u3002

    Tips

    Loggie\u652f\u6301\u4f7f\u7528a.b\u7684\u5f62\u5f0f\u5f15\u7528\u5d4c\u5957\u7684\u5b57\u6bb5\u3002 \u6bd4\u5982\u6570\u636e\u4e3a:

    {\n\"fields\": {\n\"hello\": \"world\"\n}\n}\n
    \u4e0b\u9762\u7684processor\u914d\u7f6e\u4e2d\u5747\u53ef\u4ee5\u4f7f\u7528fields.hello\u6307\u5b9a\u5d4c\u5957\u5728fields\u91cc\u7684hello: world\u3002

    "},{"location":"reference/pipelines/interceptor/normalize/#addmeta","title":"addMeta","text":"

    \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cLoggie\u4e0d\u4f1a\u6dfb\u52a0\u4efb\u4f55\u7684\u7cfb\u7edf\u5185\u90e8\u4fe1\u606f\u5230\u539f\u59cb\u6570\u636e\u4e2d\u3002 \u53ef\u901a\u8fc7addMeta\u6dfb\u52a0\u7cfb\u7edf\u5185\u7f6e\u5b57\u6bb5\u53d1\u9001\u7ed9\u4e0b\u6e38\u3002

    Note

    \u8bf7\u6ce8\u610f\uff0c\u5728pipeline\u4e2d\u914d\u7f6eaddMeta\uff0c\u53ea\u4f1a\u5f71\u54cd\u8be5pipeline\u53d1\u9001\u7684\u6240\u6709\u6570\u636e\uff0c\u5982\u679c\u9700\u8981\u5168\u5c40\u751f\u6548\uff0c\u8bf7\u5728defaults\u4e2d\u914d\u7f6enormalize.addMeta\u3002

    loggie:\n  defaults:\n    interceptors:\n    - type: normalize\n      name: global\n      processors:\n       - addMeta: ~\n
    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 target string \u975e\u5fc5\u586b meta \u7cfb\u7edf\u5185\u7f6e\u5b57\u6bb5\u6dfb\u52a0\u5230event\u4e2d\u7684\u5b57\u6bb5\u540d"},{"location":"reference/pipelines/interceptor/normalize/#regex","title":"regex","text":"

    \u5c06\u6307\u5b9a\u5b57\u6bb5\u8fdb\u884c\u6b63\u5219\u63d0\u53d6\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 regex.pattern string \u5fc5\u586b \u65e0 \u6b63\u5219\u89e3\u6790\u89c4\u5219 regex.target string \u975e\u5fc5\u586b body \u6b63\u5219\u89e3\u6790\u7684\u76ee\u6807\u5b57\u6bb5 regex.ignoreError bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u9519\u8bef

    Example

    interceptors:\n- type: normalize\nprocessors:\n- regex:\npattern: '(?<ip>\\S+) (?<id>\\S+) (?<u>\\S+) (?<time>\\[.*?\\]) (?<url>\\\".*?\\\") (?<status>\\S+) (?<size>\\S+)'\n

    \u4f7f\u7528\u4ee5\u4e0a\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u53ef\u4ee5\u5c06\u4ee5\u4e0b\u793a\u4f8b\u7684\u65e5\u5fd7\uff1a

    10.244.0.1 - - [13/Dec/2021:12:40:48 +0000] \"GET / HTTP/1.1\" 404 683\n
    \u8f6c\u6362\u6210\uff1a
    \"ip\": \"10.244.0.1\",\n\"id\": \"-\",\n\"u\": \"-\",\n\"time\": \"[13/Dec/2021:12:40:48 +0000]\",\n\"url\": \"\\\"GET / HTTP/1.1\\\"\",\n\"status\": \"404\",\n\"size\": \"683\"\n

    \u5177\u4f53\u914d\u7f6e\u7684\u65f6\u5019\uff0c\u5efa\u8bae\u5148\u4f7f\u7528\u4e00\u4e9b\u6b63\u5219\u8c03\u8bd5\u5de5\u5177 (https://regex101.com/) \u9a8c\u8bc1\u662f\u5426\u53ef\u4ee5\u5339\u914d\u3002

    "},{"location":"reference/pipelines/interceptor/normalize/#jsondecode","title":"jsonDecode","text":"

    \u5c06\u6307\u5b9a\u5b57\u6bb5json\u89e3\u6790\u63d0\u53d6\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 jsonDecode.target string \u975e\u5fc5\u586b body json decode\u7684\u76ee\u6807\u5b57\u6bb5 jsonDecode.ignoreError bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u9519\u8bef

    Example

    interceptors:\n- type: normalize\nprocessors:\n- jsonDecode: ~\n
    "},{"location":"reference/pipelines/interceptor/normalize/#split","title":"split","text":"

    \u5c06\u6307\u5b9a\u5b57\u6bb5\u901a\u8fc7\u5206\u9694\u7b26\u8fdb\u884c\u63d0\u53d6\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 split.target string \u975e\u5fc5\u586b body split\u7684\u76ee\u6807\u5b57\u6bb5 split.separator string \u5fc5\u586b \u65e0 \u5206\u9694\u7b26 split.max int \u975e\u5fc5\u586b -1 \u901a\u8fc7\u5206\u5272\u7b26\u5206\u5272\u540e\u5f97\u5230\u7684\u6700\u591a\u7684\u5b57\u6bb5\u6570 split.keys string\u6570\u7ec4 \u5fc5\u586b \u65e0 \u5206\u5272\u540e\u5b57\u6bb5\u5bf9\u5e94\u7684key split.ignoreError bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u9519\u8bef

    Example

    basemax

    interceptors:\n- type: normalize\nprocessors:\n- split:\nseparator: '|'\nkeys: [\"time\", \"order\", \"service\", \"price\"]\n
    \u4f7f\u7528\u4ee5\u4e0asplit\u914d\u7f6e\u53ef\u4ee5\u5c06\u65e5\u5fd7\uff1a
    2021-08-08|U12345|storeCenter|13.14\n
    \u8f6c\u6362\u6210\uff1a
    \"time\": \"2021-08-08\"\n\"order\": \"U12345\"\n\"service\": \"storeCenter\"\n\"price\": 13.14\n

    interceptors:\n- type: normalize\nprocessors:\n- split:\nseparator: ' '\nmax: 2\nkeys: [\"time\", \"content\"]\n
    \u901a\u8fc7\u589e\u52a0max\u53c2\u6570\uff0c\u53ef\u4ee5\u63a7\u5236\u6700\u591a\u5206\u5272\u7684\u5b57\u6bb5\u3002 \u6bd4\u5982\u4ee5\u4e0b\u65e5\u5fd7:
    2021-08-08 U12345 storeCenter 13.14\n
    \u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0a\u914d\u7f6e\u63d0\u53d6\u4e3a:
    \"time\": \"2021-08-08\"\n\"content\": \"U12345 storeCenter 13.14\"\n

    "},{"location":"reference/pipelines/interceptor/normalize/#drop","title":"drop","text":"

    \u4e22\u5f03\u6307\u5b9a\u5b57\u6bb5\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 drop.targets string\u6570\u7ec4 \u5fc5\u586b \u65e0 drop\u7684\u5b57\u6bb5

    Example

    interceptors:\n- type: normalize\nprocessors:\n- drop:\ntargets: [\"id\", \"body\"]\n
    "},{"location":"reference/pipelines/interceptor/normalize/#rename","title":"rename","text":"

    \u91cd\u547d\u540d\u6307\u5b9a\u5b57\u6bb5\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 rename.convert \u6570\u7ec4 \u5fc5\u586b \u65e0 rename.convert[n].from string \u5fc5\u586b \u65e0 rename\u7684\u76ee\u6807 rename.convert[n].to string \u5fc5\u586b \u65e0 rename\u540e\u7684\u540d\u79f0

    Example

    interceptors:\n- type: normalize\nprocessors:\n- rename:\nconvert:\n- from: \"hello\"\nto: \"world\"\n
    "},{"location":"reference/pipelines/interceptor/normalize/#add","title":"add","text":"

    \u65b0\u589e\u5b57\u6bb5\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 add.fields map \u5fc5\u586b \u65e0 \u65b0\u589e\u7684key:value\u503c

    Example

    interceptors:\n- type: normalize\nprocessors:\n- add:\nfields:\nhello: world\n
    "},{"location":"reference/pipelines/interceptor/normalize/#convert","title":"convert","text":"

    \u5b57\u6bb5\u7c7b\u578b\u8f6c\u6362\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 convert.convert \u6570\u7ec4 \u5fc5\u586b \u65e0 convert.convert[n].from string \u5fc5\u586b \u65e0 \u9700\u8981\u8f6c\u6362\u7684\u5b57\u6bb5\u540d convert.convert[n].to string \u5fc5\u586b \u65e0 \u8f6c\u6362\u540e\u7684\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1a\"bool\", \"integer\", \"float\"

    Example

    interceptors:\n- type: normalize\nprocessors:\n- convert:\nconvert:\n- from: count\nto: float\n
    "},{"location":"reference/pipelines/interceptor/normalize/#copy","title":"copy","text":"

    \u5b57\u6bb5\u590d\u5236\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 copy.convert \u6570\u7ec4 \u5fc5\u586b \u65e0 copy.convert[n].from string \u5fc5\u586b \u65e0 \u9700\u8981\u590d\u5236\u7684\u5b57\u6bb5\u540d copy.convert[n].to string \u5fc5\u586b \u65e0 \u590d\u5236\u540e\u7684\u5b57\u6bb5\u540d

    Example

    interceptors:\n- type: normalize\nprocessors:\n- copy:\nconvert:\n- from: hello\nto: world\n
    "},{"location":"reference/pipelines/interceptor/normalize/#underroot","title":"underRoot","text":"

    \u5c06\u5b57\u6bb5\u4e2d\u7684\u6240\u6709key:value\u653e\u5230event\u6700\u5916\u5c42\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 underRoot.keys string\u6570\u7ec4 \u5fc5\u586b \u65e0 \u9700\u8981underRoot\u7684\u5b57\u6bb5\u540d

    Example

    interceptors:\n- type: normalize\nprocessors:\n- underRoot:\nkeys: [\"fields\"]\n
    "},{"location":"reference/pipelines/interceptor/normalize/#timestamp","title":"timestamp","text":"

    \u8f6c\u6362\u65f6\u95f4\u683c\u5f0f\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timestamp.convert \u6570\u7ec4 \u5fc5\u586b \u65e0 timestamp.convert[n].from string \u5fc5\u586b \u65e0 \u6307\u5b9a\u8f6c\u6362\u65f6\u95f4\u683c\u5f0f\u7684\u5b57\u6bb5 timestamp.convert[n].fromLayout string \u5fc5\u586b \u65e0 \u6307\u5b9a\u5b57\u6bb5\u7684\u65f6\u95f4\u683c\u5f0f(golang\u5f62\u5f0f) timestamp.convert[n].toLayout string \u5fc5\u586b \u65e0 \u8f6c\u6362\u540e\u7684\u65f6\u95f4\u683c\u5f0f(golang\u5f62\u5f0f)\uff0c\u53e6\u5916\u53ef\u4e3aunix\u548cunix_ms timestamp.convert[n].toType string \u975e\u5fc5\u586b \u65e0 \u8f6c\u6362\u540e\u7684\u65f6\u95f4\u5b57\u6bb5\u7c7b\u578b timestamp.convert[n].local bool \u975e\u5fc5\u586b false \u662f\u5426\u5c06\u89e3\u6790\u7684\u65f6\u95f4\u8f6c\u6210\u5f53\u524d\u65f6\u533a

    Example

    interceptors:\n- type: normalize\nprocessors:\n- timestamp:\nconvert:\n- from: logtime\nfromLayout: \"2006-01-02T15:04:05Z07:00\"\ntoLayout: \"unix\"\n

    \u4ee5\u4e0a\u7684layout\u53c2\u6570\u9700\u8981\u586b\u5199golang\u5f62\u5f0f\uff0c\u53ef\u53c2\u8003\uff1a

    const (\n    Layout      = \"01/02 03:04:05PM '06 -0700\" // The reference time, in numerical order.\n    ANSIC       = \"Mon Jan _2 15:04:05 2006\"\n    UnixDate    = \"Mon Jan _2 15:04:05 MST 2006\"\n    RubyDate    = \"Mon Jan 02 15:04:05 -0700 2006\"\n    RFC822      = \"02 Jan 06 15:04 MST\"\n    RFC822Z     = \"02 Jan 06 15:04 -0700\" // RFC822 with numeric zone\n    RFC850      = \"Monday, 02-Jan-06 15:04:05 MST\"\n    RFC1123     = \"Mon, 02 Jan 2006 15:04:05 MST\"\n    RFC1123Z    = \"Mon, 02 Jan 2006 15:04:05 -0700\" // RFC1123 with numeric zone\n    RFC3339     = \"2006-01-02T15:04:05Z07:00\"\n    RFC3339Nano = \"2006-01-02T15:04:05.999999999Z07:00\"\n    Kitchen     = \"3:04PM\"\n    // Handy time stamps.\n    Stamp      = \"Jan _2 15:04:05\"\n    StampMilli = \"Jan _2 15:04:05.000\"\n    StampMicro = \"Jan _2 15:04:05.000000\"\n    StampNano  = \"Jan _2 15:04:05.000000000\"\n)\n
    \u8fd8\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\u3002

    "},{"location":"reference/pipelines/interceptor/normalize/#fmt","title":"fmt","text":"

    \u5b57\u6bb5\u5185\u5bb9\u91cd\u65b0\u683c\u5f0f\u5316\u3002\u53ef\u6839\u636e\u5176\u4ed6\u5b57\u6bb5\u5185\u5bb9\u8fdb\u884c\u7ec4\u5408\u548c\u683c\u5f0f\u5316\u3002

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fmt.fields map \u5fc5\u586b \u65e0 key\u8868\u793a\u9700\u8981\u683c\u5f0f\u5316\u7684\u5b57\u6bb5\u540d\u79f0\uff0cvalue\u4e3a\u9700\u8981\u683c\u5f0f\u5316\u7684\u5185\u5bb9\u3002\u53ef\u4f7f\u7528${}\u7684\u65b9\u5f0f\u8868\u793a\u53d6\u503c\u67d0\u4e2a\u5b57\u6bb5

    Example

    interceptors:\n- type: normalize\nprocessors:\n- fmt:\nfields:\nd: new-${a.b}-${c}\n
    "},{"location":"reference/pipelines/interceptor/overview/","title":"Overview","text":"

    interceptors\u5b57\u6bb5\u4e3a\u6570\u7ec4\uff0c\u4e00\u4e2aPipeline\u4e2d\u53ef\u586b\u5199\u591a\u4e2ainterceptor\u7ec4\u4ef6\u914d\u7f6e\u3002

    \u76ee\u524d\uff0cinterceptor\u5206\u4e3a\u4e24\u79cd\u7c7b\u578b\uff1a

    \u4e00\u4e2ainterceptor\u53ea\u5c5e\u4e8e\u5176\u4e2d\u4e00\u79cd\u3002\u5927\u90e8\u5206\u7ec4\u4ef6\u4e3asource interceptor\u7c7b\u578b\uff0c\u53ef\u652f\u6301\u914d\u7f6ebelongTo\u88ab\u90e8\u5206source\u4f7f\u7528\u3002\u5c11\u6570\u901a\u7528\u6027\u8d28\u7684\u6bd4\u5982retry interceptor\u4e3asink interceptor\u7c7b\u578b\u3002

    "},{"location":"reference/pipelines/interceptor/overview/#interceptor","title":"Interceptor\u901a\u7528\u914d\u7f6e","text":""},{"location":"reference/pipelines/interceptor/overview/#enabled","title":"enabled","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b true \u8868\u793a\u662f\u5426\u5f00\u542f\u8be5interceptor"},{"location":"reference/pipelines/interceptor/overview/#name","title":"name","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 name string \u975e\u5fc5\u586b \u8868\u793ainterceptor\u7684\u540d\u79f0\u3002\u5f53pipeline\u91cc\u914d\u7f6e\u76f8\u540ctype interceptor\u7684\u60c5\u51b5\u4e0b\uff0c\u5fc5\u586b\uff0c\u7528\u4e8e\u533a\u5206\u6807\u8bc6"},{"location":"reference/pipelines/interceptor/overview/#belongto","title":"belongTo","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 belongTo string\u6570\u7ec4 \u975e\u5fc5\u586b \u4ec5source interceptor\u53ef\u7528\uff0c\u7528\u4e8e\u6307\u5b9a\u8be5interceptor\u4ec5\u88ab\u54ea\u4e9bsource\u4f7f\u7528"},{"location":"reference/pipelines/interceptor/overview/#order","title":"order","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 order int \u975e\u5fc5\u586b interceptor\u7684\u6392\u5217\u987a\u5e8f\u6743\u91cd"},{"location":"reference/pipelines/interceptor/retry/","title":"retry","text":"

    \u7528\u4e8e\u7ed9\u4e0b\u6e38\u53d1\u9001\u5931\u8d25\u65f6\u91cd\u8bd5\u3002 \u7cfb\u7edf\u5185\u7f6e\uff0c\u9ed8\u8ba4\u52a0\u8f7d\uff0c\u5c5e\u4e8esink interceptor\u3002

    Example

    interceptors:\n- type: retry\n
    "},{"location":"reference/pipelines/interceptor/retry/#retrymaxcount","title":"retryMaxCount","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 retryMaxCount int \u975e\u5fc5\u586b 0 \u6700\u5927\u7684\u91cd\u8bd5\u6b21\u6570"},{"location":"reference/pipelines/interceptor/schema/","title":"schema","text":"

    \u4e13\u6ce8\u4e8e\u65e5\u5fd7\u683c\u5f0f\u8f6c\u6362\u4e0e\u9002\u914d\u7684interceptor\u3002 \u5c5e\u4e8esource interceptor\u3002

    "},{"location":"reference/pipelines/interceptor/schema/#_1","title":"\u4f7f\u7528\u573a\u666f","text":"

    \u5bf9\u4e8e\u5927\u90e8\u5206\u65e5\u5fd7\u5bf9\u63a5\u7684\u573a\u666f\u4e2d\uff0c\u6211\u4eec\u8981\u6c42\u7684\u65e5\u5fd7\u683c\u5f0f\u53ef\u80fd\u6709\u4e00\u4e9b\u5dee\u5f02\uff0c\u8fd9\u4e9b\u5dee\u5f02\u4e3b\u8981\u4f53\u73b0\u5728\u65f6\u95f4\u5b57\u6bb5\u3001body\u5b57\u6bb5\u7b49\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cLoggie\u53ea\u4f1a\u628asource\u91c7\u96c6\u6216\u8005\u63a5\u6536\u5230\u7684\u539f\u59cb\u6570\u636e\u653e\u5230body\u5b57\u6bb5\u4e2d\uff0c\u4ee5\u6700\u7b80\u5355\u7684\u65b9\u5f0f\u53d1\u9001\uff1a

    {\n\"body\": \"this is raw data\"\n}\n

    \u4f46\u662f\uff0c\u4e00\u4e9b\u573a\u666f\u4e0b\u6211\u4eec\u9700\u8981\uff1a

    Example

    \u589e\u52a0@timestamp\uff0cbody\u4fee\u6539\u4e3amessage\u589e\u52a0_timestamp_\uff0c\u4fee\u6539\u65f6\u533a\u548c\u683c\u5f0f\uff0cbody\u4fee\u6539\u4e3a_log_
    interceptors:\n- type: schema\naddMeta:\ntimestamp:\nkey: \"@timestamp\"\nremap:\nbody:\nkey: message\n

    \u8f6c\u6362\u540e\u7684event:

    {\n\"message\": \"this is raw data\"\n\"@timestamp\": \"2022-08-30T06:58:49.545Z\",\n}\n

    interceptors:\n- type: schema\naddMeta:\ntimestamp:\nkey: \"_timestamp_\"\nlocation: Local\nlayout: 2006-01-02T15:04:05Z07:00\nremap:\nbody:\nkey: _log_\n
    "},{"location":"reference/pipelines/interceptor/schema/#_2","title":"\u914d\u7f6e","text":""},{"location":"reference/pipelines/interceptor/schema/#addmeta","title":"addMeta","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addMeta \u975e\u5fc5\u586b \u589e\u52a0\u7cfb\u7edf\u5143\u4fe1\u606f\u5b57\u6bb5"},{"location":"reference/pipelines/interceptor/schema/#timestamp","title":"timestamp","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addMeta.timestamp \u975e\u5fc5\u586b \u589e\u52a0\u7cfb\u7edf\u65f6\u95f4\u5b57\u6bb5\uff08source\u91c7\u96c6\u5230\u6570\u636e\u7684\u65f6\u95f4\uff09 addMeta.timestamp.key string \u5fc5\u586b \u7cfb\u7edf\u65f6\u95f4\u7684key addMeta.timestamp.location string \u975e\u5fc5\u586b \u9ed8\u8ba4\u4e3a\u7a7a\uff0c\u5373\u4e3aUTC\u65f6\u95f4 \u589e\u52a0\u7684\u65f6\u95f4\u65f6\u533a\uff0c\u53e6\u5916\u8fd8\u652f\u6301Local addMeta.timestamp.layout string \u975e\u5fc5\u586b \"2006-01-02T15:04:05.000Z\" golang\u7684\u65f6\u95f4\u7c7b\u578blayout\uff0c\u53ef\u53c2\u8003https://go.dev/src/time/format.go"},{"location":"reference/pipelines/interceptor/schema/#pipelinename","title":"pipelineName","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addMeta.pipelineName \u975e\u5fc5\u586b \u5c06pipelineName\u52a0\u5165\u5230event\u4e2d addMeta.pipelineName.key string \u5fc5\u586b \u589e\u52a0\u540e\u7684\u5b57\u6bb5\u7684key

    Example

    interceptors:\n- type: schema\naddMeta:\npipelineName:\nkey: pipeline\n
    \u8f6c\u6362\u540e\u7684event:
    {\n\"pipeline\": \"demo\"\n...\n}\n

    "},{"location":"reference/pipelines/interceptor/schema/#sourcename","title":"sourceName","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addMeta.sourceName \u975e\u5fc5\u586b \u5c06sourceName\u52a0\u5165\u5230event\u4e2d addMeta.sourceName.key string \u5fc5\u586b \u589e\u52a0\u540e\u7684\u5b57\u6bb5\u7684key

    Example

    interceptors:\n- type: schema\naddMeta:\nsourceName:\nkey: source\n
    \u8f6c\u6362\u540e\u7684event:
    {\n\"source\": \"local\"\n...\n}\n

    "},{"location":"reference/pipelines/interceptor/schema/#remap","title":"remap","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 remap map \u975e\u5fc5\u586b \u5bf9\u5b57\u6bb5\u8fdb\u884c\u8f6c\u6362\uff0c\u76ee\u524d\u652f\u6301\u91cd\u547d\u540d remap.[originKey] string \u975e\u5fc5\u586b \u539f\u59cb\u5b57\u6bb5key remap.[originKey].key string \u975e\u5fc5\u586b \u8f6c\u6362\u540e\u7684\u5b57\u6bb5key

    Example

    interceptors:\n- type: schema\nremap:\nbody:\nkey: msg\nstate:\nkey: meta\n
    \u8f6c\u6362\u524d\u7684event:
    {\n\"body\": \"this is log\"\n\"state\": \"ok\",\n}\n

    \u8f6c\u6362\u540e\u7684event:

    {\n\"msg\": \"this is log\"\n\"meta\": \"ok\",\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/","title":"transformer","text":"

    \u5e26\u6709\u6761\u4ef6\u5224\u65ad\u7684\u51fd\u6570\u5f0f\u6570\u636e\u5904\u7406interceptor\u3002 \u5c5e\u4e8esource interceptor\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#_1","title":"\u4f7f\u7528\u573a\u666f","text":"

    \u793a\u4f8b\u53c2\u8003\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#_2","title":"\u4f7f\u7528\u65b9\u5f0f","text":"

    transformer\u4f1a\u6309\u7167\u914d\u7f6e\u7684actions\u91cc\u987a\u5e8f\u6267\u884c\u6240\u6709\u7684action\u3002action\u7c7b\u4f3c\u51fd\u6570\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5199\u5165\u53c2\u6570\uff0c\u53c2\u6570\u4e00\u822c\u4e3aevent\u91cc\u7684\u5b57\u6bb5\u3002 \u540c\u65f6\uff0c\u6bcf\u4e2aaction\u91cc\u8fd8\u53ef\u80fd\u5305\u62ec\u989d\u5916\u7684\u63a7\u5236\u5b57\u6bb5\u3002\u6bd4\u5982\u4e0b\u9762regex(body)\uff0cbody\u5373\u4e3aregex\u7684\u53c2\u6570\uff0cpattern\u4e3a\u989d\u5916\u7684\u5b57\u6bb5\u3002

    interceptors:\n- type: transformer\nactions:\n- action: regex(body)\npattern: ^(?P<time>[^ ^Z]+Z) (?P<level>[^ ]*) (?P<log>.*)$\n- action: add(topic, common)\n

    \u53e6\u5916\uff0caction\u8fd8\u652f\u6301\u6761\u4ef6\u5224\u65adif-then-else\u7684\u65b9\u5f0f\uff1a

    - if: <condition>\nthen:\n- action: funcA()\nelse:\n- action: funcB()\n

    \u5176\u4e2d\uff0ccondition\u6761\u4ef6\u5224\u65ad\u4e5f\u4e3a\u51fd\u6570\u7684\u5f62\u5f0f\u3002

    interceptors:\n- type: transformer\nactions:\n- if: equal(status, 404)\nthen:\n- action: add(topic, not_found)\n- action: return()\n
    "},{"location":"reference/pipelines/interceptor/transformer/#action","title":"action","text":""},{"location":"reference/pipelines/interceptor/transformer/#_3","title":"\u516c\u5171\u5b57\u6bb5","text":""},{"location":"reference/pipelines/interceptor/transformer/#ignoreerror","title":"ignoreError","text":"

    Example

    - type: transformer\nactions:\n- action: regex(body)\npattern: (?<ip>\\S+) (?<id>\\S+) (?<u>\\S+) (?<time>\\[.*?\\]) (?<url>\\\".*?\\\") (?<status>\\S+) (?<size>\\S+)\nignoreError: true\n
    \u8fd9\u91cc\u7684ignoreError\u8bbe\u7f6e\u4e3atrue\uff0c\u8868\u793a\u4f1a\u5ffd\u7565\u8be5\u6b63\u5219\u5339\u914d\u7684\u9519\u8bef\uff0c\u5e76\u4e14\u4f1a\u7ee7\u7eed\u6267\u884c\u540e\u7eed\u7684action\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#dropiferror","title":"dropIfError","text":"

    \u8868\u793a\u5982\u679c\u51fa\u73b0\u9519\u8bef\uff0c\u76f4\u63a5\u4e22\u5f03\u8be5\u6761event\u3002

    Example

    - type: transformer\nactions:\n- action: regex(body)\npattern: (?<ip>\\S+) (?<id>\\S+) (?<u>\\S+) (?<time>\\[.*?\\]) (?<url>\\\".*?\\\") (?<status>\\S+) (?<size>\\S+)\ndropIfError: true\n
    \u8fd9\u91cc\u7684dropIfError\u8bbe\u7f6e\u4e3atrue\uff0c\u8868\u793a\u5982\u679c\u51fa\u73b0\u6b63\u5219\u5339\u914d\u7684\u9519\u8bef\uff0c\u4f1a\u76f4\u63a5\u4e22\u5f03\u8fd9\u6761\u65e5\u5fd7\uff08\u540e\u7eedaction\u4e5f\u4e0d\u4f1a\u6267\u884c\uff09\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#addkey-value","title":"add(key, value)","text":"

    \u7ed9event\u6dfb\u52a0\u989d\u5916\u7684key:value\u3002

    Example

    - action: add(topic, loggie)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"topic\": \"loggie\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#copyfrom-to","title":"copy(from, to)","text":"

    \u590d\u5236event\u91cc\u7684\u5b57\u6bb5\u3002

    \u53c2\u6570\uff1a

    Example

    - action: copy(foo, bar)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"foo\": \"loggie\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"foo\": \"loggie\",\n\"bar\": \"loggie\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#movefrom-to","title":"move(from, to)","text":"

    \u79fb\u52a8/\u91cd\u547d\u540d\u5b57\u6bb5\u3002

    \u53c2\u6570\uff1a

    Example

    - action: move(foo, bar)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"foo\": \"loggie\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"bar\": \"loggie\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#setkey-value","title":"set(key, value)","text":"

    \u66f4\u65b0\u5b57\u6bb5key\u7684\u503c\u4e3avalue\u3002

    \u53c2\u6570\uff1a

    Example

    - action: set(foo, test)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"foo\": \"loggie\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"foo\": \"test\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#delkey1-key2","title":"del(key1, key2...)","text":"

    \u5220\u9664\u5b57\u6bb5\u3002\u53ef\u586b\u5199\u591a\u4e2a\u5b57\u6bb5key\u3002

    Example

    - action: del(foo)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"foo\": \"loggie\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#underrootkey","title":"underRoot(key)","text":"

    \u5c06\u5d4c\u5957\u7684\u5b57\u6bb5\u653e\u5728\u6839\u90e8\uff08\u6700\u5916\u5c42\uff09\u3002

    Example

    - action: underRoot(state)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"state\": {\n\"node\": \"127.0.0.1\",\n\"phase\": \"running\"\n}\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"node\": \"127.0.0.1\",\n\"phase\": \"running\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#fmtkey","title":"fmt(key)","text":"

    \u5c06\u67d0\u4e2a\u5b57\u6bb5\u7684\u503c\u91cd\u65b0\u6e32\u67d3\uff0c\u53ef\u6839\u636e\u5176\u4ed6\u7684\u5b57\u6bb5\u503c\u7ec4\u6210\u4e00\u4e2a\u503c\u3002\u5982\u679ckey\u4e0d\u5b58\u5728\u5219\u4f1a\u65b0\u589e\u8be5\u5b57\u6bb5\u3002

    \u989d\u5916\u5b57\u6bb5\uff1a

    Example

    - action: fmt(status)\npattern: ${state.node} is ${state.phase}\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"state\": {\n\"node\": \"127.0.0.1\",\n\"phase\": \"running\"\n}\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"state\": {\n\"node\": \"127.0.0.1\",\n\"phase\": \"running\"\n}\uff0c\n\"status\": \"127.0.0.1 is running\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#timestampkey","title":"timestamp(key)","text":"

    \u5b57\u6bb5\u7684\u65f6\u95f4\u683c\u5f0f\u8f6c\u6362\u3002

    \u989d\u5916\u5b57\u6bb5\uff1a

    Example

    - action: timestamp(time)\nfromLayout: \"2006-01-02 15:04:05\"\nfromLocation: Asia/Shanghai\ntoLayout: unix_ms\ntoLocation: Local\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"time\": \"2022-06-28 11:24:35\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"time\": 1656386675000\n}\n

    \u4ee5\u4e0a\u7684layout\u53c2\u6570\u9700\u8981\u586b\u5199golang\u5f62\u5f0f\uff0c\u53ef\u53c2\u8003\uff1a

    const (\n    Layout      = \"01/02 03:04:05PM '06 -0700\" // The reference time, in numerical order.\n    ANSIC       = \"Mon Jan _2 15:04:05 2006\"\n    UnixDate    = \"Mon Jan _2 15:04:05 MST 2006\"\n    RubyDate    = \"Mon Jan 02 15:04:05 -0700 2006\"\n    RFC822      = \"02 Jan 06 15:04 MST\"\n    RFC822Z     = \"02 Jan 06 15:04 -0700\" // RFC822 with numeric zone\n    RFC850      = \"Monday, 02-Jan-06 15:04:05 MST\"\n    RFC1123     = \"Mon, 02 Jan 2006 15:04:05 MST\"\n    RFC1123Z    = \"Mon, 02 Jan 2006 15:04:05 -0700\" // RFC1123 with numeric zone\n    RFC3339     = \"2006-01-02T15:04:05Z07:00\"\n    RFC3339Nano = \"2006-01-02T15:04:05.999999999Z07:00\"\n    Kitchen     = \"3:04PM\"\n    // Handy time stamps.\n    Stamp      = \"Jan _2 15:04:05\"\n    StampMilli = \"Jan _2 15:04:05.000\"\n    StampMicro = \"Jan _2 15:04:05.000000\"\n    StampNano  = \"Jan _2 15:04:05.000000000\"\n)\n
    \u8fd8\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#regexkey","title":"regex(key)","text":"

    \u4f7f\u7528\u6b63\u5219\u7684\u65b9\u5f0f\u5207\u5206\u65e5\u5fd7\uff0c\u63d0\u53d6\u5b57\u6bb5\u3002 \u53e6\u5916\u4e5f\u53ef\u4ee5\u4e3aregex(key, to)\u3002

    \u53c2\u6570\uff1a

    \u989d\u5916\u5b57\u6bb5\uff1a

    Example

    - action: regex(body)\npattern: (?<ip>\\S+) (?<id>\\S+) (?<u>\\S+) (?<time>\\[.*?\\]) (?<url>\\\".*?\\\") (?<status>\\S+) (?<size>\\S+)\n

    input:

    {\n\"body\": \"10.244.0.1 - - [13/Dec/2021:12:40:48 +0000] 'GET / HTTP/1.1' 404 683\",\n}\n

    output:

    {\n\"ip\":     \"10.244.0.1\",\n\"id\":     \"-\",\n\"u\":      \"-\",\n\"time\":   \"[13/Dec/2021:12:40:48 +0000]\",\n\"url\":    \"GET / HTTP/1.1\",\n\"status\": \"404\",\n\"size\":   \"683\",\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#grokkey","title":"grok(key)","text":"

    \u4f7f\u7528grok\u7684\u65b9\u5f0f\u5207\u5206\u65e5\u5fd7\uff0c\u63d0\u53d6\u5b57\u6bb5\u3002 \u53e6\u5916\u4e5f\u53ef\u4ee5\u4e3agrok(key, to)\u3002

    \u53c2\u6570\uff1a

    \u989d\u5916\u5b57\u6bb5\uff1a

    Example

    - action: grok(body)\nmatch: \"^%{DATESTAMP:datetime} %{FILE:file}:%{INT:line}: %{IPV4:ip} %{PATH:path} %{UUID:uuid}(?P<space>[a-zA-Z]?)\"\npattern: FILE: \"[a-zA-Z0-9._-]+\"\n

    input:

    {\n\"body\": \"2022/05/28 01:32:01 logTest.go:66: 192.168.0.1 /var/log/test.log 54ce5d87-b94c-c40a-74a7-9cd375289334\",\n}\n

    output:

            \"datetime\": \"2022/05/28 01:32:01\",\n            \"line\":     \"66\",\n            \"ip\":       \"192.168.0.1\",\n            \"path\":     \"/var/log/test.log\",\n            \"uuid\":     \"54ce5d87-b94c-c40a-74a7-9cd375289334\",\n

    "},{"location":"reference/pipelines/interceptor/transformer/#jsondecodekey","title":"jsonDecode(key)","text":"

    \u5c06json\u6587\u672c\u53cd\u5e8f\u5217\u5316\u3002 \u4e5f\u53ef\u4ee5\u4e3ajsonDecode(key, to)\u3002

    \u53c2\u6570\uff1a

    Example

    - action: jsonDecode(body)\n

    input:

    {\n\"body\": `{\"log\":\"I0610 08:29:07.698664 Waiting for caches to sync\", \"stream\":\"stderr\", \"time\":\"2021-06-10T08:29:07.698731204Z\"}`,\n}\n

    output:

    {\n\"log\": \"I0610 08:29:07.698664 Waiting for caches to sync\",\n\"stream\": \"stderr\", \"time\": \"2021-06-10T08:29:07.698731204Z\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#jsonencodekey","title":"jsonEncode(key)","text":"

    \u5c06\u591a\u4e2a\u5b57\u6bb5\u5e8f\u5217\u5316\u6210json string\u5f62\u5f0f\u3002 \u4e5f\u53ef\u4ee5\u4e3ajsonEncode(key, to)\u3002

    \u53c2\u6570\uff1a

    Example

    interceptors:\n- type: transformer\nactions:\n- action: jsonEncode(fields)\n

    input:

    {\n\"body\": \"this is test\",\n\"fields\":\n\"topic\": \"loggie\",\n\"foo\": \"bar\"\n}\n

    output:

     {\n\"fields\": \"{\\\"topic\\\":\\\"loggie\\\",\\\"foo\\\":\\\"bar\\\"}\",\n\"body\": \"this is test\"\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#splitkey","title":"split(key)","text":"

    \u5c06\u4e00\u884c\u65e5\u5fd7\u6839\u636e\u67d0\u79cd\u5206\u5272\u7b26\u5207\u5206\u3002

    \u53c2\u6570\uff1a

    \u989d\u5916\u5b57\u6bb5\uff1a

    Example

      interceptors:\n- type: transformer\nactions:\n- action: split(body)\nseparator: \"|\"\nkeys: [\"time\", \"order\", \"service\", \"price\"]\n

    input:

      \"body\": `2021-08-08|U12345|storeCenter|13.14`,\n

    output:

      \"time\": \"2021-08-08\"\n  \"order\": \"U12345\"\n  \"service\": \"storeCenter\"\n  \"price: \"13.14\"\n

    "},{"location":"reference/pipelines/interceptor/transformer/#strconvkey-type","title":"strconv(key, type)","text":"

    \u5b57\u6bb5\u503c\u7c7b\u578b\u8f6c\u6362\u3002

    \u53c2\u6570\uff1a

    Example

    - action: strconv(code, int)\n

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"code\": \"200\"\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"code\": 200\n}\n

    "},{"location":"reference/pipelines/interceptor/transformer/#tostrkey-type","title":"toStr(key, type)","text":"

    \u5c06\u5b57\u6bb5\u503c\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u3002

    \u53c2\u6570\uff1a

    Example

    - action: toStr(code, int)     

    input:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"code\": 200\n}\n

    output:

    {\n\"body\": \"2021-02-16T09:21:20.545525544Z DEBUG this is log body\",\n\"code\": \"200\"\n}   

    "},{"location":"reference/pipelines/interceptor/transformer/#print","title":"print()","text":"

    \u6253\u5370event\u3002\u4e00\u822c\u7528\u4e8e\u8c03\u8bd5\u9636\u6bb5\u4f7f\u7528\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#return","title":"return()","text":"

    \u63a7\u5236\u7c7b\u578b\u51fd\u6570\uff0c\u6267\u884c\u5230return()\u540e\u8fd4\u56de\uff0c\u4e0d\u518d\u7ee7\u7eed\u6267\u884c\u4e0b\u9762\u7684action\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#dropevent","title":"dropEvent()","text":"

    \u63a7\u5236\u7c7b\u578b\u51fd\u6570\uff0c\u6267\u884c\u5230dropEvent()\u540e\u4f1a\u5c06\u8be5event\u76f4\u63a5\u4e22\u5f03\u3002\u8fd9\u610f\u5473\u7740\u8be5\u6761\u6570\u636e\u4f1a\u4e22\u5931\uff0c\u4e5f\u4e0d\u4f1a\u7ee7\u7eed\u88ab\u540e\u7eed\u7684interceptor\u6216\u8005sink\u5904\u7406\u6d88\u8d39\u3002

    Example

    interceptors:\n- type: transformer\nactions:\n- action: regex(body)\npattern: ^(?P<time>[^ ^Z]+Z) (?P<level>[^ ]*) (?P<log>.*)$\n- if: equal(level, DEBUG)\nthen:\n- action: dropEvent()\n
    \u5047\u8bbe\u65e5\u5fd7\u4e3a\uff1a2021-02-16T09:21:20.545525544Z DEBUG this is log body\uff0c\u5219\u6ee1\u8db3level\u5b57\u6bb5\u4e3aDEBUG\uff0c\u4f1a\u76f4\u63a5\u4e22\u5f03\u8be5\u6761\u65e5\u5fd7\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#condition","title":"condition","text":"

    \u6761\u4ef6\u5224\u65ad\u7c7b\u51fd\u6570\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#_4","title":"\u64cd\u4f5c\u7b26","text":"

    Example

    interceptors:\n- type: transformer\nactions:\n- if: equal(level, DEBUG) AND equal(code, 200)\nthen:\n- action: dropEvent()\n

    Example

    interceptors:\n- type: transformer\nactions:\n- if: equal(level, DEBUG) OR equal(level, INFO)\nthen:\n- action: dropEvent()\n

    Example

    interceptors:\n- type: transformer\nactions:\n- if: NOT equal(level, DEBUG)\nthen:\n- action: dropEvent()\n
    "},{"location":"reference/pipelines/interceptor/transformer/#equalkey-target","title":"equal(key, target)","text":"

    \u76ee\u6807\u5b57\u6bb5\u503c\u662f\u5426\u548c\u53c2\u6570\u503ctarget\u76f8\u7b49\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#containkey-target","title":"contain(key, target)","text":"

    \u5b57\u6bb5\u503c\u662f\u5426\u5305\u542b\u53c2\u6570\u503ctarget\u3002

    Caution

    target\u8bf7\u76f4\u63a5\u4f7f\u7528\u5b57\u7b26\u4e32\uff0c\u65e0\u9700\u6dfb\u52a0\u53cc\u5f15\u53f7\u3002 \u6bd4\u5982contain(body, error)\uff0c\u800c\u4e0d\u662fcontain(body, \"error\")\u3002contain(body, \"error\")\u4f1a\u88ab\u5f53\u4f5c\"error\"\u6765\u5339\u914d\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#existkey","title":"exist(key)","text":"

    \u76ee\u6807\u5b57\u6bb5\u662f\u5426\u5b58\u5728\u6216\u8005\u662f\u5426\u4e3a\u7a7a\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#greaterkey-value","title":"greater(key, value)","text":"

    \u76ee\u6807\u5b57\u6bb5\u7684\u503c\u662f\u5426\u5927\u4e8e\u53c2\u6570\u503cvalue\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#lesskey-value","title":"less(key, value)","text":"

    \u76ee\u6807\u5b57\u6bb5\u7684\u503c\u662f\u5426\u5c0f\u4e8e\u53c2\u6570\u503cvalue\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#hasprefixkey-prefix","title":"hasPrefix(key, prefix)","text":"

    \u76ee\u6807\u5b57\u6bb5\u7684\u503c\u662f\u5426\u5305\u542bprefix\u524d\u7f00\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#matchkey-regex","title":"match(key, regex)","text":"

    \u76ee\u6807\u5b57\u6bb5\u7684\u503c\u662f\u5426\u548c\u53c2\u6570regex\u6b63\u5219\u5339\u914d\u3002

    "},{"location":"reference/pipelines/interceptor/transformer/#oneofkey-value1-value2","title":"oneOf(key, value1, value2...)","text":"

    \u76ee\u6807\u5b57\u6bb5\u7684\u503c\u662f\u5426\u662f\u53c2\u6570\u503cvalue1...\u5176\u4e2d\u4e4b\u4e00\u3002

    "},{"location":"reference/pipelines/queue/channel/","title":"channel","text":"

    channel queue,\u662f\u57fa\u4e8ego chan\u5b9e\u73b0\u7684\u5185\u5b58\u7f13\u51b2queue\u3002

    Example

    queue:\ntype: channel\n
    "},{"location":"reference/pipelines/queue/channel/#batchsize","title":"batchSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchSize int \u4e0d\u5fc5\u586b 2048 \u4e00\u4e2a\u6279\u6b21\u5305\u542b\u7684event\u6570\u91cf"},{"location":"reference/pipelines/queue/channel/#batchbytes","title":"batchBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchBytes int64 \u4e0d\u5fc5\u586b 33554432(32MB) \u4e00\u4e2a\u6279\u6b21\u5305\u542b\u7684\u6570\u636e\u6700\u5927\u5b57\u8282\u6570"},{"location":"reference/pipelines/queue/channel/#batchaggtimeout","title":"batchAggTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchAggTimeout time.Duration \u4e0d\u5fc5\u586b 1s \u7ec4\u88c5\u805a\u5408\u591a\u4e2aevent\u6210\u4e00\u4e2abatch\u7b49\u5f85\u7684\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/queue/memory/","title":"memory","text":"

    memory queue,\u662f\u57fa\u4e8ego-disruptor\u5b9e\u73b0\u7684\u5185\u5b58\u7f13\u51b2queue\u3002

    Note

    \u7531\u4e8ego-disruptor\u7248\u672c\u8fd8\u672arelease\uff0cmemory queue\u8fd8\u5c5e\u4e8e\u5b9e\u9a8c\u9636\u6bb5\u3002\u751f\u4ea7\u73af\u5883\u4e0d\u5efa\u8bae\u4f7f\u7528\uff01

    Example

    queue:\ntype: memory\n
    "},{"location":"reference/pipelines/queue/memory/#batchsize","title":"batchSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchSize int \u4e0d\u5fc5\u586b 2048 \u4e00\u4e2a\u6279\u6b21\u5305\u542b\u7684event\u6570\u91cf"},{"location":"reference/pipelines/queue/memory/#batchbufferfactor","title":"batchBufferFactor","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchBufferFactor int \u4e0d\u5fc5\u586b 2 queue\u7f13\u51b2\u533a\u7684\u5927\u5c0f(channel\u7684\u5bb9\u91cf)=batchSize*batchBufferFactor"},{"location":"reference/pipelines/queue/memory/#batchbytes","title":"batchBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchBytes int64 \u4e0d\u5fc5\u586b 33554432(32MB) \u4e00\u4e2a\u6279\u6b21\u5305\u542b\u7684\u6570\u636e\u6700\u5927\u5b57\u8282\u6570"},{"location":"reference/pipelines/queue/memory/#batchaggtimeout","title":"batchAggTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchAggTimeout time.Duration \u4e0d\u5fc5\u586b 1s \u7ec4\u88c5\u805a\u5408\u591a\u4e2aevent\u6210\u4e00\u4e2abatch\u7b49\u5f85\u7684\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/dev/","title":"dev","text":"

    dev sink\u5c06\u65e5\u5fd7\u6570\u636e\u6253\u5370\u5230\u63a7\u5236\u53f0\uff0c\u4e00\u822c\u53ef\u4ee5\u7528\u4e8edebug\u6216\u8005\u6392\u67e5\u95ee\u9898\u3002 \u914d\u7f6edev sink\u540e\uff0c\u53ef\u4ee5\u8bbe\u7f6eprintEvents=true\uff0c\u67e5\u770b\u5728Loggie\u4e2d\u53d1\u9001\u81f3sink\u7684\u65e5\u5fd7\u6570\u636e\uff0c\u8be5\u6570\u636e\u9664\u4e86source\u63a5\u6536\u6216\u8005\u91c7\u96c6\u7684\u539f\u59cb\u65e5\u5fd7\uff0c\u4e00\u822c\u8fd8\u5305\u542b\u5176\u4ed6\u5143\u4fe1\u606f\u3002

    Example

    sink:\ntype: dev\nprintEvents: true\ncodec:\ntype: json\npretty: true\n
    "},{"location":"reference/pipelines/sink/dev/#printevents","title":"printEvents","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 printEvents bool \u975e\u5fc5\u586b false \u662f\u5426\u6253\u5370\u91c7\u96c6\u7684\u65e5\u5fd7

    \u9ed8\u8ba4\u60c5\u51b5\u4e0bLoggie\u7684\u65e5\u5fd7\u6253\u5370\u4e3ajson\u683c\u5f0f\uff0c\u53ef\u4ee5\u914d\u7f6e\u542f\u52a8\u53c2\u6570-log.jsonFormat=false\uff0c\u4fbf\u4e8e\u5728Loggie\u65e5\u5fd7\u4e0a\u67e5\u770b\u8f93\u51fa\u7ed3\u679c\u3002

    "},{"location":"reference/pipelines/sink/dev/#printeventsinterval","title":"printEventsInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 printEventsInterval time.Duration \u975e\u5fc5\u586b \u95f4\u9694\u6253\u5370\u91c7\u96c6\u7684\u65e5\u5fd7\uff0c\u5982\u679c\u9700\u8981\u8f93\u51fa\u7684\u65e5\u5fd7\u91cf\u5f88\u5927\uff0c\u53ef\u586b\u5165\u4e00\u4e2a\u65f6\u95f4\u95f4\u9694\uff0c\u6bd4\u598210s\uff0cLoggie\u53ea\u4f1a\u5728\u6bcf10s\u6253\u5370\u4e00\u6b21\u65e5\u5fd7\uff0c\u907f\u514d\u592a\u591a\u65e5\u5fd7\u5237\u5c4f\u4e0d\u4fbf\u67e5\u770b"},{"location":"reference/pipelines/sink/dev/#printmetrics","title":"printMetrics","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 printMetrics bool \u975e\u5fc5\u586b \u662f\u5426\u6253\u5370\u53d1\u9001\u65e5\u5fd7\u7edf\u8ba1\u7684\u4e00\u4e9b\u6307\u6807\uff0c\u5305\u62ectotalCount\u548cqps"},{"location":"reference/pipelines/sink/dev/#printmetricsinterval","title":"printMetricsInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 printMetricsInterval time.Duration \u975e\u5fc5\u586b 1s printMetrics\u5f00\u542f\u540e\uff0c\u6253\u5370\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/sink/dev/#resultstatus","title":"resultStatus","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 resultStatus string \u975e\u5fc5\u586b success \u6a21\u62dfsink\u53d1\u9001\u7aef\u5bf9\u65e5\u5fd7\u7684\u5904\u7406\uff0c\u5305\u62ecsuccess\uff0cfail\uff0cdrop

    \u9664\u4e86\u5728\u914d\u7f6e\u4e2d\u586b\u5199\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u63a5\u53e3\u52a8\u6001\u7684\u8fdb\u884c\u6a21\u62df\uff0c\u6bd4\u5982\u5728Loggie\u8fd0\u884c\u65f6\u5c06sink success\u72b6\u6001\u7f6e\u4e3afail\u72b6\u6001\u3002

    # \u8bf7\u5c06\u4e0b\u9762\u7684<pipelineName>\u66ff\u6362\u4e3a\u5b9e\u9645\u914d\u7f6e\u7684pipelineName\ncurl <ip>:<port>/api/v1/pipeline/<pipelineName>/sink/dev?status=fail\n
    "},{"location":"reference/pipelines/sink/elasticsearch/","title":"elasticsearch","text":"

    \u4f7f\u7528Elasticsearch sink\u53d1\u9001\u6570\u636e\u81f3Elasticsearch\u96c6\u7fa4\u3002

    Example

    sink:\ntype: elasticsearch\nhosts: [\"elasticsearch1:9200\", \"elasticsearch2:9200\", \"elasticsearch3:9200\"]\nindex: \"log-${fields.service}-${+YYYY.MM.DD}\"\n

    Caution

    \u5982\u679celasticsearch\u7248\u672c\u4e3av6.x\uff0c\u8bf7\u52a0\u4e0a\u4ee5\u4e0betype: _doc\u53c2\u6570\u3002

    sink:\ntype: elasticsearch\netype: _doc\n...\n
    "},{"location":"reference/pipelines/sink/elasticsearch/#hosts","title":"hosts","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 hosts string\u6570\u7ec4 \u5fc5\u586b \u65e0 \u53d1\u9001\u65e5\u5fd7\u81f3Elasticsearch\u7684\u5730\u5740"},{"location":"reference/pipelines/sink/elasticsearch/#index","title":"index","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 index string \u5fc5\u586b \u65e0 \u53d1\u9001\u81f3Elasticsearch\u540e\uff0c\u65e5\u5fd7\u6570\u636e\u5b58\u50a8\u7684index

    \u53ef\u4ee5\u4f7f\u7528${a.b}\u7684\u65b9\u5f0f\u83b7\u53d6\u65e5\u5fd7\u6570\u636e\u91cc\u7684\u5b57\u6bb5\uff0c\u6216\u8005\u52a0\u4e0a${+YYYY.MM.DD.hh}\u65f6\u95f4\u6233\u7b49\u65b9\u5f0f\u6765\u52a8\u6001\u751f\u6210index\u3002

    "},{"location":"reference/pipelines/sink/elasticsearch/#username","title":"username","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 username string \u975e\u5fc5\u586b \u65e0 \u5982\u679cElasticsearch\u914d\u7f6e\u4e86\u7528\u6237\u540d\u5bc6\u7801\u9a8c\u8bc1\uff0c\u9700\u8981\u586b\u5199\u8bf7\u6c42\u7684\u7528\u6237\u540d"},{"location":"reference/pipelines/sink/elasticsearch/#password","title":"password","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 password string \u975e\u5fc5\u586b \u65e0 \u5982\u679cElasticsearch\u914d\u7f6e\u4e86\u7528\u6237\u540d\u5bc6\u7801\u9a8c\u8bc1\uff0c\u9700\u8981\u586b\u5199\u8bf7\u6c42\u7684\u5bc6\u7801"},{"location":"reference/pipelines/sink/elasticsearch/#headers","title":"headers","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 headers map \u975e\u5fc5\u586b \u65e0 \u8bf7\u6c42Elasticsearch\u643a\u5e26\u7684header"},{"location":"reference/pipelines/sink/elasticsearch/#parameters","title":"parameters","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 parameters map \u975e\u5fc5\u586b \u65e0 \u8bf7\u6c42Elasticsearch\u7684url\u53c2\u6570"},{"location":"reference/pipelines/sink/elasticsearch/#apikey","title":"apiKey","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 apiKey string \u975e\u5fc5\u586b \u7528\u4e8e\u6388\u6743\u7684base64\u7f16\u7801\u4ee4\u724c;\u5982\u679c\u8bbe\u7f6e\uff0c\u5219\u8986\u76d6\u7528\u6237\u540d/\u5bc6\u7801\u548c\u670d\u52a1\u4ee4\u724c"},{"location":"reference/pipelines/sink/elasticsearch/#servicetoken","title":"serviceToken","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 serviceToken string \u975e\u5fc5\u586b \u670d\u52a1\u4ee4\u724c\u7528\u4e8e\u6388\u6743;\u5982\u679c\u8bbe\u7f6e\uff0c\u5219\u8986\u76d6\u7528\u6237\u540d/\u5bc6\u7801"},{"location":"reference/pipelines/sink/elasticsearch/#cacertpath","title":"caCertPath","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 caCertPath string \u975e\u5fc5\u586b pem\u7f16\u7801\u7684ca\u8bc1\u4e66\u5b58\u653e\u7684\u8def\u5f84"},{"location":"reference/pipelines/sink/elasticsearch/#compress","title":"compress","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compress bool \u975e\u5fc5\u586b false \u662f\u5426\u538b\u7f29\u8bf7\u6c42\u4f53"},{"location":"reference/pipelines/sink/elasticsearch/#documentid","title":"documentId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 documentId string \u975e\u5fc5\u586b \u53d1\u9001\u81f3elasticsearch\u7684id\u503c\uff0c\u53ef\u4f7f\u7528${}\u7684\u65b9\u5f0f\u53d6\u67d0\u4e2a\u5b57\u6bb5"},{"location":"reference/pipelines/sink/elasticsearch/#optype","title":"opType","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 opType string \u975e\u5fc5\u586b index \u53c2\u8003\u5b98\u65b9\u6587\u6863, \u5982\u679c\u76ee\u6807\u4e3adatastream\uff0c\u5219\u9700\u8981\u8bbe\u7f6e\u4e3acreate"},{"location":"reference/pipelines/sink/elasticsearch/#sendbufferbytes","title":"sendBufferBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sendBufferBytes int \u975e\u5fc5\u586b 131072 \u53d1\u9001\u5199\u5165\u8bf7\u6c42\u4f53\u7684buffer\u5b57\u8282\u6570\u5927\u5c0f"},{"location":"reference/pipelines/sink/file/","title":"file","text":"

    \u5c06\u63a5\u6536\u5230\u7684\u6570\u636e\u4ee5\u6587\u4ef6\u7684\u5f62\u5f0f\u5199\u5165\u5230\u672c\u5730\u3002

    Example

    sink:\ntype: file\nworkerCount: 1024\nbaseDirs:\n- /data0\n- /data1\n- /data2\ndirHashKey: ${namespace}-${deployName}\nfilename: /${namespace}/${deployName}/${podName}/${filename}\nmaxSize: 500\nmaxAge: 7\nmaxBackups: 50\ncompress: true\n
    "},{"location":"reference/pipelines/sink/file/#workercount","title":"workerCount","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 workerCount int \u975e\u5fc5\u586b 1 \u5199\u6587\u4ef6\u7684\u5e76\u53d1\u6570"},{"location":"reference/pipelines/sink/file/#basedirs","title":"baseDirs","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 baseDirs string\u6570\u7ec4 \u975e\u5fc5\u586b \u6587\u4ef6\u7684\u57fa\u7840\u76ee\u5f55\uff0c\u53ef\u4ee5\u6309\u67d0\u4e2akey\u505a\u54c8\u5e0c\uff0c\u7136\u540e\u5b58\u50a8\u5230\u5bf9\u5e94\u7684\u57fa\u7840\u76ee\u5f55\u4e0a"},{"location":"reference/pipelines/sink/file/#dirhashkey","title":"dirHashKey","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 dirHashKey string \u975e\u5fc5\u586b \u6309\u6307\u5b9aKey\u505a\u54c8\u5e0c\uff0c\u652f\u6301\u53d8\u91cf"},{"location":"reference/pipelines/sink/file/#filename","title":"filename","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 filename string \u5fc5\u586b \u6587\u4ef6\u540d\uff0c\u652f\u6301\u53d8\u91cf"},{"location":"reference/pipelines/sink/file/#maxsize","title":"maxSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxSize int \u975e\u5fc5\u586b 1 \u6587\u4ef6\u5927\u5c0f\uff0c\u5355\u4f4d\u4e3aMiB"},{"location":"reference/pipelines/sink/file/#maxage","title":"maxAge","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxAge int \u975e\u5fc5\u586b \u65e7\u6587\u4ef6\u4fdd\u7559\u5929\u6570\uff0c\u5355\u4f4d\u300c\u5929\u300d\uff0c\u9ed8\u8ba4\u4e0d\u5220\u9664"},{"location":"reference/pipelines/sink/file/#maxbackups","title":"maxBackups","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxBackups int \u975e\u5fc5\u586b 1 \u6700\u5927\u4fdd\u7559\u7684\u5907\u4efd\u6587\u4ef6\u6570\uff0c\u9ed8\u8ba4\u4e0d\u5220\u9664\uff08\u5982\u679cmaxAge\u914d\u7f6e\u4e86\uff0c\u90a3\u4e48\u6587\u4ef6\u4f9d\u65e7\u4f1a\u88ab\u5220\u9664\uff09"},{"location":"reference/pipelines/sink/file/#localtime","title":"localTime","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 localTime bool \u975e\u5fc5\u586b false \u662f\u5426\u7528\u672c\u5730\u65f6\u95f4\u683c\u5f0f\u5316\u5907\u4efd\u6587\u4ef6\uff0c\u9ed8\u8ba4\u4f7f\u7528UTC\u65f6\u95f4"},{"location":"reference/pipelines/sink/file/#compress","title":"compress","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compress bool \u975e\u5fc5\u586b false \u662f\u5426\u538b\u7f29\uff0c\u4f7f\u7528gzip\uff0c\u9ed8\u8ba4\u4e0d\u538b\u7f29"},{"location":"reference/pipelines/sink/franzkafka/","title":"franz kafka","text":"

    \u4f7f\u7528franz-go kafka\u5e93\u5c06\u65e5\u5fd7\u6570\u636e\u53d1\u9001\u81f3\u4e0b\u6e38Kafka\uff0c\u5e76\u4e14\u80fd\u6bd4\u8f83\u597d\u7684\u652f\u6301kerberos\u8ba4\u8bc1\u3002 \uff08\u672csink\u548ckafka sink\u7684\u533a\u522b\u4e00\u822c\u53ea\u5728\u4e8e\u4f7f\u7528\u7684kafka golang\u5e93\u4e0d\u540c\uff0c\u63d0\u4f9b\u7ed9\u5bf9franz kafka\u5e93\u6709\u504f\u597d\u7684\u7528\u6237\u4f7f\u7528\uff09

    Example

    \u7b80\u5355SASL\u8ba4\u8bc1
    sink:\ntype: franzKafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\n
    sink:\ntype: franzKafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"demo\"\nsasl:\nenabled: true\nmechanism: SCRAM-SHA-512\nusername: ***\npassword: ***\n
    "},{"location":"reference/pipelines/sink/franzkafka/#brokers","title":"brokers","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 brokers string\u6570\u7ec4 \u5fc5\u586b \u65e0 \u53d1\u9001\u65e5\u5fd7\u81f3Kafka\u7684brokers\u5730\u5740"},{"location":"reference/pipelines/sink/franzkafka/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u975e\u5fc5\u586b loggie \u53d1\u9001\u65e5\u5fd7\u81f3Kafka\u7684topic

    \u53ef\u4f7f\u7528${a.b}\u7684\u65b9\u5f0f\uff0c\u83b7\u53d6event\u91cc\u7684\u5b57\u6bb5\u503c\u4f5c\u4e3a\u5177\u4f53\u7684topic\u540d\u79f0\u3002

    \u6bd4\u5982\uff0c\u4e00\u4e2aevent\u4e3a\uff1a

    {\n\"topic\": \"loggie\",\n\"hello\": \"world\"\n}\n
    \u53ef\u914d\u7f6etopic: ${topic}\uff0c\u6b64\u65f6\u8be5event\u53d1\u9001\u5230Kafka\u7684topic\u4e3a\"loggie\"\u3002

    \u540c\u65f6\u652f\u6301\u5d4c\u5957\u7684\u9009\u62e9\u65b9\u5f0f\uff1a

    {\n\"fields\": {\n\"topic\": \"loggie\"\n},\n\"hello\": \"world\"\n}\n
    \u53ef\u914d\u7f6etopic: ${fields.topic}\uff0c\u540c\u6837\u4e5f\u4f1a\u53d1\u9001\u5230topic \"loggie\"\u3002

    "},{"location":"reference/pipelines/sink/franzkafka/#ifrendertopicfailed","title":"ifRenderTopicFailed","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ifRenderTopicFailed \u975e\u5fc5\u586b \u5982\u679c\u4f7f\u7528\u52a8\u6001\u7684\u89c4\u5219\u6e32\u67d3topic\uff0c\u6bd4\u5982topic: ${fields.topic}\uff0c\u6709\u53ef\u80fd\u6e32\u67d3\u5931\u8d25\uff08\u6bd4\u5982\u65e5\u5fd7\u6ca1\u6709fields.topic\u5b57\u6bb5\uff09\uff0c\u4e0b\u9762\u914d\u7f6e\u6307\u793a\u5931\u8d25\u540e\u7684\u52a8\u4f5c\u3002 ifRenderTopicFailed.dropEvent \u975e\u5fc5\u586b true \u9ed8\u8ba4\u4e3a\u4e22\u5f03 ifRenderTopicFailed.ignoreError \u975e\u5fc5\u586b \u5ffd\u7565\u9519\u8bef\u65e5\u5fd7\uff0c\u8bf7\u6ce8\u610f\uff0c\u8fd9\u91cc\u53ea\u662f\u4e0d\u6253\u5370\u9519\u8bef\u65e5\u5fd7 ifRenderTopicFailed.defaultTopic \u975e\u5fc5\u586b \u53d1\u9001\u81f3\u8be5\u9ed8\u8ba4\u7684topic\uff0c\u914d\u7f6e\u540edropEvent\u4e0d\u751f\u6548

    Example

    12
    sink:\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\nifRenderTopicFailed:\ndropEvent: true\n
    sink:\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\nifRenderTopicFailed:\nignoreError: true\ndefaultTopic: default\n
    "},{"location":"reference/pipelines/sink/franzkafka/#ignoreunknowntopicorpartition","title":"ignoreUnknownTopicOrPartition","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ignoreUnknownTopicOrPartition \u975e\u5fc5\u586b \u7528\u4e8e\u5f53\u53d1\u9001\u7684topic\u4e0d\u5b58\u5728\u65f6\uff0c\u5ffd\u7565Kafka\u8fd4\u56deUNKNOWN_TOPIC_OR_PARTITION\u7684\u62a5\u9519 "},{"location":"reference/pipelines/sink/franzkafka/#balance","title":"balance","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 balance string \u975e\u5fc5\u586b roundRobin \u8d1f\u8f7d\u5747\u8861\u7b56\u7565\uff0c\u53ef\u586broundRobin\u3001range\u3001sticky\u3001cooperativeSticky"},{"location":"reference/pipelines/sink/franzkafka/#compression","title":"compression","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compression string \u975e\u5fc5\u586b gzip \u65e5\u5fd7\u53d1\u9001\u81f3Kafka\u7684\u538b\u7f29\u7b56\u7565\uff0c\u53ef\u586bgzip\u3001snappy\u3001lz4\u3001zstd"},{"location":"reference/pipelines/sink/franzkafka/#batchsize","title":"batchSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchSize int \u975e\u5fc5\u586b 100 \u53d1\u9001\u65f6\u6bcf\u4e2abatch\u6700\u591a\u5305\u542b\u7684\u6570\u636e\u4e2a\u6570"},{"location":"reference/pipelines/sink/franzkafka/#batchbytes","title":"batchBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchBytes int \u975e\u5fc5\u586b 1048576 \u6bcf\u4e2a\u53d1\u9001\u8bf7\u6c42\u5305\u542b\u7684\u6700\u5927\u5b57\u8282\u6570"},{"location":"reference/pipelines/sink/franzkafka/#writetimeout","title":"writeTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 writeTimeout time.Duration \u975e\u5fc5\u586b 10s \u5199\u5165\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/franzkafka/#tls","title":"tls","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 tls.enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u542f\u7528 tls.caCertFiles string \u975e\u5fc5\u586b \u8bc1\u4e66\u6587\u4ef6\u8def\u5f84 tls.clientCertFile string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1a\u5ba2\u6237\u7aefcert\u6587\u4ef6 tls.clientKeyFile string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1a\u5ba2\u6237\u7aefkey\u6587\u4ef6 tls.endpIdentAlgo bool type=scram\u65f6\u5fc5\u586b \u5ba2\u6237\u7aef\u662f\u5426\u9a8c\u8bc1\u670d\u52a1\u7aef\u7684\u8bc1\u4e66\u540d\u5b57"},{"location":"reference/pipelines/sink/franzkafka/#sasl","title":"sasl","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sasl \u975e\u5fc5\u586b SASL authentication sasl.enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u542f\u7528 sasl.mechanism string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1aPLAIN\u3001SCRAM-SHA-256\u3001SCRAM-SHA-512\u3001GSSAPI sasl.username string \u5fc5\u586b \u7528\u6237\u540d sasl.password string \u5fc5\u586b \u5bc6\u7801"},{"location":"reference/pipelines/sink/franzkafka/#gssapi","title":"gssapi","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sasl.gssapi \u975e\u5fc5\u586b SASL authentication sasl.gssapi.authType string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1a1 \u4f7f\u7528\u8d26\u53f7\u5bc6\u7801\u30012 \u4f7f\u7528keytab sasl.gssapi.keyTabPath string \u5fc5\u586b keytab \u6587\u4ef6\u8def\u5f84 sasl.gssapi.kerberosConfigPath string \u5fc5\u586b kerbeos \u6587\u4ef6\u8def\u5f84 sasl.gssapi.serviceName string \u5fc5\u586b \u670d\u52a1\u540d\u79f0 sasl.gssapi.userName string \u5fc5\u586b \u7528\u6237\u540d sasl.gssapi.password string \u5fc5\u586b \u5bc6\u7801 sasl.gssapi.realm string \u5fc5\u586b \u9886\u57df sasl.gssapi.disablePAFXFAST bool type=scram\u65f6\u5fc5\u586b DisablePAFXFAST \u7528\u4e8e\u5c06\u5ba2\u6237\u7aef\u914d\u7f6e\u4e3a\u4e0d\u4f7f\u7528 PA_FX_FAST"},{"location":"reference/pipelines/sink/franzkafka/#security","title":"security","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 security string \u975e\u5fc5\u586b java\u683c\u5f0f\u7684\u5b89\u5168\u8ba4\u8bc1\u5185\u5bb9\uff0c\u53ef\u4ee5\u81ea\u52a8\u8f6c\u5316\u6210\u4e3afranz-go\u9002\u914d\u7684\u683c\u5f0f

    Example

    pipelines:\n  - name: local\n    sources:\n      - type: file\n        name: demo\n        paths:\n          - /tmp/log/*.log\n    sink:\n      type: franzKafka\n      brokers:\n      - \"hadoop74.axrzpt.com:9092\"\n      topic: loggie\n      writeTimeout: 5s\n      sasl:\n        gssapi:\n          kerberosConfigPath: /etc/krb5-conf/krb5.conf\n      security:\n        security.protocol: \"SASL_PLAINTEXT\"\n        sasl.mechanism: \"GSSAPI\"\n        sasl.jaas.config: \"com.sun.security.auth.module.Krb5LoginModule required useKeyTab=true storeKey=true debug=true keyTab=\\\"/shylock/kerberos/zork.keytab\\\"  principal=\\\"zork@AXRZPT.COM\\\";\"\n        sasl.kerberos.service.name: \"kafka\"\n

    Kubernetes \u6302\u8f7dkeytab\u4e8c\u8fdb\u5236\u8bc1\u4e66\uff0c\u8bf7\u53c2\u8003\u5b98\u65b9\u6587\u6863\u3002

    "},{"location":"reference/pipelines/sink/franzkafka/#partitionkey","title":"partitionKey","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 partitionKey string \u975e\u5fc5\u586b \u65e0 \u63a7\u5236\u53d1\u9001\u81f3topic\u4e0b\u54ea\u4e2a\u5206\u533a

    \u4e0etopic\u76f8\u4f3c\uff0c\u53ef\u4f7f\u7528${a.b}\u7684\u65b9\u5f0f\uff0c\u83b7\u53d6event\u91cc\u7684\u5b57\u6bb5\u503c\u4f5c\u4e3a\u5177\u4f53\u7684topic\u540d\u79f0\u3002

    "},{"location":"reference/pipelines/sink/grpc/","title":"grpc","text":"

    \u4f7f\u7528grpc sink\u53d1\u9001\u81f3\u4e0b\u6e38\uff0c\u9700\u8981\u4e0b\u6e38\u652f\u6301\u76f8\u540c\u683c\u5f0f\u7684grpc\u534f\u8bae\u3002\u53ef\u4ee5\u4f7f\u7528\u8be5sink\u53d1\u9001\u81f3grpc source\u7684Loggie\u4e2d\u8f6c\u673a\u3002

    Example

    sink:\ntype: grpc\nhost: \"loggie-aggregator.loggie-aggregator:6166\"\n
    "},{"location":"reference/pipelines/sink/grpc/#host","title":"host","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 host string \u5fc5\u586b \u65e0 \u53d1\u9001\u81f3\u4e0b\u6e38\u7684host\u5730\u5740\uff0c\u591a\u4e2aip\u4f7f\u7528,\u9017\u53f7\u5206\u9694"},{"location":"reference/pipelines/sink/grpc/#loadbalance","title":"loadBalance","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 loadBalance string \u975e\u5fc5\u586b round_robin grpc\u8d1f\u8f7d\u5747\u8861\u7b56\u7565"},{"location":"reference/pipelines/sink/grpc/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 30s \u53d1\u9001\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/grpc/#grpcheaderkey","title":"grpcHeaderKey","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 grpcHeaderKey string \u975e\u5fc5\u586b \u65e0"},{"location":"reference/pipelines/sink/kafka/","title":"kafka","text":"

    \u4f7f\u7528sink kafka\u5c06\u65e5\u5fd7\u6570\u636e\u53d1\u9001\u81f3\u4e0b\u6e38Kafka\u3002

    Example

    \u7b80\u5355SASL\u8ba4\u8bc1
    sink:\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\n
    sink:\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"demo\"\nsasl:\ntype: scram\nusername: ***\npassword: ***\nalgorithm: sha512\n

    \u652f\u6301\u7684Kafka\u7248\u672c

    \u8be5kafka sink\u4f7f\u7528\u7684\u662fsegmentio/kafka-go\u5e93\u3002\u5f53\u524dLoggie\u4f7f\u7528\u7684\u5e93\u7248\u672c\u4e3av0.4.39\uff0c\u5bf9\u5e94\u7248\u672c\u6d4b\u8bd5\u652f\u6301\u7684Kafka\u7248\u672c\u4e3a\uff1a0.10.1.0 - 2.7.1

    "},{"location":"reference/pipelines/sink/kafka/#brokers","title":"brokers","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 brokers string\u6570\u7ec4 \u5fc5\u586b \u65e0 \u53d1\u9001\u65e5\u5fd7\u81f3Kafka\u7684brokers\u5730\u5740"},{"location":"reference/pipelines/sink/kafka/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u975e\u5fc5\u586b loggie \u53d1\u9001\u65e5\u5fd7\u81f3Kafka\u7684topic

    \u53ef\u4f7f\u7528${a.b}\u7684\u65b9\u5f0f\uff0c\u83b7\u53d6event\u91cc\u7684\u5b57\u6bb5\u503c\u4f5c\u4e3a\u5177\u4f53\u7684topic\u540d\u79f0\u3002

    \u6bd4\u5982\uff0c\u4e00\u4e2aevent\u4e3a\uff1a

    {\n\"topic\": \"loggie\",\n\"hello\": \"world\"\n}\n
    \u53ef\u914d\u7f6etopic: ${topic}\uff0c\u6b64\u65f6\u8be5event\u53d1\u9001\u5230Kafka\u7684topic\u4e3a\"loggie\"\u3002

    \u540c\u65f6\u652f\u6301\u5d4c\u5957\u7684\u9009\u62e9\u65b9\u5f0f\uff1a

    {\n\"fields\": {\n\"topic\": \"loggie\"\n},\n\"hello\": \"world\"\n}\n
    \u53ef\u914d\u7f6etopic: ${fields.topic}\uff0c\u540c\u6837\u4e5f\u4f1a\u53d1\u9001\u5230topic \"loggie\"\u3002

    "},{"location":"reference/pipelines/sink/kafka/#ifrendertopicfailed","title":"ifRenderTopicFailed","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ifRenderTopicFailed \u975e\u5fc5\u586b \u5982\u679c\u4f7f\u7528\u52a8\u6001\u7684\u89c4\u5219\u6e32\u67d3topic\uff0c\u6bd4\u5982topic: ${fields.topic}\uff0c\u6709\u53ef\u80fd\u6e32\u67d3\u5931\u8d25\uff08\u6bd4\u5982\u65e5\u5fd7\u6ca1\u6709fields.topic\u5b57\u6bb5\uff09\uff0c\u4e0b\u9762\u914d\u7f6e\u6307\u793a\u5931\u8d25\u540e\u7684\u52a8\u4f5c\u3002 ifRenderTopicFailed.dropEvent \u975e\u5fc5\u586b true \u9ed8\u8ba4\u4e3a\u4e22\u5f03 ifRenderTopicFailed.ignoreError \u975e\u5fc5\u586b \u5ffd\u7565\u9519\u8bef\u65e5\u5fd7\uff0c\u8bf7\u6ce8\u610f\uff0c\u8fd9\u91cc\u53ea\u662f\u4e0d\u6253\u5370\u9519\u8bef\u65e5\u5fd7 ifRenderTopicFailed.defaultTopic \u975e\u5fc5\u586b \u53d1\u9001\u81f3\u8be5\u9ed8\u8ba4\u7684topic\uff0c\u914d\u7f6e\u540edropEvent\u4e0d\u751f\u6548

    Example

    12
    sink:\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\nifRenderTopicFailed:\ndropEvent: true\n
    sink:\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\nifRenderTopicFailed:\nignoreError: true\ndefaultTopic: default\n
    "},{"location":"reference/pipelines/sink/kafka/#ignoreunknowntopicorpartition","title":"ignoreUnknownTopicOrPartition","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ignoreUnknownTopicOrPartition \u975e\u5fc5\u586b \u7528\u4e8e\u5f53\u53d1\u9001\u7684topic\u4e0d\u5b58\u5728\u65f6\uff0c\u5ffd\u7565Kafka\u8fd4\u56deUNKNOWN_TOPIC_OR_PARTITION\u7684\u62a5\u9519 "},{"location":"reference/pipelines/sink/kafka/#balance","title":"balance","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 balance string \u975e\u5fc5\u586b roundRobin \u8d1f\u8f7d\u5747\u8861\u7b56\u7565\uff0c\u53ef\u586bhash\u3001roundRobin\u3001leastBytes"},{"location":"reference/pipelines/sink/kafka/#compression","title":"compression","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compression string \u975e\u5fc5\u586b gzip \u65e5\u5fd7\u53d1\u9001\u81f3Kafka\u7684\u538b\u7f29\u7b56\u7565\uff0c\u53ef\u586bgzip\u3001snappy\u3001lz4\u3001zstd"},{"location":"reference/pipelines/sink/kafka/#maxattempts","title":"maxAttempts","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxAttempts int \u975e\u5fc5\u586b 10 \u53d1\u9001\u6700\u591a\u91cd\u8bd5\u6b21\u6570"},{"location":"reference/pipelines/sink/kafka/#batchsize","title":"batchSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchSize int \u975e\u5fc5\u586b 100 \u53d1\u9001\u65f6\u6bcf\u4e2abatch\u6700\u591a\u5305\u542b\u7684\u6570\u636e\u4e2a\u6570"},{"location":"reference/pipelines/sink/kafka/#batchbytes","title":"batchBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchBytes int \u975e\u5fc5\u586b 1048576 \u6bcf\u4e2a\u53d1\u9001\u8bf7\u6c42\u5305\u542b\u7684\u6700\u5927\u5b57\u8282\u6570"},{"location":"reference/pipelines/sink/kafka/#batchtimeout","title":"batchTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchTimeout time.Duration \u975e\u5fc5\u586b 1s \u5f62\u6210\u6bcf\u4e2a\u53d1\u9001batch\u7684\u6700\u957f\u65f6\u95f4"},{"location":"reference/pipelines/sink/kafka/#readtimeout","title":"readTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 readTimeout time.Duration \u975e\u5fc5\u586b 10s \u8bfb\u53d6\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/kafka/#writetimeout","title":"writeTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 writeTimeout time.Duration \u975e\u5fc5\u586b 10s \u5199\u5165\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/kafka/#requiredacks","title":"requiredAcks","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 requiredAcks int \u975e\u5fc5\u586b 0 \u7b49\u5f85ack\u53c2\u6570\uff0c\u53ef\u4e3a0\u30011\u3001-1 "},{"location":"reference/pipelines/sink/kafka/#sasl","title":"sasl","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sasl \u975e\u5fc5\u586b SASL authentication sasl.type string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1aplain\u3001scram sasl.username string \u5fc5\u586b \u7528\u6237\u540d\uff0c\u8bf7\u6ce8\u610f\u5728v1.4\u548c\u4e4b\u524d\u4f7f\u7528\u7684\u540d\u79f0\u4e3auserName\uff0c\u5f53\u7136\u540e\u7eed\u7248\u672c\u4e5f\u5bf9\u6b64\u8fdb\u884c\u4e86\u517c\u5bb9 sasl.password string \u5fc5\u586b \u5bc6\u7801 sasl.algorithm string type=scram\u65f6\u5fc5\u586b type=scram\u65f6\u4f7f\u7528\u7684\u7b97\u6cd5\uff0c\u53ef\u9009sha256\u3001sha512"},{"location":"reference/pipelines/sink/kafka/#partitionkey","title":"partitionKey","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 partitionKey string \u975e\u5fc5\u586b \u65e0 \u63a7\u5236\u53d1\u9001\u81f3topic\u4e0b\u54ea\u4e2a\u5206\u533a

    \u4e0etopic\u76f8\u4f3c\uff0c\u53ef\u4f7f\u7528${a.b}\u7684\u65b9\u5f0f\uff0c\u83b7\u53d6event\u91cc\u7684\u5b57\u6bb5\u503c\u4f5c\u4e3a\u5177\u4f53\u7684topic\u540d\u79f0\u3002

    "},{"location":"reference/pipelines/sink/loki/","title":"loki","text":"

    loki sink\u7528\u4e8e\u53d1\u9001\u6570\u636e\u81f3Loki\u5b58\u50a8\u3002Loki\u6587\u6863\u53ef\u53c2\u8003\u8fd9\u91cc\u3002

    Example

    sink:\ntype: loki\nurl: \"http://localhost:3100/loki/api/v1/push\"\n
    "},{"location":"reference/pipelines/sink/loki/#url","title":"url","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 url string \u5fc5\u586b push loki\u7684api"},{"location":"reference/pipelines/sink/loki/#tenantid","title":"tenantId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 tenantId string \u975e\u5fc5\u586b \u53d1\u9001\u4f7f\u7528\u7684\u79df\u6237\u540d\u79f0"},{"location":"reference/pipelines/sink/loki/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 30s \u53d1\u9001\u7684\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/loki/#entryline","title":"entryLine","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 entryLine string \u975e\u5fc5\u586b \u53d1\u9001\u81f3Loki\u7684\u65e5\u5fd7\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3aloggie event\u7684body

    Loki\u7684\u65e5\u5fd7\u6570\u636e\u7ed3\u6784\u5927\u6982\u5206\u4e3alabel\u548c\u4e3b\u4f53\u6570\u636e\uff0cloggie\u4f1a\u9ed8\u8ba4\u5c06header\u91cc\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\uff0c\u8f6c\u6210\u4ee5\u4e0b\u5212\u7ebf_\u8fde\u63a5\u7684label\u3002 \u53e6\u5916\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u7531\u4e8eloki\u7684labels key\u4e0d\u652f\u6301., /, -\uff0c\u8fd9\u91cc\u4f1a\u81ea\u52a8\u5c06header\u91cc\u5305\u542b\u8fd9\u4e9b\u7b26\u53f7\u7684key\u8f6c\u6210_\u7684\u5f62\u5f0f\u3002

    "},{"location":"reference/pipelines/sink/loki/#insecureskipverify","title":"insecureSkipVerify","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 insecureSkipVerify bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u8bc1\u4e66\u8ba4\u8bc1"},{"location":"reference/pipelines/sink/overview/","title":"Overview","text":"

    \u4e00\u4e2aPipeline\u5bf9\u5e94\u4e00\u4e2aSink\u3002

    Concurrency\u76f8\u5173\u914d\u7f6e\u4f7f\u7528\u53ef\u53c2\u7167\u81ea\u9002\u5e94sink\u6d41\u91cf\u63a7\u5236\u3002

    "},{"location":"reference/pipelines/sink/overview/#sink","title":"Sink\u901a\u7528\u914d\u7f6e","text":"

    Example

    sink:\ntype: \"dev\"\ncodec:\ntype: json\npretty: true\nparallelism: 16\nconcurrency:\nenabled: true\nrtt:\nblockJudgeThreshold: 120%\nnewRttWeigh: 0.4\ngoroutine:\ninitThreshold: 8\nmaxGoroutine: 20\nunstableTolerate: 3\nchannelLenOfCap: 0.4\nratio:\nmulti: 2\nlinear: 2\nlinearWhenBlocked: 4\nduration:\nunstable: 15\nstable: 30\n
    "},{"location":"reference/pipelines/sink/overview/#parallelism","title":"parallelism","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 parallelism int \u975e\u5fc5\u586b 1 sink\u5ba2\u6237\u7aef\u7684\u5e76\u53d1\u5ea6\uff0c\u53ef\u540c\u65f6\u542f\u52a8\u591a\u4e2a\u589e\u5927\u53d1\u9001\u541e\u5410\u91cf\uff0c\u53ef\u8bbe\u7f6e\u7684\u6700\u5927\u503c\u4e3a100"},{"location":"reference/pipelines/sink/overview/#codec","title":"codec","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 codec \u975e\u5fc5\u586b sink\u53d1\u9001\u6570\u636e\u7ed9\u4e0b\u6e38\u65f6\uff0c\u6570\u636e\u4f7f\u7528\u7684\u683c\u5f0f codec.type string \u975e\u5fc5\u586b json codec\u7c7b\u578b codec.printEvents bool \u975e\u5fc5\u586b false \u662f\u5426\u6253\u5370\u51faevents\u5230Loggie\u7684\u65e5\u5fd7\u4e2d\uff0c\u53ef\u7528\u4e8e\u4e34\u65f6\u6392\u67e5\u95ee\u9898 codec.pretty bool \u975e\u5fc5\u586b false \u6253\u5370\u51faevents\u5230Loggie\u7684\u65e5\u5fd7\u4e2d\u7684\u65f6\u5019\uff0c\u662f\u5426\u7f8e\u5316\u5c55\u793a\uff0c\u4ec5type:json\u65f6\u751f\u6548\uff0c\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u662f\u53d1\u9001\u5230Elasticsearch\u7b49\u4e0b\u6e38\uff0c\u8bf7\u52ff\u4f7f\u7528pretty\uff0c\u4f1a\u5bfc\u81f4\u53d1\u9001\u5f02\u5e38"},{"location":"reference/pipelines/sink/overview/#type-json","title":"type: json","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 codec.pretty \u975e\u5fc5\u586b false \u662f\u5426\u8fdb\u884cjson\u683c\u5f0f\u7f8e\u5316 codec.beatsFormat \u975e\u5fc5\u586b false \u65e5\u5fd7\u8f6c\u6210\u7c7bfilebeats\u683c\u5f0f\uff1a\u589e\u52a0@timestamp\u5b57\u6bb5\uff0c\u540c\u65f6body\u5b57\u6bb5\u547d\u540d\u4e3amessage"},{"location":"reference/pipelines/sink/overview/#type-raw","title":"type: raw","text":"

    \u7528\u4e8e\u53d1\u9001\u91c7\u96c6\u7684\u539f\u59cbbody\u6570\u636e\u3002

    Example

    sink:\ntype: dev\ncodec:\ntype: raw\n
    "},{"location":"reference/pipelines/sink/overview/#printevents","title":"printEvents","text":"

    \u662f\u5426\u6253\u5370\u51faevents\u5230Loggie\u7684\u65e5\u5fd7\u4e2d\uff0c\u53ef\u7528\u4e8e\u4e34\u65f6\u6392\u67e5\u95ee\u9898\u3002 \u6b64\u65f6\u65e0\u9700\u5c06\u5f53\u524d\u7684sink type\u4fee\u6539\u4e3adev\uff0c\u66f4\u52a0\u65b9\u4fbf\u3002

    Example

    sink:\ntype: kafka\n...\ncodec:\nprintEvents: true\n
    "},{"location":"reference/pipelines/sink/overview/#concurrency","title":"concurrency","text":"

    Example

    sink:\ntype: kafka\nconcurrency:\nenabled: true\n
    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542fsink\u81ea\u9002\u5e94\u5e76\u53d1\u5ea6\u63a7\u5236

    \u6ce8\uff1a\u9ed8\u8ba4\u6b64\u529f\u80fd\u4e0d\u5f00\u542f\u3002

    "},{"location":"reference/pipelines/sink/overview/#concurrencygoroutine","title":"concurrency.goroutine","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 initThreshold int \u975e\u5fc5\u586b 16 \u521d\u59cb\u9608\u503c\uff0c\u4f4e\u4e8e\u8be5\u503c\uff0c\u534f\u7a0b\u6570\u6307\u6570\u589e\u957f\uff08\u5feb\u542f\u52a8\u9636\u6bb5\uff09\uff0c\u9ad8\u4e8e\u8be5\u503c\uff0c\u7ebf\u6027\u589e\u957f maxGoroutine int \u975e\u5fc5\u586b 30 \u6700\u5927\u534f\u7a0b\u6570 unstableTolerate int \u975e\u5fc5\u586b 3 \u8fdb\u5165\u5e73\u7a33\u9636\u6bb5\u540e\uff0c\u5bf9\u7f51\u7edc\u6ce2\u52a8\u7684\u5bb9\u5fcd\uff0c\u534f\u7a0b\u6570\u9700\u51cf\u5c11\u7684\u60c5\u51b5\u5305\u62ecrtt\u589e\u5927\uff0c\u8bf7\u6c42\u5931\u8d25\uff0c\u534f\u7a0b\u6570\u9700\u589e\u5927\u7684\u60c5\u51b5\u5305\u62ec\u7f51\u7edc\u5e73\u7a33\u4e14channel\u9971\u548c\uff0c\u76f8\u540c\u60c5\u51b5\u51fa\u73b03\u6b21\u624d\u4f1a\u89e6\u53d1\u534f\u7a0b\u6570\u6539\u53d8\uff0c\u82e5\u51fa\u73b0\u7b2c\u56db\u6b21\uff0c\u5c06\u4f1a\u8ffd\u52a0\uff0c\u76f4\u5230\u76f8\u53cd\u7684\u60c5\u51b5\u89e6\u53d1\u534f\u7a0b\u6570\u6539\u53d8\u3002 channelLenOfCap float \u975e\u5fc5\u586b 0.4 channel\u9971\u548c\u9608\u503c\uff0c\u8d85\u8fc7\u8be5\u503c\u8ba4\u4e3a\u534f\u7a0b\u6570\u9700\u589e\u5927\uff0c\u4ec5\u5728rtt\u7a33\u5b9a\u60c5\u51b5\u4e0b\u624d\u4f1a\u8ba1\u7b97\u8be5\u503c"},{"location":"reference/pipelines/sink/overview/#concurrencyrtt","title":"concurrency.rtt","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 blockJudgeThreshold string \u975e\u5fc5\u586b 120% \u5224\u65adrtt\u589e\u5927\u9608\u503c\uff0c\u5f53\u65b0rtt\u8d85\u8fc7\u5f53\u524d\u5e73\u5747rtt\u7684\u5230\u8fbe\u4e00\u5b9a\u7a0b\u5ea6\uff0c\u8ba4\u4e3a\u534f\u7a0b\u6570\u9700\u51cf\u5c11 newRttWeigh float \u975e\u5fc5\u586b 0.5 \u8ba1\u7b97\u65b0\u7684\u5e73\u5747rtt\u65f6\uff0c\u65b0rtt\u7684\u6743\u91cd

    \u6ce8\uff1ablockJudgeThreshold\uff08b\uff09\u652f\u6301\u767e\u5206\u6bd4\u548c\u6d6e\u70b9\u6570\u4e24\u79cd\u3002

    \u82e5\u4e3a\u767e\u5206\u6bd4\uff0c\u5219\u5224\u65ad\u662f\u5426 (\u65b0rtt/\u5e73\u5747rtt)>b \u3002

    \u82e5\u4e3a\u6d6e\u70b9\u6570\uff0c\u5219\u5224\u65ad\u662f\u5426 (\u65b0rtt-\u5e73\u5747rtt)>b \u3002

    "},{"location":"reference/pipelines/sink/overview/#concurrencyratio","title":"concurrency.ratio","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 multi int \u975e\u5fc5\u586b 2 \u5feb\u542f\u52a8\u9636\u6bb5\uff0c\u534f\u7a0b\u6570\u6307\u6570\u589e\u957f\u901f\u7387 linear int \u975e\u5fc5\u586b 2 \uff08\u5feb\u542f\u52a8\u4e4b\u540e\uff09\u534f\u7a0b\u6570\u7ebf\u6027\u589e\u957f\u6216\u51cf\u5c11\u901f\u7387 linearWhenBlocked int \u975e\u5fc5\u586b 4 channel\u6ee1\u65f6(\u4e0a\u6e38\u963b\u585e)\uff0c\u534f\u7a0b\u6570\u7ebf\u6027\u589e\u957f\u901f\u7387"},{"location":"reference/pipelines/sink/overview/#concurrencyduration","title":"concurrency.duration","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 unstable int \u975e\u5fc5\u586b 15 \u975e\u5e73\u7a33\u9636\u6bb5\uff0c\u6536\u96c6\u6570\u636e\u8ba1\u7b97\u534f\u7a0b\u6570\u7684\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\u79d2 stable int \u975e\u5fc5\u586b 30 \u5e73\u7a33\u9636\u6bb5\uff0c\u6536\u96c6\u6570\u636e\u8ba1\u7b97\u534f\u7a0b\u6570\u7684\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\u79d2"},{"location":"reference/pipelines/sink/pulsar/","title":"pulsar","text":"

    pulsar sink\u7528\u4e8e\u53d1\u9001\u6570\u636e\u81f3pulsar\u5b58\u50a8\u3002 \u8be5sink\u4e3abeta\u8bd5\u7528\u72b6\u6001\uff0c\u8bf7\u8c28\u614e\u4f7f\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u3002

    Example

    sink:\ntype: pulsar\nurl: pulsar://localhost:6650\ntopic: my-topic\n
    "},{"location":"reference/pipelines/sink/pulsar/#url","title":"url","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 url string \u5fc5\u586b \u65e0 \u65e5\u5fd7\u53d1\u9001\u7aefpulsar\u8fde\u63a5\u5730\u5740"},{"location":"reference/pipelines/sink/pulsar/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u5fc5\u586b \u65e0 \u53d1\u9001\u65e5\u5fd7\u81f3pulsar\u7684topic"},{"location":"reference/pipelines/sink/pulsar/#producername","title":"producerName","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 producerName string \u975e\u5fc5\u586b \u65e0 specifies a name for the producer"},{"location":"reference/pipelines/sink/pulsar/#properties","title":"properties","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 producerName map \u975e\u5fc5\u586b \u65e0 Properties specifies a set of application defined properties for the producer"},{"location":"reference/pipelines/sink/pulsar/#operationtimeoutseconds","title":"operationTimeoutSeconds","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 operationTimeoutSeconds time.Duration \u975e\u5fc5\u586b 30s Producer-create, subscribe and unsubscribe operations will be retried until this interval, after which the operation will be marked as failed"},{"location":"reference/pipelines/sink/pulsar/#connectiontimeout","title":"connectionTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 connectionTimeout time.Duration \u975e\u5fc5\u586b 5s Timeout for the establishment of a TCP connection"},{"location":"reference/pipelines/sink/pulsar/#sendtimeout","title":"sendTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sendTimeout time.Duration \u975e\u5fc5\u586b 30s SendTimeout set the timeout for a message that is not acknowledged by the server 30s"},{"location":"reference/pipelines/sink/pulsar/#maxpendingmessages","title":"maxPendingMessages","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sendTimeout time.Duration \u975e\u5fc5\u586b \u65e0 MaxPendingMessages specifies the max size of the queue holding the messages pending to receive an acknowledgment from the broker"},{"location":"reference/pipelines/sink/pulsar/#hashingschema","title":"hashingSchema","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 hashingSchema int \u975e\u5fc5\u586b 0 HashingScheme is used to define the partition on where to publish a particular message. 0:JavaStringHash\uff0c1:Murmur3_32Hash"},{"location":"reference/pipelines/sink/pulsar/#compressiontype","title":"compressionType","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compressionType int \u975e\u5fc5\u586b 0 0:NoCompression, 1:LZ4, 2:ZLIB, 3:ZSTD"},{"location":"reference/pipelines/sink/pulsar/#compressionlevel","title":"compressionLevel","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compressionLevel int \u975e\u5fc5\u586b 0 0:Default, 1:Faster, 2:Better"},{"location":"reference/pipelines/sink/pulsar/#loglevel","title":"logLevel","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 logLevel string \u975e\u5fc5\u586b 0 \u65e5\u5fd7\u7ea7\u522b: \"info\",\"debug\", \"error\""},{"location":"reference/pipelines/sink/pulsar/#batchingmaxsize","title":"batchingMaxSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchingMaxSize int \u975e\u5fc5\u586b 2048(KB) BatchingMaxSize specifies the maximum number of bytes permitted in a batch"},{"location":"reference/pipelines/sink/pulsar/#batchingmaxmessages","title":"batchingMaxMessages","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchingMaxMessages int \u975e\u5fc5\u586b 1000 BatchingMaxMessages specifies the maximum number of messages permitted in a batch"},{"location":"reference/pipelines/sink/pulsar/#batchingmaxpublishdelay","title":"batchingMaxPublishDelay","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 batchingMaxPublishDelay time.Duration \u975e\u5fc5\u586b 10ms BatchingMaxPublishDelay specifies the time period within which the messages sent will be batched"},{"location":"reference/pipelines/sink/pulsar/#usetls","title":"useTLS","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 useTLS bool \u975e\u5fc5\u586b false \u662f\u5426\u4f7f\u7528TLS\u8ba4\u8bc1"},{"location":"reference/pipelines/sink/pulsar/#tlstrustcertsfilepath","title":"tlsTrustCertsFilePath","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 tlsTrustCertsFilePath string \u975e\u5fc5\u586b \u65e0 the path to the trusted TLS certificate file"},{"location":"reference/pipelines/sink/pulsar/#tlsallowinsecureconnection","title":"tlsAllowInsecureConnection","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 tlsAllowInsecureConnection bool \u975e\u5fc5\u586b false Configure whether the Pulsar client accept untrusted TLS certificate from broker"},{"location":"reference/pipelines/sink/pulsar/#certificatepath","title":"certificatePath","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 certificatePath string \u975e\u5fc5\u586b \u65e0 TLS\u8bc1\u4e66\u8def\u5f84"},{"location":"reference/pipelines/sink/pulsar/#privatekeypath","title":"privateKeyPath","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 privateKeyPath string \u975e\u5fc5\u586b \u65e0 TLS privateKey\u8def\u5f84"},{"location":"reference/pipelines/sink/pulsar/#token","title":"token","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 token string \u975e\u5fc5\u586b \u65e0 \u5982\u679c\u4f7f\u7528token\u8ba4\u8bc1\u9274\u6743pulsar\uff0c\u8bf7\u586b\u5199\u6b64\u9879"},{"location":"reference/pipelines/sink/pulsar/#tokenfilepath","title":"tokenFilePath","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 tokenFilePath string \u975e\u5fc5\u586b \u65e0 auth token from a file"},{"location":"reference/pipelines/sink/rocketmq/","title":"rocketmq","text":"

    rocketmq sink \u53ef\u4ee5\u5c06\u65e5\u5fd7\u6570\u636e\u53d1\u9001\u81f3\u4e0b\u6e38 RocketMQ \u3002

    Example

    sink:\ntype: rocketmq\nnameServer: - 127.0.0.1:9876\ntopic: \"log-${fields.topic}\"\n
    "},{"location":"reference/pipelines/sink/rocketmq/#nameserver","title":"nameServer","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 nameServer string \u6570\u7ec4 \u975e\u5fc5\u586b \u65e0 RocketMQ nameserver addr \u5217\u8868"},{"location":"reference/pipelines/sink/rocketmq/#nsresolver","title":"nsResolver","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 nsResolver string \u6570\u7ec4 \u975e\u5fc5\u586b \u65e0 \u7528\u4e8e\u83b7\u53d6 nameserver addr \u7684 reslover \u5217\u8868

    \u6ce8\u610f\uff1anameServer \u548c nsResolver \u4e8c\u9009\u4e00\uff0c\u5fc5\u987b\u8981\u8bbe\u7f6e\u4e00\u4e2a

    "},{"location":"reference/pipelines/sink/rocketmq/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u5fc5\u586b loggie \u53d1\u9001\u65e5\u5fd7\u81f3 RocketMQ \u7684 topic

    \u53ef\u4f7f\u7528 ${a.b} \u7684\u65b9\u5f0f\uff0c\u83b7\u53d6 event \u91cc\u7684\u5b57\u6bb5\u503c\u4f5c\u4e3a\u5177\u4f53\u7684 topic \u540d\u79f0\u3002

    \u6bd4\u5982\uff0c\u4e00\u4e2a event \u4e3a\uff1a

    {\n\"topic\": \"loggie\",\n\"hello\": \"world\"\n}\n
    \u53ef\u914d\u7f6e topic: ${topic}\uff0c\u6b64\u65f6\u8be5 event \u53d1\u9001\u5230 RocketMQ \u7684 topic \u4e3a \"loggie\"\u3002

    \u540c\u65f6\u652f\u6301\u5d4c\u5957\u7684\u9009\u62e9\u65b9\u5f0f\uff1a

    {\n\"fields\": {\n\"topic\": \"loggie\"\n},\n\"hello\": \"world\"\n}\n

    \u53ef\u914d\u7f6e topic: ${fields.topic}\uff0c\u540c\u6837\u4e5f\u4f1a\u53d1\u9001\u5230 topic \"loggie\"\u3002

    "},{"location":"reference/pipelines/sink/rocketmq/#ifrendertopicfailed","title":"ifRenderTopicFailed","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ifRenderTopicFailed object \u975e\u5fc5\u586b \u914d\u7f6e topic \u52a8\u6001\u6e32\u67d3\u5931\u8d25\u7684\u52a8\u4f5c\u53c2\u6570 ifRenderTopicFailed.dropEvent bool \u975e\u5fc5\u586b true \u662f\u5426\u4e22\u5f03\u6b64\u6d88\u606f ifRenderTopicFailed.ignoreError bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u9519\u8bef ifRenderTopicFailed.defaultValue string \u975e\u5fc5\u586b \u65e0 \u6e32\u67d3\u5931\u8d25\u65f6\u4f7f\u7528\u7684\u9ed8\u8ba4\u914d\u7f6e\u7684 topic \u503c"},{"location":"reference/pipelines/sink/rocketmq/#group","title":"group","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 group string \u975e\u5fc5\u586b DEFAULT_PRODUCER \u540c\u4e00\u7c7b Producer \u7684\u96c6\u5408\uff0c\u8fd9\u7c7b Producer \u53d1\u9001\u540c\u4e00\u7c7b\u6d88\u606f\u4e14\u53d1\u9001\u903b\u8f91\u4e00\u81f4"},{"location":"reference/pipelines/sink/rocketmq/#tag","title":"tag","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 tag string \u975e\u5fc5\u586b \u65e0 \u4e3a\u6d88\u606f\u8bbe\u7f6e\u7684\u6807\u5fd7\uff0c\u7528\u4e8e\u540c\u4e00\u4e3b\u9898\u4e0b\u533a\u5206\u4e0d\u540c\u7c7b\u578b\u7684\u6d88\u606f\uff0c\u53ef\u7406\u89e3\u4e3a\u4e8c\u7ea7\u6d88\u606f\u7c7b\u578b\uff0c\u7528\u6765\u8fdb\u4e00\u6b65\u533a\u5206\u67d0\u4e2a Topic \u4e0b\u7684\u6d88\u606f\u5206\u7c7b

    RocketMQ \u6709\u5bf9 tag \u80fd\u529b\u7684\u652f\u6301\uff0c\u56e0\u6b64\uff0c\u7c7b\u4f3c topic\uff0ctag \u4e5f\u53ef\u4f7f\u7528 ${a.b} \u7684\u65b9\u5f0f\uff0c\u83b7\u53d6 event \u91cc\u7684\u5b57\u6bb5\u503c\u4f5c\u4e3a\u5177\u4f53\u7684 tag \u540d\u79f0\u3002

    \u6bd4\u5982\uff0c\u4e00\u4e2a event \u4e3a\uff1a

    {\n\"tag\": \"loggie\",\n\"hello\": \"world\"\n}\n
    \u53ef\u914d\u7f6e tag: ${tag}\uff0c\u6b64\u65f6\u8be5 RocketMQ \u7684\u6d88\u606f\u7684 tag \u4e3a \"loggie\"\u3002

    \u540c\u65f6\u652f\u6301\u5d4c\u5957\u7684\u9009\u62e9\u65b9\u5f0f\uff1a

    {\n\"fields\": {\n\"tag\": \"loggie\"\n},\n\"hello\": \"world\"\n}\n

    \u53ef\u914d\u7f6e tag: ${fields.tag}\uff0c\u540c\u6837\u4e5f\u4f1a\u914d\u7f6e\u6d88\u606f\u7684 tag \u4e3a \"loggie\"\u3002

    "},{"location":"reference/pipelines/sink/rocketmq/#ifrendertagfailed","title":"ifRenderTagFailed","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ifRenderTagFailed object \u975e\u5fc5\u586b \u914d\u7f6e tag \u52a8\u6001\u6e32\u67d3\u5931\u8d25\u7684\u52a8\u4f5c\u53c2\u6570 ifRenderTagFailed.dropEvent bool \u975e\u5fc5\u586b true \u662f\u5426\u4e22\u5f03\u6b64\u6d88\u606f ifRenderTagFailed.ignoreError bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u9519\u8bef ifRenderTagFailed.defaultValue string \u975e\u5fc5\u586b \u65e0 \u6e32\u67d3\u5931\u8d25\u65f6\u4f7f\u7528\u7684\u9ed8\u8ba4\u914d\u7f6e\u7684 tag \u503c

    \u6ce8\u610f\uff1a\u56e0\u4e3a tag \u662f\u975e\u5fc5\u987b\u53c2\u6570\uff0c\u9ed8\u8ba4\u4e3a\u7a7a\uff0c\u56e0\u6b64\uff0c\u53ea\u6709\u914d\u7f6e\u4e86 tag \u5e76\u4e14\u6e32\u67d3\u5931\u8d25\u65f6\uff0cifRenderTagFailed \u53c2\u6570\u624d\u4f1a\u751f\u6548

    "},{"location":"reference/pipelines/sink/rocketmq/#messagekeys","title":"messageKeys","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 messageKeys string \u6570\u7ec4 \u975e\u5fc5\u586b \u65e0 \u6d88\u606f\u7684\u4e1a\u52a1\u6807\u8bc6\uff0c\u7531\u6d88\u606f\u751f\u4ea7\u8005\uff08Producer\uff09\u8bbe\u7f6e\uff0c\u552f\u4e00 \u6807\u8bc6\u67d0\u4e2a\u4e1a\u52a1\u903b\u8f91\uff0c\u6bd4\u5982\u4ee5\u8ba2\u5355 ID \u4e3a key"},{"location":"reference/pipelines/sink/rocketmq/#retry","title":"retry","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 retry int \u975e\u5fc5\u586b 2 \u91cd\u8bd5\u6b21\u6570"},{"location":"reference/pipelines/sink/rocketmq/#sendmsgtimeout","title":"sendMsgTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sendMsgTimeout time.Duration \u975e\u5fc5\u586b 3s \u6d88\u606f\u53d1\u9001\u7684\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/sink/rocketmq/#compresslevel","title":"compressLevel","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compressLevel int \u975e\u5fc5\u586b 5 \u6d88\u606f\u7684\u538b\u7f29\u767b\u8bb0\uff0c\u53d6\u503c\u8303\u56f4\uff1a0 1 2 3 4 5 6 7 8 9"},{"location":"reference/pipelines/sink/rocketmq/#compressmsgbodyoverhowmuch","title":"compressMsgBodyOverHowmuch","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 compressMsgBodyOverHowmuch int \u975e\u5fc5\u586b 4096 \u6d88\u606fBody\u8d85\u8fc7\u591a\u5927\u5f00\u59cb\u538b\u7f29\uff08Consumer\u6536\u5230\u6d88\u606f\u4f1a\u81ea\u52a8\u89e3\u538b\u7f29\uff09\uff0c\u5355\u4f4d\u5b57\u8282"},{"location":"reference/pipelines/sink/rocketmq/#topicqueuenums","title":"topicQueueNums","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topicQueueNums int \u975e\u5fc5\u586b 4 \u5728\u53d1\u9001\u6d88\u606f\uff0c\u81ea\u52a8\u521b\u5efa\u670d\u52a1\u5668\u4e0d\u5b58\u5728\u7684topic\u65f6\uff0c\u9ed8\u8ba4\u521b\u5efa\u7684\u961f\u5217\u6570"},{"location":"reference/pipelines/sink/rocketmq/#credentials","title":"credentials","text":"

    credentials \u7528\u4e8e RocketMQ \u5f00\u542f\u4e86 ACL \u6743\u9650\u63a7\u5236\u7684\u573a\u666f

    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 credentials object \u975e\u5fc5\u586b \u65e0 \u5ba2\u6237\u7aef\u7528\u4e8e\u8eab\u4efd\u9a8c\u8bc1\u7684\u51ed\u8bc1\u4fe1\u606f\uff0c\u4ec5\u5728\u670d\u52a1\u7aef\u5f00\u542f\u8eab\u4efd\u8bc6\u522b\u548c\u8ba4\u8bc1\u65f6\u9700\u8981\u4f20\u8f93 credentials.accessKey string \u5fc5\u586b \u65e0 accessKey credentials.accessKey string \u5fc5\u586b \u65e0 secretKey credentials.securityToken string \u975e\u5fc5\u586b \u65e0 secretKey"},{"location":"reference/pipelines/sink/sls/","title":"sls","text":"

    sls sink\u7528\u4e8e\u5c06\u65e5\u5fd7\u53d1\u9001\u81f3\u963f\u91cc\u4e91\u53ef\u89c2\u6d4b\u7edf\u4e00\u5b58\u50a8SLS\u3002

    Example

    sink:\ntype: sls\nname: demo\nendpoint: cn-hangzhou.log.aliyuncs.com\naccessKeyId: ${id}\naccessKeySecret: ${secret}\nproject: test\nlogstore: test1\ntopic: myservice\n
    "},{"location":"reference/pipelines/sink/sls/#endpoint","title":"endpoint","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 endpoint string \u5fc5\u586b SLS\u5b58\u50a8\u7684\u8bbf\u95ee\u57df\u540d

    \u4f60\u53ef\u4ee5\u5728\u5177\u4f53project\u9875\u9762\u7684\u9879\u76ee\u6982\u89c8\u4e2d\u67e5\u770b\u5230\u3002

    "},{"location":"reference/pipelines/sink/sls/#accesskeyid","title":"accessKeyId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 accessKeyId string \u5fc5\u586b \u8bbf\u95ee\u7684accessKeyId\uff0c\u8bf7\u67e5\u770b\u963f\u91cc\u4e91\u8d26\u53f7\u7684\u8bbf\u95ee\u51ed\u8bc1\u7ba1\u7406

    \u5efa\u8bae\u4f7f\u7528\u963f\u91cc\u4e91\u7684\u5b50\u8d26\u53f7\uff0c\u5b50\u8d26\u53f7\u9700\u8981\u6709\u5bf9\u5e94project\u3001logstore\u7684\u6743\u9650\u3002

    "},{"location":"reference/pipelines/sink/sls/#accesskeysecret","title":"accessKeySecret","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 accessKeySecret string \u5fc5\u586b \u8bbf\u95ee\u7684accessKeySecret\uff0c\u8bf7\u67e5\u770b\u963f\u91cc\u4e91\u8d26\u53f7\u7684\u8bbf\u95ee\u51ed\u8bc1\u7ba1\u7406"},{"location":"reference/pipelines/sink/sls/#project","title":"project","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 project string \u5fc5\u586b SLS\u5b58\u50a8\u7684project\u540d\u79f0"},{"location":"reference/pipelines/sink/sls/#logstore","title":"logstore","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 logstore string \u5fc5\u586b SLS\u5b58\u50a8\u7684logstore\u540d\u79f0"},{"location":"reference/pipelines/sink/sls/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u975e\u5fc5\u586b \u65e5\u5fd7\u4e3b\u9898\uff08Topic\uff09\u662f\u65e5\u5fd7\u670d\u52a1\u7684\u57fa\u7840\u7ba1\u7406\u5355\u5143\u3002\u60a8\u53ef\u5728\u91c7\u96c6\u65e5\u5fd7\u65f6\u6307\u5b9aTopic\uff0c\u7528\u4e8e\u533a\u5206\u65e5\u5fd7"},{"location":"reference/pipelines/sink/webhook/","title":"alertWebhook","text":"

    alertWebhook sink\u5c06\u65e5\u5fd7\u6570\u636e\u53d1\u9001\u81f3http\u63a5\u6536\u65b9\u3002 \u4f7f\u7528\u793a\u4f8b\u8bf7\u53c2\u8003\u65e5\u5fd7\u62a5\u8b66

    Example

    sink:\ntype: alertWebhook\naddr: http://localhost:8080/loggie\nheaders:\napi: test1\nlineLimit: 10\ntemplate: |\n******\n
    "},{"location":"reference/pipelines/sink/webhook/#webhook","title":"webhook","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addr string \u975e\u5fc5\u586b \u53d1\u9001alert\u7684http\u5730\u5740\uff0c\u82e5\u4e3a\u7a7a\uff0c\u5219\u4e0d\u4f1a\u53d1\u9001 template string \u975e\u5fc5\u586b \u7528\u6765\u6e32\u67d3\u7684\u6a21\u677f timeout time.Duration \u975e\u5fc5\u586b 30s \u53d1\u9001alert\u7684http timeout headers map \u975e\u5fc5\u586b \u53d1\u9001alert\u7684http header method string \u975e\u5fc5\u586b POST \u53d1\u9001alert\u7684http method, \u5982\u679c\u4e0d\u586bput(\u4e0d\u533a\u5206\u5927\u5c0f\u5199)\uff0c\u90fd\u8ba4\u4e3a\u662fPOST lineLimit int \u975e\u5fc5\u586b 10 \u591a\u884c\u65e5\u5fd7\u91c7\u96c6\u60c5\u51b5\u4e0b\uff0c\u6bcf\u4e2aalert\u4e2d\u5305\u542b\u7684\u6700\u5927\u65e5\u5fd7\u884c\u6570"},{"location":"reference/pipelines/sink/zinc/","title":"zinc","text":"

    zinc sink\u7528\u4e8e\u53d1\u9001\u6570\u636e\u81f3zinc\u5b58\u50a8\u3002

    Example

    sink:\ntype: zinc\nhost: \"http://127.0.0.1:4080\"\nusername: admin\npassword: Complexpass#123\nindex: \"demo\"    
    "},{"location":"reference/pipelines/sink/zinc/#host","title":"host","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 host string \u975e\u5fc5\u586b http://127.0.0.1:4080 zinc\u7684url\u5730\u5740"},{"location":"reference/pipelines/sink/zinc/#username","title":"username","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 username string \u975e\u5fc5\u586b \u53d1\u9001\u81f3zinc\u7684\u7528\u6237\u540d"},{"location":"reference/pipelines/sink/zinc/#password","title":"password","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 password string \u975e\u5fc5\u586b \u53d1\u9001\u81f3zinc\u7684\u5bc6\u7801"},{"location":"reference/pipelines/sink/zinc/#index","title":"index","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 index string \u975e\u5fc5\u586b default \u53d1\u9001\u81f3zinc\u7684index"},{"location":"reference/pipelines/sink/zinc/#skipsslverify","title":"skipSSLVerify","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 skipSSLVerify bool \u975e\u5fc5\u586b true \u662f\u5426\u5ffd\u7565SSL\u6821\u9a8c"},{"location":"reference/pipelines/source/dev/","title":"dev","text":"

    \u7528\u4e8e\u5f00\u53d1\u6216\u8005\u538b\u6d4b\u573a\u666f\u4e0b\uff0c\u81ea\u52a8\u751f\u6210\u6570\u636e\u3002

    Example

    sources:\n- type: dev\nname: benchmark\nqps: 100\nbyteSize: 1024\neventsTotal: 10000\n
    "},{"location":"reference/pipelines/source/dev/#qps","title":"qps","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 qps int \u975e\u5fc5\u586b 1000 \u751f\u6210event\u7684QPS"},{"location":"reference/pipelines/source/dev/#bytesize","title":"byteSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 byteSize int \u975e\u5fc5\u586b 1024 \u5355\u6761event\u7684\u5b57\u8282\u6570"},{"location":"reference/pipelines/source/dev/#eventstotal","title":"eventsTotal","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 eventsTotal int \u975e\u5fc5\u586b -1\uff0c\u65e0\u9650\u4e2a \u53d1\u9001\u7684\u6240\u6709event\u603b\u6570\uff0c\u4e4b\u540e\u4f1a\u505c\u6b62\u53d1\u9001"},{"location":"reference/pipelines/source/elasticsearch/","title":"elasticsearch","text":"

    \u6d88\u8d39elasticsearch\u7684\u6570\u636e\u3002

    Example

    \u5e38\u89c4\u9ad8\u7ea7
    pipelines:\n- name: local\nsources:\n- type: elasticsearch\nname: elastic\nhosts: [\"localhost:9200\"]\nindices: [\"blog*\"]\nsize: 10 # data size per fetch\ninterval: 30s # pull data frequency\n
    pipelines:\n- name: local\nsources:\n- type: elasticsearch\nname: elastic\nhosts:\n- \"localhost:9200\"\n- \"localhost:9201\"\nindices: [\"blog*\"]\nusername: \"bob\"\npassword: \"bob\"\nschema: \"\"\nsniff: false\ngzip: true\nincludeFields: # pull selected field\n- Title\n- Content\n- Author\nexcludeFields: # exclude selected field\n- Content\nquery: | # elastic query phrases\n{\n\"match\": {\"Title\": \"bob\"}\n}\nsize: 10 # data size per fetch\ninterval: 30s # pull data frequency\ntimeout: 5s # pull timeout\ndb: flushTimeout: 2s # persistent the elastic pull location frequency\ncleanInactiveTimeout: 24h # delete the db record after the time\ncleanScanInterval: 1h # check the expired db record frequency\n
    "},{"location":"reference/pipelines/source/elasticsearch/#hosts","title":"hosts","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 hosts string\u6570\u7ec4 \u5fc5\u586b \u6d88\u8d39\u7684elasticsearch url\u5730\u5740"},{"location":"reference/pipelines/source/elasticsearch/#indices","title":"indices","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 index string\u6570\u7ec4 \u5fc5\u586b \u67e5\u8be2elasticsearch\u7684index\u540d\u79f0"},{"location":"reference/pipelines/source/elasticsearch/#username","title":"username","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 username string \u975e\u5fc5\u586b \u6d88\u8d39elasticsearch\u7684\u7528\u6237\u540d"},{"location":"reference/pipelines/source/elasticsearch/#password","title":"password","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 password string \u5fc5\u586b \u6d88\u8d39elasticsearch\u7684\u5bc6\u7801"},{"location":"reference/pipelines/source/elasticsearch/#schema","title":"schema","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 schema string \u975e\u5fc5\u586b http HTTP scheme(http/https)\uff0csniff\u7684\u65f6\u5019\u4f7f\u7528"},{"location":"reference/pipelines/source/elasticsearch/#gzip","title":"gzip","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 gzip bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542fgzip\u538b\u7f29"},{"location":"reference/pipelines/source/elasticsearch/#includefields","title":"includeFields","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 includeFields string\u6570\u7ec4 \u975e\u5fc5\u586b \u53ea\u8fd4\u56de\u6307\u5b9a\u7684_source\u5b57\u6bb5"},{"location":"reference/pipelines/source/elasticsearch/#excludefields","title":"excludeFields","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 excludeFields string\u6570\u7ec4 \u975e\u5fc5\u586b \u6392\u9664\u6307\u5b9a\u7684_source\u5b57\u6bb5"},{"location":"reference/pipelines/source/elasticsearch/#query","title":"query","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 query string \u975e\u5fc5\u586b \u67e5\u8be2elasticsearch\u7684\u8868\u8fbe\u5f0f"},{"location":"reference/pipelines/source/elasticsearch/#size","title":"size","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 size int \u975e\u5fc5\u586b 100 \u6bcf\u6b21\u8bf7\u6c42\u5f97\u5230hits\u8fd4\u56de\u7684\u4e2a\u6570"},{"location":"reference/pipelines/source/elasticsearch/#sortby","title":"sortBy","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sortBy \u5fc5\u586b \u6570\u7ec4 \u7528\u4e8e\u67e5\u8be2\u7684\u6392\u5e8f sortBy.fields string \u5fc5\u586b \u6392\u5e8f\u7684\u5b57\u6bb5 sortBy.ascending bool \u975e\u5fc5\u586b true \u662f\u5426\u6309\u7167\u5347\u5e8f\u6392\u5e8f

    Example

            sortBy:\n        - fields: \"@timestamp\"\n          ascending: true\n        - fields: \"_id\"\n          ascending: true\n
    "},{"location":"reference/pipelines/source/elasticsearch/#interval","title":"interval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 interval time.Duration \u975e\u5fc5\u586b 30s \u5b9a\u65f6\u8bf7\u6c42elasticsearch\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/source/elasticsearch/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 5s \u8bf7\u6c42\u7684\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/source/elasticsearch/#db","title":"db","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 db \u975e\u5fc5\u586b \u6301\u4e45\u5316\u8bb0\u5f55\u67e5\u8be2elasticsearch\u8bf7\u6c42\u7684\u8fdb\u5ea6\uff0c\u4f1a\u5b58\u50a8\u81f3elasticsearch\u4e2d\uff0c\u907f\u514dLoggie\u91cd\u542f\u540e\u91cd\u590d\u6d88\u8d39\u6570\u636e db.indexPrefix string \u975e\u5fc5\u586b .loggie-db \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cloggie\u4f1a\u5c06\u6301\u4e45\u5316\u7684\u6570\u636e\u5b9a\u65f6\u5199\u5165\u683c\u5f0f\u4e3a${indexPrefix}-${pipelineName}-${sourceName}\u7684index\u4e2d db.flushTimeout time.Duration \u975e\u5fc5\u586b 2s \u6301\u4e45\u5316\u6570\u636e\u5199\u5165\u7684\u95f4\u9694\u65f6\u95f4 db.cleanInactiveTimeout time.Duration \u975e\u5fc5\u586b 504h (21day) \u6e05\u7406\u8fc7\u671f\u7684\u6301\u4e45\u5316\u6570\u636e\u8d85\u65f6\u65f6\u95f4 db.cleanScanInterval time.Duration \u975e\u5fc5\u586b 1h \u68c0\u67e5\u8fc7\u671f\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/source/file/","title":"file","text":"

    file source\u7528\u4e8e\u65e5\u5fd7\u91c7\u96c6\u3002

    Example

    sources:\n- type: file\nname: accesslog\n

    Tips

    \u5982\u679c\u4f60\u4f7f\u7528logconfig/clusterlogconfig\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff0cfile source\u91cc\u8fd8\u589e\u52a0\u4e86\u989d\u5916\u7684\u5b57\u6bb5\uff0c\u8bf7\u53c2\u8003\u8fd9\u91cc\u3002

    "},{"location":"reference/pipelines/source/file/#paths","title":"paths","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 paths string\u6570\u7ec4 \u5fc5\u586b \u65e0 \u91c7\u96c6\u7684path\u8def\u5f84\uff0c\u4f7f\u7528glob\u8868\u8fbe\u5f0f\u6765\u5339\u914d\u3002\u652f\u6301glob\u6269\u5c55\u8868\u8fbe\u5f0fBrace Expansion\u548cGlob Star

    Example

    \u9700\u8981\u91c7\u96c6\u7684\u76ee\u6807\u6587\u4ef6\uff1a

    /tmp/loggie/service/order/access.log\n/tmp/loggie/service/order/access.log.2022-04-11\n/tmp/loggie/service/pay/access.log\n/tmp/loggie/service/pay/access.log.2022-04-11\n

    \u5bf9\u5e94\u914d\u7f6e\uff1a

    sources:\n- type: file\npaths:\n- /tmp/loggie/**/access.log{,.[2-9][0-9][0-9][0-9]-[01][0-9]-[0123][0-9]}\n

    "},{"location":"reference/pipelines/source/file/#excludefiles","title":"excludeFiles","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 excludeFiles string\u6570\u7ec4 \u975e\u5fc5\u586b \u65e0 \u6392\u9664\u91c7\u96c6\u7684\u6587\u4ef6\u6b63\u5219\u8868\u8fbe\u5f0f

    Example

    sources:\n- type: file\npaths:\n- /tmp/*.log\nexcludeFiles:\n- \\.gz$\n
    "},{"location":"reference/pipelines/source/file/#ignoreolder","title":"ignoreOlder","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ignoreOlder time.Duration \u975e\u5fc5\u586b \u65e0 \u4f8b\u598248h\uff0c\u8868\u793a\u5ffd\u7565\u66f4\u65b0\u65f6\u95f4\u57282\u5929\u4e4b\u524d\u7684\u6587\u4ef6\uff0c\u65e0\u9700\u8fdb\u884c\u91c7\u96c6"},{"location":"reference/pipelines/source/file/#addonmeta","title":"addonMeta","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addonMeta bool \u975e\u5fc5\u586b false \u662f\u5426\u6dfb\u52a0\u9ed8\u8ba4\u7684\u65e5\u5fd7\u91c7\u96c6state\u5143\u4fe1\u606f

    event\u793a\u4f8b

    {\n\"body\": \"this is test\",\n\"state\": {\n\"pipeline\": \"local\",\n\"source\": \"demo\",\n\"filename\": \"/var/log/a.log\",\n\"timestamp\": \"2006-01-02T15:04:05.000Z\",\n\"offset\": 1024,\n\"bytes\": 4096,\n\"hostname\": \"node-1\"\n}\n}\n

    state\u542b\u4e49\u89e3\u91ca\uff1a

    "},{"location":"reference/pipelines/source/file/#multi","title":"multi","text":"

    \u591a\u884c\u91c7\u96c6\u76f8\u5173\u914d\u7f6e

    Example

    sources:\n- type: file\nname: accesslog\nmulti:\nactive: true\npattern: '^\\d{4}-\\d{2}-\\d{2}'\n
    "},{"location":"reference/pipelines/source/file/#active","title":"active","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 active bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u591a\u884c\u91c7\u96c6\u6a21\u5f0f"},{"location":"reference/pipelines/source/file/#pattern","title":"pattern","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 pattern string \u5f53multi.active=true\u7684\u65f6\u5019\u5fc5\u586b false \u5224\u65ad\u4e3a\u4e00\u6761\u5168\u65b0\u65e5\u5fd7\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u3002\u4f8b\u5982\u914d\u7f6e\u4e3a'^\\['\uff0c\u5219\u8ba4\u4e3a\u884c\u9996\u4ee5[\u5f00\u5934\u624d\u662f\u4e00\u6761\u65b0\u65e5\u5fd7\uff0c\u5426\u5219\u5c06\u8fd9\u884c\u5185\u5bb9\u5408\u5165\u4e0a\u4e00\u6761\u65e5\u5fd7\u4f5c\u4e3a\u4e0a\u4e00\u6761\u65e5\u5fd7\u7684\u4e00\u90e8\u5206

    Example

    \u5047\u8bbe\u6709\u591a\u884c\u65e5\u5fd7\u5982\u4e0b\u6240\u793a\uff1a

    2023-05-11 14:30:15 ERROR Exception in thread \"main\" java.lang.NullPointerException\n     at com.example.MyClass.myMethod(MyClass.java:25)\n     at com.example.MyClass.main(MyClass.java:10)\n
    \u914d\u7f6epattern\u6b63\u5219\uff1a^\\d{4}-\\d{2}-\\d{2} \u4f1a\u5c06\u65e5\u5fd7\u53d8\u6210\u4e00\u884c\u3002\u8fd9\u6837\u5728\u65e5\u5fd7\u67e5\u8be2\u7684\u65f6\u5019\uff0c\u4e0d\u4f1a\u4ea7\u751f\u4e0a\u9762\u7684\u591a\u884c\u5f02\u5e38\u65e5\u5fd7\u5806\u6808\u4e71\u5e8f\u7b49\u95ee\u9898\u3002

    "},{"location":"reference/pipelines/source/file/#maxlines","title":"maxLines","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxLines int \u975e\u5fc5\u586b 500 1\u6761\u65e5\u5fd7\u6700\u591a\u5305\u542b\u51e0\u884c\u5185\u5bb9\u3002\u9ed8\u8ba4500\u884c\uff0c\u8d85\u8fc7\u4e0a\u9650\u5c06\u5f3a\u5236\u53d1\u9001\u5f53\u524d\u65e5\u5fd7\uff0c\u8d85\u51fa\u90e8\u5206\u4f5c\u4e3a\u65b0\u7684\u4e00\u6761\u65e5\u5fd7"},{"location":"reference/pipelines/source/file/#maxbytes","title":"maxBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxBytes int64 \u975e\u5fc5\u586b 131072 1\u6761\u65e5\u5fd7\u6700\u591a\u5305\u542b\u51e0\u4e2a\u5b57\u8282\u3002\u9ed8\u8ba4128K\uff0c\u8d85\u8fc7\u4e0a\u9650\u5c06\u5f3a\u5236\u53d1\u9001\u5f53\u524d\u65e5\u5fd7\uff0c\u8d85\u51fa\u90e8\u5206\u4f5c\u4e3a\u65b0\u7684\u4e00\u6761\u65e5\u5fd7"},{"location":"reference/pipelines/source/file/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 5s 1\u6761\u65e5\u5fd7\u6700\u591a\u7b49\u5f85\u591a\u4e45\u91c7\u96c6\u4e3a\u5b8c\u6574\u76841\u6761\u65e5\u5fd7\u3002\u9ed8\u8ba45s\uff0c\u8d85\u8fc7\u4e0a\u9650\u5c06\u5f3a\u5236\u53d1\u9001\u5f53\u524d\u65e5\u5fd7\uff0c\u8d85\u51fa\u90e8\u5206\u4f5c\u4e3a\u65b0\u7684\u4e00\u6761\u65e5\u5fd7"},{"location":"reference/pipelines/source/file/#readfromtail","title":"readFromTail","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 readFromTail bool \u975e\u5fc5\u586b false \u662f\u5426\u4ece\u6587\u4ef6\u7684\u6700\u65b0\u4e00\u884c\u5f00\u59cb\u91c7\u96c6\uff0c\u800c\u4e0d\u7ba1\u5386\u53f2\u5199\u5165\u5230\u6587\u4ef6\u7684\u5185\u5bb9\u3002\u9002\u7528\u4e8e\u91c7\u96c6\u7cfb\u7edf\u7684\u8fc1\u79fb\u7b49\u573a\u666f"},{"location":"reference/pipelines/source/file/#cleanfiles","title":"cleanFiles","text":"

    \u6e05\u7406\u6587\u4ef6\u76f8\u5173\u914d\u7f6e\u3002\u8fc7\u671f\u4e14\u5df2\u7ecf\u91c7\u96c6\u5b8c\u6210\u7684\u6587\u4ef6\u5c06\u4f1a\u76f4\u63a5\u4ece\u78c1\u76d8\u5220\u9664\u4ee5\u91ca\u653e\u78c1\u76d8\u7a7a\u95f4

    "},{"location":"reference/pipelines/source/file/#maxhistorydays","title":"maxHistoryDays","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxHistoryDays int \u975e\u5fc5\u586b \u65e0 \uff08\u91c7\u96c6\u5b8c\u6210\u540e\u7684\uff09\u6587\u4ef6\u6700\u591a\u4fdd\u7559\u7684\u5929\u6570\u3002\u5982\u679c\u8d85\u51fa\u9650\u5236\uff0c\u5c06\u4f1a\u628a\u6587\u4ef6\u76f4\u63a5\u4ece\u78c1\u76d8\u4e2d\u5220\u9664\u3002\u4e0d\u914d\u7f6e\u5219\u6c38\u8fdc\u4e0d\u4f1a\u5220\u9664\u6587\u4ef6"},{"location":"reference/pipelines/source/file/#cleanunfinished","title":"cleanUnfinished","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cleanUnfinished bool \u975e\u5fc5\u586b false \u5373\u4f7f\u6587\u4ef6\u6ca1\u6709\u88ab\u91c7\u96c6\u5b8c\uff0c\u4f9d\u7136\u4f1a\u88ab\u6e05\u7406"},{"location":"reference/pipelines/source/file/#fdholdtimeoutwheninactive","title":"fdHoldTimeoutWhenInactive","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fdHoldTimeoutWhenInactive time.Duration \u975e\u5fc5\u586b 5m \u5f53\u6587\u4ef6\u7684\u4e0a\u6b21\u91c7\u96c6\u5230\u73b0\u5728\u7684\u65f6\u95f4\u8d85\u8fc7\u9650\u5236\uff08\u6587\u4ef6\u957f\u65f6\u95f4\u6ca1\u6709\u5199\u5165\uff0c\u8ba4\u4e3a\u5927\u6982\u7387\u4e0d\u4f1a\u518d\u5199\u5165\u5185\u5bb9\uff09\uff0c\u5c06\u4f1a\u91ca\u653e\u8be5\u6587\u4ef6\u7684\u6587\u4ef6\u53e5\u67c4\u4ee5\u91ca\u653e\u7cfb\u7edf\u8d44\u6e90"},{"location":"reference/pipelines/source/file/#fdholdtimeoutwhenremove","title":"fdHoldTimeoutWhenRemove","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fdHoldTimeoutWhenRemove time.Duration \u975e\u5fc5\u586b 5m \u5f53\u6587\u4ef6\u88ab\u5220\u9664\u4e14\u672a\u91c7\u96c6\u5b8c\u6210\uff0c\u4f1a\u7b49\u5f85\u7684\u6700\u5927\u65f6\u95f4\u6765\u91c7\u96c6\u5b8c\u6210\u3002\u8d85\u8fc7\u9650\u5236\u4e0d\u7ba1\u6587\u4ef6\u6700\u7ec8\u662f\u5426\u91c7\u96c6\u5b8c\u6210\uff0c\u90fd\u4f1a\u76f4\u63a5\u91ca\u653e\u6587\u4ef6\u53e5\u67c4\u4e0d\u518d\u91c7\u96c6"},{"location":"reference/pipelines/source/file/#workercount","title":"workerCount","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 workerCount int \u975e\u5fc5\u586b 1 \u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u7684\u5de5\u4f5c\u7ebf\u7a0b(goroutine)\u6570\u3002\u5355\u8282\u70b9\u8d85\u8fc7100\u4e2a\u6587\u4ef6\u7684\u65f6\u5019\u8003\u8651\u63d0\u9ad8"},{"location":"reference/pipelines/source/file/#readbuffersize","title":"readBufferSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 readBufferSize int \u975e\u5fc5\u586b 65536 \u5355\u6b21\u8bfb\u53d6\u6587\u4ef6\u7684\u6570\u636e\u91cf\u3002\u9ed8\u8ba464K=65536"},{"location":"reference/pipelines/source/file/#maxcontinueread","title":"maxContinueRead","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxContinueRead int \u975e\u5fc5\u586b 16 \u8fde\u7eed\u8bfb\u53d6\u540c\u4e00\u4e2a\u6587\u4ef6\u5185\u5bb9\u7684\u6b21\u6570\uff0c\u8fbe\u5230\u8fd9\u4e2a\u6b21\u6570\u5c06\u5f3a\u5236\u5207\u6362\u5230\u4e0b\u4e2a\u6587\u4ef6\u8bfb\u53d6\u3002\u4e3b\u8981\u4f5c\u7528\u662f\u7528\u6765\u907f\u514d\u6d3b\u8dc3\u6587\u4ef6\u4e00\u76f4\u5360\u636e\u8bfb\u53d6\u8d44\u6e90\uff0c\u975e\u6d3b\u8dc3\u6587\u4ef6\u957f\u65f6\u95f4\u5f97\u4e0d\u5230\u8bfb\u53d6\u91c7\u96c6"},{"location":"reference/pipelines/source/file/#maxcontinuereadtimeout","title":"maxContinueReadTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxContinueReadTimeout time.Duration \u975e\u5fc5\u586b 3s \u540c\u4e00\u4e2a\u6587\u4ef6\u6700\u957f\u8bfb\u53d6\u65f6\u95f4\uff0c\u8d85\u8fc7\u8fd9\u4e2a\u65f6\u95f4\u5c06\u5f3a\u5236\u5207\u6362\u4e0b\u4e2a\u6587\u4ef6\u8bfb\u53d6\u3002\u4f5c\u7528\u4e0emaxContinueRead\u7c7b\u4f3c"},{"location":"reference/pipelines/source/file/#inactivetimeout","title":"inactiveTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 inactiveTimeout time.Duration \u975e\u5fc5\u586b 3s \u5982\u679c\u5f53\u6587\u4ef6\u4ece\u4e0a\u4e00\u6b21\u91c7\u96c6\u5230\u73b0\u5728\u8d85\u8fc7inactiveTimeout\u7684\u8bdd\uff0c\u5219\u8ba4\u4e3a\u6587\u4ef6\u8fdb\u5165\u4e0d\u6d3b\u8dc3\u72b6\u6001(\u5373\u6700\u540e\u4e00\u6761\u65e5\u5fd7\u5df2\u7ecf\u5199\u5165\u5b8c\u6210)\uff0c\u5219\u53ef\u4ee5\u5b89\u5168\u7684\u91c7\u96c6\u6700\u540e\u4e00\u884c\u65e5\u5fd7"},{"location":"reference/pipelines/source/file/#ignoresymlink","title":"ignoreSymlink","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 ignoreSymlink bool \u975e\u5fc5\u586b false \u662f\u5426\u5ffd\u7565\u7b26\u53f7\u94fe\u63a5\uff08\u8f6f\u94fe\u63a5\uff09\u7684\u6587\u4ef6"},{"location":"reference/pipelines/source/file/#firstnbytesforidentifier","title":"firstNBytesForIdentifier","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 firstNBytesForIdentifier int \u975e\u5fc5\u586b 128 \u4f7f\u7528\u91c7\u96c6\u76ee\u6807\u6587\u4ef6\u7684\u524dn\u4e2a\u5b57\u7b26\u6765\u751f\u6210\u6587\u4ef6\u552f\u4e00code\u3002\u5982\u679c\u6587\u4ef6\u7684\u5927\u5c0f\u5c0f\u4e8en\uff0c\u5219\u8be5\u6587\u4ef6\u6682\u65f6\u4e0d\u4f1a\u91c7\u96c6\u3002\u7528\u9014\u4e3b\u8981\u662f\uff0c\u7ed3\u5408\u6587\u4ef6inode\u4fe1\u606f\uff0c\u7528\u6765\u7cbe\u786e\u6807\u8bc6\u4e00\u4e2a\u6587\u4ef6\u3002\u8f85\u52a9\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5220\u9664\u6216\u8005\u662f\u6539\u540d"},{"location":"reference/pipelines/source/file/#charset","title":"charset","text":"

    \u7f16\u7801\u8f6c\u6362\uff0c\u7528\u4e8e\u5c06\u4e0d\u540c\u7684\u7f16\u7801\u8f6c\u6362\u4e3autf8\uff0c\u5f53\u4e0b\u652f\u6301\u7684\u7f16\u7801\u8f6c\u6362\u683c\u5f0f.

    Example

        sources:\n- type: file\nname: demo\npaths:\n- /tmp/log/*.log\nfields:\ntopic: \"loggie\"\ncharset: \"gbk\"\n
    \u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 charset string \u5426 utf-8 \u63d0\u53d6\u5b57\u6bb5\u7684\u5339\u914d\u6a21\u578b

    \u5f53\u524d\u652f\u6301\u7684\u8f6c\u6362\u4e3autf-8\u7684\u7f16\u7801\u683c\u5f0f\u6709

    "},{"location":"reference/pipelines/source/file/#linedelimiter","title":"lineDelimiter","text":"

    \u6362\u884c\u7b26\u76f8\u5173\u914d\u7f6e

    Example

    sources:\n- type: file\nname: demo\nlineDelimiter:\ntype: carriage_return_line_feed\nvalue: \"\\r\\n\"\ncharset: gbk\n
    "},{"location":"reference/pipelines/source/file/#type","title":"type","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 type bool \u975e\u5fc5\u586b auto \u53ea\u6709\u5728type\u662fcustome\u65f6\u5019value\u624d\u4f1a\u6709\u6548

    \u5f53\u524d\u652f\u6301\u7684type\u6709

    \u5bf9\u5e94\u7684\u6362\u884c\u7b26\u4e3a\uff1a

        ```\n        auto:                    {'\\u000A'},\n        line_feed:               {'\\u000A'},\n        vertical_tab:            {'\\u000B'},\n        form_feed:               {'\\u000C'},\n        carriage_return:         {'\\u000D'},\n        carriage_return_line_feed: []byte(\"\\u000D\\u000A\"),\n        next_line:               {'\\u0085'},\n        line_separator:          []byte(\"\\u2028\"),\n        paragraph_separator:     []byte(\"\\u2029\"),\n        null_terminator:         {'\\u0000'},\n    ```\n
    "},{"location":"reference/pipelines/source/file/#value","title":"value","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 value string \u975e\u5fc5\u586b \\n \u6362\u884c\u7b26\u7684\u5185\u5bb9"},{"location":"reference/pipelines/source/file/#charset_1","title":"charset","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 charset string \u975e\u5fc5\u586b utf-8 \u6362\u884c\u7b26\u7f16\u7801"},{"location":"reference/pipelines/source/file/#ack","title":"ack","text":"

    source\u7684\u786e\u8ba4\u673a\u5236\u76f8\u5173\u914d\u7f6e\u3002\u5982\u679c\u9700\u786e\u4fdd\u8981at least once\uff0c\u9700\u8981\u5f00\u542fack\u673a\u5236\uff0c\u4f46\u662f\u4f1a\u6709\u4e00\u5b9a\u6027\u80fd\u987a\u8017

    Caution

    \u8be5\u914d\u7f6e\u53ea\u80fd\u914d\u7f6e\u5728defaults\u4e2d

    Example

    defaults:\nsources:\n- type: file\nack:\nenable: true\n
    "},{"location":"reference/pipelines/source/file/#enable","title":"enable","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enable bool \u975e\u5fc5\u586b true \u662f\u5426\u5f00\u542f\u786e\u8ba4\u673a\u5236"},{"location":"reference/pipelines/source/file/#maintenanceinterval","title":"maintenanceInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maintenanceInterval time.Duration \u975e\u5fc5\u586b 20h \u7ef4\u62a4\u5468\u671f\u3002\u7528\u6765\u5b9a\u65f6\u6e05\u7406\u8fc7\u671f\u7684\u786e\u8ba4\u6587\u4ef6\u6570\u636e(\u4f8b\u5982\u4e0d\u518d\u91c7\u96c6\u7684\u6587\u4ef6\u7684ack\u4fe1\u606f)"},{"location":"reference/pipelines/source/file/#watcher","title":"watcher","text":"

    \u76d1\u63a7\u6587\u4ef6\u53d8\u5316\u7684\u76f8\u5173\u914d\u7f6e

    Caution

    \u8be5\u914d\u7f6e\u53ea\u80fd\u914d\u7f6e\u5728defaults\u4e2d

    Example

    defaults:\nsources:\n- type: file\nwatcher:\nmaxOpenFds: 8000\n
    "},{"location":"reference/pipelines/source/file/#scantimeinterval","title":"scanTimeInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 scanTimeInterval time.Duration \u975e\u5fc5\u586b 10s \u5468\u671f\u6027\u7684\u68c0\u67e5\u6587\u4ef6\u7684\u72b6\u6001\u53d8\u66f4\uff08\u4f8b\u5982\u6587\u4ef6\u7684\u65b0\u5efa\u3001\u5220\u9664\u7b49\uff09\u3002\u9ed8\u8ba4\u6bcf\u969410s\u68c0\u67e5\u4e00\u6b21"},{"location":"reference/pipelines/source/file/#maintenanceinterval_1","title":"maintenanceInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maintenanceInterval time.Duration \u975e\u5fc5\u586b 5m \u5468\u671f\u6027\u7684\u7ef4\u62a4\u5de5\u4f5c\uff08\u4f8b\u5982\u4e0a\u62a5\u91c7\u96c6\u7edf\u8ba1\u4fe1\u606f\u3001\u6e05\u7406\u6587\u4ef6\u7b49\uff09"},{"location":"reference/pipelines/source/file/#maxopenfds","title":"maxOpenFds","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxOpenFds int \u975e\u5fc5\u586b 4096 \u6700\u5927\u6253\u5f00\u7684\u6587\u4ef6\u53e5\u67c4\u6570\u91cf\uff0c\u8d85\u51fa\u540e\u7684\u6587\u4ef6\u5c06\u6682\u65f6\u4e0d\u4f1a\u91c7\u96c6"},{"location":"reference/pipelines/source/file/#maxeofcount","title":"maxEofCount","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxEofCount int \u975e\u5fc5\u586b 3 \u6700\u5927\u8fde\u7eed\u8bfb\u53d6\u6587\u4ef6\u9047\u5230eof\u7684\u6b21\u6570\u3002\u8d85\u8fc7\u9650\u5236\u8ba4\u4e3a\u6587\u4ef6\u6682\u65f6\u4e0d\u6d3b\u8dc3\uff0c\u5c06\u8fdb\u5165\u201c\u50f5\u5c38\u201d\u961f\u5217\u7b49\u5f85\u66f4\u65b0\u4e8b\u4ef6\u88ab\u6fc0\u6d3b"},{"location":"reference/pipelines/source/file/#cleanwhenremoved","title":"cleanWhenRemoved","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 cleanWhenRemoved bool \u975e\u5fc5\u586b true \u5f53\u6587\u4ef6\u88ab\u5220\u9664\u540e\uff0c\u662f\u5426\u540c\u6b65\u5220\u9664db\u4e2d\u7684\u91c7\u96c6\u76f8\u5173\u4fe1\u606f"},{"location":"reference/pipelines/source/file/#taskstoptimeout","title":"taskStopTimeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 taskStopTimeout time.Duration \u975e\u5fc5\u586b 30s \u91c7\u96c6\u4efb\u52a1\u9000\u51fa\u7684\u8d85\u65f6\u65f6\u95f4\u3002\u662f\u4e00\u4e2a\u515c\u5e95\u65b9\u6848\uff0c\u653e\u5728\u91c7\u96c6\u4efb\u52a1\u5047\u6b7b\u5bfc\u81f4\u65e0\u6cd5reload"},{"location":"reference/pipelines/source/file/#db","title":"db","text":"

    v1.5\u7248\u672c\u53ca\u4ee5\u540e\u5df2\u5220\u9664\uff0c\u8bf7\u4f7f\u7528\u5168\u5c40\u914d\u7f6e\u7684db\u66ff\u6362\u3002

    "},{"location":"reference/pipelines/source/franzkafka/","title":"franz kafka","text":"

    \u4f7f\u7528franz-go kafka\u5e93\u6d88\u8d39Kafka\u3002

    \uff08\u672csink\u548ckafka sink\u7684\u533a\u522b\u4e00\u822c\u53ea\u5728\u4e8e\u4f7f\u7528\u7684kafka golang\u5e93\u4e0d\u540c\uff0c\u63d0\u4f9b\u7ed9\u5bf9franz kafka\u5e93\u6709\u504f\u597d\u7684\u7528\u6237\u4f7f\u7528\uff09

    Example

    sources:\n- type: kafka\nbrokers: [\"kafka1.kafka.svc:9092\"]\ntopic: log-*\n

    \u652f\u6301\u7684Kafka\u7248\u672c

    \u8be5kafka sink\u4f7f\u7528\u7684\u662fsegmentio/kafka-go\u5e93\u3002\u5f53\u524dLoggie\u4f7f\u7528\u7684\u5e93\u7248\u672c\u4e3av0.4.39\uff0c\u5bf9\u5e94\u7248\u672c\u6d4b\u8bd5\u652f\u6301\u7684Kafka\u7248\u672c\u4e3a\uff1a0.10.1.0 - 2.7.1

    "},{"location":"reference/pipelines/source/franzkafka/#brokers","title":"brokers","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 brokers string\u6570\u7ec4 \u5fc5\u586b \u65e0 Kafka broker\u5730\u5740"},{"location":"reference/pipelines/source/franzkafka/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u5fc5\u586b \u65e0 \u63a5\u6536\u7684topic\uff0c\u53ef\u4f7f\u7528\u6b63\u5219\u6765\u5339\u914d\u591a\u4e2atopic"},{"location":"reference/pipelines/source/franzkafka/#topics","title":"topics","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topics \u6570\u7ec4 \u5fc5\u586b \u65e0 \u63a5\u6536\u7684topics\uff0c\u53ef\u586b\u591a\u4e2atopic\uff0c\u6216\u8005\u4f7f\u7528\u6b63\u5219\u6765\u5339\u914d\u591a\u4e2atopic"},{"location":"reference/pipelines/source/franzkafka/#groupid","title":"groupId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 groupId string \u975e\u5fc5\u586b loggie Loggie\u6d88\u8d39kafka\u7684groupId"},{"location":"reference/pipelines/source/franzkafka/#clientid","title":"clientId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 clientId string \u975e\u5fc5\u586b loggie Loggie\u6d88\u8d39kafka\u7684clientId"},{"location":"reference/pipelines/source/franzkafka/#worker","title":"worker","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 worker int \u975e\u5fc5\u586b 1 Loggie\u6d88\u8d39Kafka\u7684worker\u7ebf\u7a0b\u4e2a\u6570"},{"location":"reference/pipelines/source/franzkafka/#addonmeta","title":"addonMeta","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addonMeta bool \u975e\u5fc5\u586b true \u662f\u5426\u589e\u52a0\u6d88\u8d39Kafka\u7684\u4e00\u4e9b\u5143\u4fe1\u606f

    \u589e\u52a0\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\u5305\u62ec\uff1a

    "},{"location":"reference/pipelines/source/franzkafka/#fetchmaxwait","title":"fetchMaxWait","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fetchMaxWait time.Duration \u975e\u5fc5\u586b 5s \u5728\u8fd4\u56de\u4e4b\u524d\u7b49\u5f85\u83b7\u53d6\u54cd\u5e94\u8fbe\u5230\u6240\u9700\u7684\u6700\u5c0f\u5b57\u8282\u6570\u7684\u6700\u5927\u65f6\u95f4"},{"location":"reference/pipelines/source/franzkafka/#fetchmaxbytes","title":"fetchMaxBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fetchMaxBytes int \u975e\u5fc5\u586b 50 << 20 \uff0850MiB\uff09 \u83b7\u53d6\u7684\u6700\u5927\u5b57\u8282\u6570\u91cf"},{"location":"reference/pipelines/source/franzkafka/#fetchminbytes","title":"fetchMinBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fetchMinBytes int \u975e\u5fc5\u586b 1 \u83b7\u53d6\u7684\u6700\u5c0f\u5b57\u8282\u6570\u91cf"},{"location":"reference/pipelines/source/franzkafka/#fetchmaxpartitionbytes","title":"fetchMaxPartitionBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fetchMaxPartitionBytes int \u975e\u5fc5\u586b 50 << 20 \uff0850MiB\uff09 \u4ece\u5355\u4e2a\u5206\u533a\u83b7\u53d6\u7684\u6700\u5927\u5b57\u8282\u6570\u91cf"},{"location":"reference/pipelines/source/franzkafka/#enableautocommit","title":"enableAutoCommit","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enableAutoCommit bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542f\u81ea\u52a8commit\u5230kafka"},{"location":"reference/pipelines/source/franzkafka/#autocommitinterval","title":"autoCommitInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 autoCommitInterval time.Duration \u975e\u5fc5\u586b 1s \u81ea\u52a8commit\u5230kafka\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/source/franzkafka/#autooffsetreset","title":"autoOffsetReset","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 autoOffsetReset string \u975e\u5fc5\u586b latest \u5982\u679c\u6ca1\u6709\u5bf9\u5e94\u7684offset\uff0c\u5219\u4e00\u5f00\u59cb\u4ece\u4ec0\u4e48\u5730\u65b9\u6d88\u8d39topic\u6570\u636e\uff0c\u53ef\u4e3a\uff1alatest\u6216\u8005earliest"},{"location":"reference/pipelines/source/franzkafka/#sasl","title":"sasl","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sasl \u975e\u5fc5\u586b SASL authentication sasl.enabled bool \u975e\u5fc5\u586b false \u662f\u5426\u542f\u7528 sasl.mechanism string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1aPLAIN\u3001SCRAM-SHA-256\u3001SCRAM-SHA-512\u3001GSSAPI sasl.username string \u5fc5\u586b \u7528\u6237\u540d sasl.password string \u5fc5\u586b \u5bc6\u7801"},{"location":"reference/pipelines/source/franzkafka/#gssapi","title":"gssapi","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sasl.gssapi \u975e\u5fc5\u586b SASL authentication sasl.gssapi.authType string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1a1 \u4f7f\u7528\u8d26\u53f7\u5bc6\u7801\u30012 \u4f7f\u7528keytab sasl.gssapi.keyTabPath string \u5fc5\u586b keytab \u6587\u4ef6\u8def\u5f84 sasl.gssapi.kerberosConfigPath string \u5fc5\u586b kerbeos \u6587\u4ef6\u8def\u5f84 sasl.gssapi.serviceName string \u5fc5\u586b \u670d\u52a1\u540d\u79f0 sasl.gssapi.userName string \u5fc5\u586b \u7528\u6237\u540d sasl.gssapi.password string \u5fc5\u586b \u5bc6\u7801 sasl.gssapi.realm string \u5fc5\u586b \u9886\u57df sasl.gssapi.disablePAFXFAST bool type=scram\u65f6\u5fc5\u586b DisablePAFXFAST \u7528\u4e8e\u5c06\u5ba2\u6237\u7aef\u914d\u7f6e\u4e3a\u4e0d\u4f7f\u7528 PA_FX_FAST"},{"location":"reference/pipelines/source/grpc/","title":"grpc","text":"

    Grpc source\u7528\u4e8e\u63a5\u6536Loggie Grpc\u683c\u5f0f\u7684\u6570\u636e\u8bf7\u6c42\u3002 \u4e00\u822c\u7528\u5728\u4e2d\u8f6c\u673a\u573a\u666f\uff0c\u63a5\u6536\u5176\u4ed6Loggie\u96c6\u7fa4\u53d1\u9001\u7684\u65e5\u5fd7\u3002

    Example

    sources:\n- type: grpc\nname: aggre\nport: 6066\n
    "},{"location":"reference/pipelines/source/grpc/#bind","title":"bind","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 bind string \u975e\u5fc5\u586b 0.0.0.0 \u63d0\u4f9bserver\u7ed1\u5b9a\u7684host"},{"location":"reference/pipelines/source/grpc/#port","title":"port","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 port string \u975e\u5fc5\u586b 6066 \u63d0\u4f9b\u670d\u52a1\u7684\u7aef\u53e3\u53f7"},{"location":"reference/pipelines/source/grpc/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 20s \u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/source/kafka/","title":"kafka","text":"

    Kafka source\u7528\u4e8e\u63a5\u6536Kafka\u6570\u636e\u3002

    Example

    sources:\n- type: kafka\nbrokers: [\"kafka1.kafka.svc:9092\"]\ntopic: log-*\n

    \u652f\u6301\u7684Kafka\u7248\u672c

    \u8be5kafka sink\u4f7f\u7528\u7684\u662fsegmentio/kafka-go\u5e93\u3002\u5f53\u524dLoggie\u4f7f\u7528\u7684\u5e93\u7248\u672c\u4e3av0.4.39\uff0c\u5bf9\u5e94\u7248\u672c\u6d4b\u8bd5\u652f\u6301\u7684Kafka\u7248\u672c\u4e3a\uff1a0.10.1.0 - 2.7.1

    "},{"location":"reference/pipelines/source/kafka/#brokers","title":"brokers","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 brokers string\u6570\u7ec4 \u5fc5\u586b \u65e0 Kafka broker\u5730\u5740"},{"location":"reference/pipelines/source/kafka/#topic","title":"topic","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topic string \u5fc5\u586b \u65e0 \u63a5\u6536\u7684topic\uff0c\u53ef\u4f7f\u7528\u6b63\u5219\u6765\u5339\u914d\u591a\u4e2atopic"},{"location":"reference/pipelines/source/kafka/#topics","title":"topics","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 topics \u6570\u7ec4 \u5fc5\u586b \u65e0 \u63a5\u6536\u7684topics\uff0c\u53ef\u586b\u591a\u4e2atopic\uff0c\u6216\u8005\u4f7f\u7528\u6b63\u5219\u6765\u5339\u914d\u591a\u4e2atopic"},{"location":"reference/pipelines/source/kafka/#groupid","title":"groupId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 groupId string \u975e\u5fc5\u586b loggie Loggie\u6d88\u8d39kafka\u7684groupId"},{"location":"reference/pipelines/source/kafka/#clientid","title":"clientId","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 clientId string \u975e\u5fc5\u586b loggie Loggie\u6d88\u8d39kafka\u7684clientId"},{"location":"reference/pipelines/source/kafka/#worker","title":"worker","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 worker int \u975e\u5fc5\u586b 1 Loggie\u6d88\u8d39Kafka\u7684worker\u7ebf\u7a0b\u4e2a\u6570"},{"location":"reference/pipelines/source/kafka/#addonmeta","title":"addonMeta","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 addonMeta bool \u975e\u5fc5\u586b true \u662f\u5426\u589e\u52a0\u6d88\u8d39Kafka\u7684\u4e00\u4e9b\u5143\u4fe1\u606f

    \u589e\u52a0\u7684\u5143\u4fe1\u606f\u5b57\u6bb5\u5305\u62ec\uff1a

    "},{"location":"reference/pipelines/source/kafka/#queuecapacity","title":"queueCapacity","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 queueCapacity int \u975e\u5fc5\u586b 100 \u5185\u90e8\u53d1\u9001\u7684\u961f\u5217\u5bb9\u91cf"},{"location":"reference/pipelines/source/kafka/#minacceptedbytes","title":"minAcceptedBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 minAcceptedBytes int \u975e\u5fc5\u586b 1 \u6700\u5c0f\u63a5\u6536\u7684batch\u5b57\u8282\u6570"},{"location":"reference/pipelines/source/kafka/#maxacceptedbytes","title":"maxAcceptedBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxAcceptedBytes int \u975e\u5fc5\u586b 1e6\uff081MB) \u6700\u5927\u63a5\u6536\u7684\u6d88\u606f\u5b57\u8282\u6570\uff0c\u5982\u679c\u8d85\u8fc7\u4f1a\u88abtruncate\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e3a\u4e00\u4e2a\u80fd\u5bb9\u5fcd\u7684\u8f83\u5927\u7684\u503c"},{"location":"reference/pipelines/source/kafka/#readmaxattempts","title":"readMaxAttempts","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 readMaxAttempts int \u975e\u5fc5\u586b 3 \u6700\u5927\u7684\u91cd\u8bd5\u6b21\u6570"},{"location":"reference/pipelines/source/kafka/#maxpollwait","title":"maxPollWait","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxPollWait time.Duration \u975e\u5fc5\u586b 10s \u63a5\u6536\u7684\u6700\u957f\u7b49\u5f85\u65f6\u95f4"},{"location":"reference/pipelines/source/kafka/#readbackoffmin","title":"readBackoffMin","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 readBackoffMin time.Duration \u975e\u5fc5\u586b 100ms \u5728\u63a5\u6536\u65b0\u7684\u6d88\u606f\u524d\uff0c\u6700\u5c0f\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/source/kafka/#readbackoffmax","title":"readBackoffMax","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 readBackoffMax time.Duration \u975e\u5fc5\u586b 1s \u5728\u63a5\u6536\u65b0\u7684\u6d88\u606f\u524d\uff0c\u6700\u5927\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/source/kafka/#enableautocommit","title":"enableAutoCommit","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enableAutoCommit bool \u975e\u5fc5\u586b false \u662f\u5426\u5f00\u542fautoCommit"},{"location":"reference/pipelines/source/kafka/#autocommitinterval","title":"autoCommitInterval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 autoCommitInterval time.Duration \u975e\u5fc5\u586b 1s autoCommit\u7684\u95f4\u9694\u65f6\u95f4"},{"location":"reference/pipelines/source/kafka/#autooffsetreset","title":"autoOffsetReset","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 autoOffsetReset string \u975e\u5fc5\u586b latest \u6ca1\u6709offset\u65f6\uff0c\u521d\u59cb\u7684offset\u91c7\u7528\u65b9\u5f0f\uff0c\u53ef\u4e3aearliest\u548clatest"},{"location":"reference/pipelines/source/kafka/#sasl","title":"sasl","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 sasl \u975e\u5fc5\u586b SASL authentication sasl.type string \u5fc5\u586b SASL\u7c7b\u578b\uff0c\u53ef\u4e3a\uff1aplain\u3001scram sasl.usename string \u5fc5\u586b \u7528\u6237\u540d\uff0c\u8bf7\u6ce8\u610f\u5728v1.4\u548c\u4e4b\u524d\u4f7f\u7528\u7684\u540d\u79f0\u4e3auserName\uff0c\u5f53\u7136\u540e\u7eed\u7248\u672c\u4e5f\u5bf9\u6b64\u8fdb\u884c\u4e86\u517c\u5bb9 sasl.password string \u5fc5\u586b \u5bc6\u7801 sasl.algorithm string type=scram\u65f6\u5fc5\u586b type=scram\u65f6\u4f7f\u7528\u7684\u7b97\u6cd5\uff0c\u53ef\u9009sha256\u3001sha512"},{"location":"reference/pipelines/source/kube-event/","title":"kubeEvent","text":"

    \u63a5\u6536Kubernetes events\u7684source\u3002

    \u4f7f\u7528\u65b9\u5f0f\u53ef\u53c2\u8003\u91c7\u96c6Kubernetes Events\u3002

    Example

    sources:\n- type: kubeEvent\nname: event\n
    "},{"location":"reference/pipelines/source/kube-event/#kubeconfig","title":"kubeconfig","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 kubeconfig string \u975e\u5fc5\u586b \u8bf7\u6c42Kubernetes\u7684kubeconfig\u6587\u4ef6\uff0c\u5f53Loggie\u90e8\u7f72\u5728Kubernetes\u96c6\u7fa4\u4e2d\u65f6\uff0c\u65e0\u9700\u586b\u5199\uff0c\u4f1a\u8fdb\u5165in cluster\u6a21\u5f0f"},{"location":"reference/pipelines/source/kube-event/#master","title":"master","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 master string \u975e\u5fc5\u586b \u8bf7\u6c42Kubernetes\u7684master\u5730\u5740\uff0c\u5f53Loggie\u90e8\u7f72\u5728Kubernetes\u96c6\u7fa4\u4e2d\u65f6\uff0c\u65e0\u9700\u586b\u5199"},{"location":"reference/pipelines/source/kube-event/#buffersize","title":"bufferSize","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 bufferSize int \u975e\u5fc5\u586b 1000 \u76d1\u542c\u7684\u961f\u5217\u5927\u5c0f\uff0c\u6700\u5c0f\u4e3a1"},{"location":"reference/pipelines/source/kube-event/#watchlatestevents","title":"watchLatestEvents","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 watchLatestEvents bool \u975e\u5fc5\u586b false \u662f\u5426\u53ea\u76d1\u542c\u6700\u65b0\u7684events

    \u7531\u4e8eLoggie\u91cd\u542f\u540e\u4f1a\u91cd\u65b0list\u6240\u6709\u7684events\uff0c\u4f1a\u5bfc\u81f4\u91cd\u590d\u53d1\u9001\uff0c\u5982\u679c\u4e0d\u5e0c\u671b\u91cd\u590d\u53d1\u9001\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e3atrue\uff0c\u5f53\u7136\u53ef\u80fd\u5bfc\u81f4\u91cd\u542f\u65f6\u95f4\u6bb5\u5185\u65b0\u4ea7\u751f\u7684events\u4e22\u5931\u3002

    "},{"location":"reference/pipelines/source/kube-event/#blacklistnamespaces","title":"blackListNamespaces","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 blackListNamespaces string\u6570\u7ec4 \u975e\u5fc5\u586b \u4e0d\u63a5\u6536\u5176\u4e2d\u5b9a\u4e49\u7684namespaces\u4e2d\u4ea7\u751f\u7684events"},{"location":"reference/pipelines/source/overview/","title":"Overview","text":"

    sources\u5b57\u6bb5\u4e3a\u6570\u7ec4\uff0c\u4e00\u4e2aPipeline\u4e2d\u53ef\u586b\u5199\u591a\u4e2asource\u7ec4\u4ef6\u914d\u7f6e\u3002

    \u56e0\u6b64\uff0c\u8bf7\u6ce8\u610f\u6240\u6709\u7684source\u4e2dname\u5fc5\u586b\uff0c\u4f5c\u4e3apipeline\u4e2dsource\u7684\u552f\u4e00\u6807\u8bc6\u3002

    "},{"location":"reference/pipelines/source/overview/#source","title":"Source\u901a\u7528\u914d\u7f6e","text":"

    \u6240\u6709Source\u5747\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u914d\u7f6e\u3002

    "},{"location":"reference/pipelines/source/overview/#enabled","title":"enabled","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 enabled bool \u975e\u5fc5\u586b true \u8868\u793a\u662f\u5426\u5f00\u542f\u8be5source"},{"location":"reference/pipelines/source/overview/#name","title":"name","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 name string \u5fc5\u586b \u8868\u793asource\u7684\u540d\u79f0\uff0c\u5efa\u8bae\u586b\u5199\u6709\u6807\u8bc6\u610f\u4e49\u7684\u8bcd"},{"location":"reference/pipelines/source/overview/#fields","title":"fields","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fields map \u975e\u5fc5\u586b \u81ea\u5b9a\u4e49\u989d\u5916\u6dfb\u52a0\u5230event\u4e2d\u7684\u5b57\u6bb5

    \u6bd4\u5982\u5982\u4e0b\u914d\u7f6e:

    Example

    sources:\n- type: file\n  name: access\n  paths:\n  - /var/log/*.log\n  fields:\n    service: demo\n

    \u4f1a\u7ed9\u91c7\u96c6\u7684\u6240\u6709\u65e5\u5fd7\u4e0a\uff0c\u90fd\u52a0\u4e0aservice: demo\u5b57\u6bb5\u3002

    "},{"location":"reference/pipelines/source/overview/#fieldsfromenv","title":"fieldsFromEnv","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fieldsFromEnv map \u975e\u5fc5\u586b \u989d\u5916\u6dfb\u52a0\u5230event\u4e2d\u7684\u5b57\u6bb5\uff0cvalue\u4e3aenv\u73af\u5883\u53d8\u91cf\u7684key

    \u6bd4\u5982\u5982\u4e0b\u914d\u7f6e:

    Example

    sources:\n- type: file\n  name: access\n  paths:\n  - /var/log/*.log\n  fieldsFromEnv:\n    service: SVC_NAME\n

    \u4f1a\u4eceLoggie\u6240\u5728\u7684\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u83b7\u53d6SVC_NAME\u7684\u503c${SVC_NAME}\uff0c\u7136\u540e\u7ed9\u6240\u6709\u7684\u65e5\u5fd7event\u4e0a\u6dfb\u52a0\u5b57\u6bb5\uff1aservice: ${SVC_NAME}\u3002

    "},{"location":"reference/pipelines/source/overview/#fieldsfrompath","title":"fieldsFromPath","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fieldsFromPath map \u975e\u5fc5\u586b \u989d\u5916\u6dfb\u52a0\u5230event\u4e2d\u7684\u5b57\u6bb5\uff0cvalue\u4e3apath\u6307\u5b9a\u6587\u4ef6\u91cc\u7684\u5185\u5bb9

    \u6bd4\u5982\u5982\u4e0b\u914d\u7f6e:

    Example

    sources:\n- type: file\nname: access\npaths:\n- /var/log/*.log\nfieldsFromPath:\ntest: /tmp/foo\n

    \u5047\u8bbe\u6587\u4ef6/tmp/foo\u7684\u5185\u5bb9\u4e3abar\uff1a

    cat /tmp/foo\n---\nbar\n

    Loggie\u4f1a\u7ed9\u6240\u6709\u7684\u65e5\u5fd7event\u4e0a\u6dfb\u52a0\u5b57\u6bb5\uff1atest: bar\u3002

    "},{"location":"reference/pipelines/source/overview/#fieldsunderroot","title":"fieldsUnderRoot","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fieldsUnderRoot bool \u975e\u5fc5\u586b false \u989d\u5916\u6dfb\u52a0\u7684fields\u662f\u5426\u653e\u5728event\u7684\u6839\u90e8

    \u6bd4\u5982\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f93\u51fa\u7684\u65e5\u5fd7\u683c\u5f0f\u4e3a\uff1a

    {\n\"body\": \"hello world\",\n\"fields\": {\n\"service\": \"demo\"\n}\n}\n

    \u5982\u679c\u8bbe\u7f6efieldsUnderRoot=true\uff0c\u8f93\u51fa\u7684\u65e5\u5fd7\u683c\u5f0f\u4e3a\uff1a

    {\n\"body\": \"hello world\",\n\"service\": \"demo\"\n}\n
    "},{"location":"reference/pipelines/source/overview/#fieldsunderkey","title":"fieldsUnderKey","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 fieldsUnderKey string \u975e\u5fc5\u586b fields \u5f53fieldsUnderRoot=false\u65f6\uff0c\u5b57\u6bb5\u7684\u540d\u79f0

    \u6bd4\u5982\u53ef\u4ee5\u4fee\u6539\u9ed8\u8ba4\u7684\u5b57\u6bb5fields\u4e3atag\uff0c\u8f93\u51fa\u7684\u65e5\u5fd7\u4e3a\uff1a

    {\n\"body\": \"hello world\",\n\"tag\": {\n\"service\": \"demo\"\n}\n}\n
    "},{"location":"reference/pipelines/source/overview/#codec","title":"codec","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 codec \u975e\u5fc5\u586b source\u63a5\u6536\u5230\u6570\u636e\u7684\u65f6\u5019\u7528\u4e8e\u89e3\u6790\u9884\u5904\u7406 codec.type string \u975e\u5fc5\u586b \u65e0

    \u8bf7\u6ce8\u610f\uff1a\u76ee\u524d\u4ec5file source\u652f\u6301source codec\u3002

    "},{"location":"reference/pipelines/source/overview/#type-json","title":"type: json","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 codec.bodyFields \u5fc5\u586b \u4f7f\u7528\u89e3\u6790\u8bfb\u53d6\u5230\u7684json\u6570\u636e\u4e2d\u7684\u8be5\u5b57\u6bb5\u4f5c\u4e3abody

    \u914d\u7f6e\u793a\u4f8b\uff1a

    type: json

      sources:\n- type: file\nname: nginx\npaths:\n- /var/log/*.log\ncodec:\ntype: json\nbodyFields: log\n

    \u5982\u679c\u91c7\u96c6\u5230\u7684\u65e5\u5fd7\u4e3a\uff1a

    {\"log\":\"I0610 08:29:07.698664 Waiting for caches to sync\\n\", \"stream\":\"stderr\", \"time:\"2021-06-10T08:29:07.698731204Z\"}\n
    \u5219codec\u540e\u5f97\u5230\u7684event\u4e3a\uff1a
    body: \"I0610 08:29:07.698664 Waiting for caches to sync\"\n

    \u8bf7\u6ce8\u610f\uff1a\u76ee\u524d\u975ebodyFields\u7684\u5b57\u6bb5\u5747\u4f1a\u88ab\u4e22\u5f03\u3002

    "},{"location":"reference/pipelines/source/overview/#type-regex","title":"type: regex","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 codec.pattern \u5fc5\u586b \u6b63\u5219\u8868\u8fbe\u5f0f codec.bodyFields \u5fc5\u586b \u4f7f\u7528\u6b63\u5219\u63d0\u53d6\u5230\u7684\u8be5\u5b57\u6bb5\u4f5c\u4e3abody

    \u914d\u7f6e\u793a\u4f8b\uff1a

    type: regex

      sources:\n- type: file\nname: nginx\npaths:\n- /var/log/*.log\ncodec:\ntype: regex\npattern: ^(?P<time>[^ ^Z]+Z) (?P<stream>stdout|stderr) (?P<logtag>[^ ]*) (?P<log>.*)$\nbodyFields: log\n

    \u5982\u679c\u91c7\u96c6\u5230\u7684\u65e5\u5fd7\u4e3a\uff1a

    2021-12-01T03:13:58.298476921Z stderr F INFO [main] Starting service [Catalina]\n
    \u5219codec\u540e\u5f97\u5230\u7684event\u4e3a\uff1a
    body: \"INFO [main] Starting service [Catalina]\"\n

    \u8bf7\u6ce8\u610f\uff1a\u76ee\u524d\u975ebodyFields\u7684\u5b57\u6bb5\u5747\u4f1a\u88ab\u4e22\u5f03\u3002

    "},{"location":"reference/pipelines/source/prometheus-exporter/","title":"prometheusExporter","text":"

    \u91c7\u96c6Prometheus Metrics\u7684\u6307\u6807\u6570\u636e\u3002

    Example

    sources:\n- type: prometheusExporter\nname: metric\nendpoints:\n- \"http://127.0.0.1:9196/metrics\"\n
    "},{"location":"reference/pipelines/source/prometheus-exporter/#endpoints","title":"endpoints","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 endpoints string\u6570\u7ec4 \u5fc5\u586b \u6293\u53d6\u7684\u8fdc\u7aefexporter\u5730\u5740\uff0c\u8bf7\u6ce8\u610fLoggie\u4e0d\u4f1a\u9ed8\u8ba4\u5728\u8bf7\u6c42\u8def\u5f84\u4e2d\u6dfb\u52a0/metrics"},{"location":"reference/pipelines/source/prometheus-exporter/#interval","title":"interval","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 interval time.Duration \u975e\u5fc5\u586b 30s \u5b9a\u65f6\u6293\u53d6\u8fdc\u7aefexporter\u7684\u65f6\u95f4\u95f4\u9694"},{"location":"reference/pipelines/source/prometheus-exporter/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 5s \u6293\u53d6\u8bf7\u6c42\u7684\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/source/prometheus-exporter/#tojson","title":"toJson","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 toJson bool \u975e\u5fc5\u586b false \u662f\u5426\u5c06\u6293\u53d6\u5230\u7684prometheus\u539f\u751f\u6307\u6807\uff0c\u8f6c\u6362\u6210JSON\u683c\u5f0f"},{"location":"reference/pipelines/source/prometheus-exporter/#labels","title":"labels","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 labels map \u975e\u5fc5\u586b \u7ed9\u6240\u6709metrics\u6307\u6807\u589e\u52a0\u989d\u5916\u7684label

    labels\u652f\u6301\u914d\u7f6e${_env.XX}\u7684\u65b9\u5f0f\u83b7\u53d6\u73af\u5883\u53d8\u91cf\u3002 \u4f8b\u5982\uff0c\u914d\u7f6e\uff1a

    labels

        sources:\n- type: prometheusExporter\nname: metric\nendpoints:\n- \"http://127.0.0.1:9196/metrics\"\nlabels:\nsvc: ${_env.SVC}\n

    \u5047\u8bbe\u73af\u5883\u53d8\u91cfSVC=test\uff0c\u4f1a\u5c06\u6240\u6709\u7684metrics\u52a0\u4e0asvc=test\u7684label\u3002

    "},{"location":"reference/pipelines/source/unix/","title":"unix","text":"

    \u901a\u8fc7unix socket\u63a5\u6536\u6570\u636e\u3002

    Example

    sources:\n- type: unix\nname: demo\npath: \"/tmp/loggie.sock\"\n
    "},{"location":"reference/pipelines/source/unix/#path","title":"path","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 path string \u5fc5\u586b \u63a5\u6536\u7684\u8def\u5f84\u540d"},{"location":"reference/pipelines/source/unix/#maxbytes","title":"maxBytes","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxBytes int \u975e\u5fc5\u586b 40960 \u63a5\u6536\u7684\u6700\u5927\u5b57\u8282\u6570"},{"location":"reference/pipelines/source/unix/#maxconnections","title":"maxConnections","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 maxConnections int \u975e\u5fc5\u586b 512 \u540c\u65f6\u4fdd\u6301\u6700\u591a\u7684\u8fde\u63a5\u6570"},{"location":"reference/pipelines/source/unix/#timeout","title":"timeout","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 timeout time.Duration \u975e\u5fc5\u586b 5m \u8fde\u63a5\u8d85\u65f6\u65f6\u95f4"},{"location":"reference/pipelines/source/unix/#mode","title":"mode","text":"\u5b57\u6bb5 \u7c7b\u578b \u662f\u5426\u5fc5\u586b \u9ed8\u8ba4\u503c \u542b\u4e49 mode string \u975e\u5fc5\u586b 0755"},{"location":"user-guide/","title":"\u7528\u6237\u6307\u5357","text":"

    \u5728\u672c\u300c\u7528\u6237\u6307\u5357\u300d\u90e8\u5206\uff0c\u6211\u4eec\u4e3b\u8981\u4ecb\u7ecdLoggie\u7684\u4e3b\u8981\u529f\u80fd\u548c\u7279\u6027\uff0c\u540c\u65f6\u5c55\u793a\u5728\u5404\u79cd\u4e0d\u540c\u7684\u573a\u666f\u4e0b\uff0c\u5982\u4f55\u4f7f\u7528Loggie\u6ee1\u8db3\u5404\u7c7b\u9700\u6c42\u3002

    \u5982\u679c\u5e0c\u671b\u67e5\u8be2\u5177\u4f53\u7ec4\u4ef6\u7684\u4f7f\u7528\u4e0e\u914d\u7f6e\u65b9\u5f0f\uff0c\u8bf7\u6233\u300c\u7ec4\u4ef6\u914d\u7f6e\u300d\u3002

    "},{"location":"user-guide/#_2","title":"\u843d\u5730\u4e00\u5957\u65e5\u5fd7\u7cfb\u7edf\u4f1a\u9047\u5230\u54ea\u4e9b\u95ee\u9898\uff1f","text":"

    \u5728\u4f01\u4e1a\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u600e\u4e48\u53bb\u6784\u5efa\u4e00\u5957\u5b8c\u6574\u7684\u65e5\u5fd7\u7cfb\u7edf\uff1f\u5982\u4f55\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u9009\u578b\uff0c\u5176\u4e2d\u53c8\u4f1a\u78b0\u5230\u54ea\u4e9b\u95ee\u9898\uff1f \u5728\u4e0d\u540c\u7684\u4e1a\u52a1\u7c7b\u578b\u3001\u4e0d\u540c\u7684\u4f7f\u7528\u573a\u666f\u3001\u4e0d\u540c\u7684\u65e5\u5fd7\u89c4\u6a21\u4e0b\uff0c\u6211\u4eec\u53ef\u4ee5\u91c7\u7528\u54ea\u4e9b\u65e5\u5fd7\u7cfb\u7edf\u67b6\u6784\uff1f

    \u8bf7\u770b\u300c\u4f01\u4e1a\u5b9e\u6218\u300d\u3002

    \u5728\u6211\u4eec\u5bf9\u843d\u5730\u4e00\u5957\u529f\u80fd\u5b8c\u5584\u3001\u67b6\u6784\u5b8c\u6574\u7684\u65e5\u5fd7\u7cfb\u7edf\u6709\u521d\u6b65\u4e86\u89e3\u540e\uff0c\u60f3\u8981\u77e5\u9053\uff1a

    "},{"location":"user-guide/#loggie","title":"\u4e3a\u4ec0\u4e48Loggie\u80fd\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff1f","text":"

    \u5e02\u9762\u4e0a\u5f00\u6e90\u7684\u65e5\u5fd7\u91c7\u96c6Agent\u5df2\u7ecf\u5f88\u591a\u4e86\uff0c\u6211\u4eec\u4e3a\u4ec0\u4e48\u53c8\u9009\u62e9\u7814\u53d1Loggie\u5462\uff1f Loggie\u7684\u8bde\u751f\u662f\u4e3a\u4e86\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\u5462\uff1f Loggie\u548c\u5176\u4ed6\u7684\u5f00\u6e90\u65e5\u5fd7Agent\u533a\u522b\u662f\u4ec0\u4e48\uff1f

    \u8bf7\u770b\u300c\u67b6\u6784\u4e0e\u7279\u6027\u300d\u3002

    "},{"location":"user-guide/#loggie_1","title":"\u5982\u4f55\u4f7f\u7528Loggie\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff1f","text":"

    \u5982\u4f55\u5728Kubernetes\u96c6\u7fa4\u4e0b\u4f7f\u7528Loggie\uff1f \u8bf7\u770b\u300cKubernetes\u300d\u3002

    \u5982\u4f55\u914d\u7f6e\u5404\u79cd\u4e0d\u540c\u7684\u65e5\u5fd7\u67b6\u6784\uff1f\u5982\u4f55\u63a5\u5165\u73b0\u6709\u7684\u670d\u52a1\uff1f\u5982\u4f55\u914d\u7f6e\u65e5\u5fd7\u7684\u5904\u7406\u548c\u5207\u5206\uff1fLoggie\u8fd8\u63d0\u4f9b\u4e86\u54ea\u4e9b\u6709\u7528\u53c8\u597d\u7528\u7684\u529f\u80fd\uff1f \u8bf7\u770b\u300c\u6700\u4f73\u5b9e\u8df5\u300d\u3002

    \u5982\u4f55\u914d\u7f6e\u6574\u4f53\u7684\u76d1\u63a7\u548c\u62a5\u8b66\uff0c\u4fdd\u8bc1Loggie\u6b63\u5e38\u8fd0\u884c\uff1f\u5982\u4f55\u76d1\u63a7\u662f\u5426\u91c7\u96c6\u5230ERROR\u65e5\u5fd7\uff1f \u8bf7\u770b\u300c\u76d1\u63a7\u62a5\u8b66\u300d\u3002

    "},{"location":"user-guide/architecture/advantages/","title":"Loggie\u7684\u4f18\u52bf\u4e0e\u7279\u6027","text":"

    Loggie\u652f\u6301\u591a\u4e2aPipeline\uff0c\u6bcf\u4e2aPipeline\u90fd\u57fa\u4e8e\u7b80\u5355\u76f4\u89c2\u7684source->interceptor->sink\u7684\u67b6\u6784\u3002 \u8fd9\u6837\u8bbe\u8ba1\u5e26\u6765\u7684\u597d\u5904\u6709\uff1a

    "},{"location":"user-guide/architecture/advantages/#_1","title":"\u5f3a\u9694\u79bb","text":"

    \u591aPipeline\u8bbe\u8ba1\uff0c\u51cf\u5c11\u4e92\u76f8\u5e72\u6270\u3002\u6bd4\u5982\u6211\u4eec\u53ef\u4ee5\u5c06\u91cd\u8981\u7684\u4e1a\u52a1\u65e5\u5fd7\u653e\u5728\u4e00\u4e2aPipeline\u4e2d\uff0c\u5176\u4ed6\u7684\u4e0d\u91cd\u8981\u7684\u65e5\u5fd7\u914d\u7f6e\u4e3a\u53e6\u5916\u7684Pipeline\uff0c\u4e0d\u91cd\u8981\u7684\u65e5\u5fd7\u914d\u7f6e\u53d8\u52a8\u3001\u53d1\u751f\u4e0b\u6e38\u5835\u585e\u65f6\uff0c\u4e0d\u4f1a\u5f71\u54cd\u91cd\u8981\u65e5\u5fd7\u7684\u91c7\u96c6\u548c\u53d1\u9001\u3002

    "},{"location":"user-guide/architecture/advantages/#_2","title":"\u901a\u7528\u6027\u66f4\u597d","text":"

    \u5728\u4e00\u4e9b\u573a\u666f\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u5c06\u4e0d\u540c\u7c7b\u578b\u7684\u670d\u52a1\u6df7\u5408\u90e8\u7f72\u5728\u4e00\u4e2a\u8282\u70b9\u4e0a\uff0c\u5f88\u53ef\u80fd\u4ed6\u4eec\u7684\u65e5\u5fd7\u4f1a\u53d1\u9001\u5230\u4e0d\u540c\u7684Kafka\u96c6\u7fa4\u4e2d\uff0c\u5982\u679c\u53ea\u6709\u4e00\u4e2a\u5168\u5c40\u7684\u8f93\u51fa\u6e90\uff0c\u9700\u8981\u5728\u8282\u70b9\u4e0a\u90e8\u7f72\u4e24\u4e2aAgent\uff0c\u5982\u679c\u4f7f\u7528Loggie\u5219\u53ea\u9700\u8981\u4f7f\u7528\u4e0d\u540c\u7684Pipeline\u5373\u53ef\uff0c\u6bcf\u4e2aPipeline\u914d\u7f6e\u4e0d\u540c\u7684Sink\uff0c\u51cf\u5c11\u90e8\u7f72\u6210\u672c\u3002 \u6211\u4eec\u751a\u81f3\u53ef\u4ee5\u91c7\u96c6\u76f8\u540c\u7684\u65e5\u5fd7\uff0c\u53d1\u9001\u5230\u4e0d\u540c\u7684\u540e\u7aef\u8f93\u51fa\u6e90\uff0c\u6839\u636e\u5b9e\u9645\u9700\u6c42\u7075\u6d3b\u914d\u7f6e\u3002

    "},{"location":"user-guide/architecture/advantages/#_3","title":"\u7075\u6d3b\u3001\u70ed\u63d2\u62d4\u3001\u53ef\u6269\u5c55","text":"

    \u672c\u8d28\u4e0asource->interceptor->sink\u67b6\u6784\u662f\u4e00\u4e2a\u6570\u636e\u6d41\u5f0f\u7684\u8bbe\u8ba1\uff0c\u4e0d\u540c\u7c7b\u578b\u7684source/interceptor/sink\u7684\u6392\u5217\u7ec4\u5408\uff0c\u53ef\u4ee5\u6ee1\u8db3\u65e5\u5fd7\u7684\u4e0d\u540c\u9700\u6c42\uff0c Loggie\u5e76\u6ca1\u6709\u5c06interceptor\u66f4\u7ec6\u5316\u7684\u5206\u7c7b\u6210\u6bd4\u5982Filter/Formater\u7b49\u7c7b\u578b\uff0cinterceptor\u627f\u62c5\u4e86\u9664\u4e86source\u8bfb\u53d6\uff0csink\u53d1\u9001\u4e4b\u5916\u7684\u5927\u90e8\u5206\u5de5\u4f5c\uff0c\u53ea\u9700\u8981\u914d\u7f6e\u4e0d\u540c\u7684interceptor\u5c31\u53ef\u4ee5\u62e5\u6709\u4e2d\u8f6c\u3001\u8fc7\u6ee4\u3001\u89e3\u6790\u3001\u5207\u5206\u3001\u65e5\u5fd7\u62a5\u8b66\u7b49\u80fd\u529b\u3002 \u4e8e\u662f\uff0cLoggie\u53ef\u4ee5\uff1a

    \u5728\u90e8\u7f72\u548c\u7ef4\u62a4\u5c42\u9762\u5e26\u6765\u7684\u597d\u5904\u662f\uff1a \u5982\u679c\u4e4b\u524d\u91c7\u7528\u5e38\u89c4\u7684ELK\u67b6\u6784\uff0c\u4f7f\u7528Filebeat\u91c7\u96c6\u65e5\u5fd7\u3001Logstash\u4e2d\u8f6c\u548c\u89e3\u6790\u65e5\u5fd7\uff0c\u7531\u4e8eFilebeat\u548cLogstash\u662f\u4e24\u4e2a\u4e0d\u540c\u7684\u8bed\u8a00\u6808\uff0c\u5e26\u6765\u6392\u67e5\u95ee\u9898\u548c\u6269\u5c55\u5f00\u53d1\u6210\u672c\u5747\u8f83\u9ad8\u3002 \u6539\u7528Loggie\u540e\u6211\u4eec\u65e0\u9700\u7ef4\u62a4\u4e24\u4e2a\u9879\u76ee\uff0c\u751a\u81f3\u5982\u679c\u6ca1\u6709\u4e2d\u8f6c\u673a\u7684\u9700\u6c42\uff0c\u53ef\u4ee5\u9009\u62e9\u5728Agent\u7aef\u914d\u7f6e\u65e5\u5fd7\u89e3\u6790\u3002

    \u53e6\u5916\uff0c\u76ee\u524d\u9488\u5bf9\u65e5\u5fd7\u62a5\u8b66\uff0c\u5f00\u6e90\u7684\u65b9\u6848\u4e00\u822c\u4e3a\u4f7f\u7528elastAlert\uff0c\u4f46\u662felastAlert\u65e0\u6cd5\u76f4\u63a5\u5bf9\u63a5AlertManager\uff0c\u5e76\u4e14\u5728\u9ad8\u53ef\u7528\u7b49\u65b9\u9762\u5b58\u5728\u95ee\u9898\uff0c\u540c\u65f6\u4f1a\u5f3a\u4f9d\u8d56Elasticsearch\u3002\u6240\u4ee5\u5982\u679c\u4f7f\u7528Loggie\uff0c\u53ef\u4ee5\u65e0\u9700\u5f15\u5165\u989d\u5916\u7684\u7ec4\u4ef6\uff0c\u76f4\u63a5\u4f7f\u7528Loggie\u6765\u68c0\u6d4b\u5f02\u5e38\u65e5\u5fd7\u5e76\u63a5\u5165\u62a5\u8b66\u3002

    "},{"location":"user-guide/architecture/advantages/#_4","title":"\u53ef\u5feb\u901f\u65b9\u4fbf\u7684\u5199\u4e00\u4e2a\u7ec4\u4ef6","text":"

    Loggie\u57fa\u4e8e\u5fae\u5185\u6838\u7684\u67b6\u6784\uff0c\u6240\u6709\u7684source/interceptor/sink/queue\u90fd\u88ab\u62bd\u8c61\u6210component\uff0c\u53ea\u9700\u8981\u5728\u4ee3\u7801\u4e2d\u5b9e\u73b0Golang\u63a5\u53e3\uff0c\u5373\u53ef\u65b9\u4fbf\u7684\u7814\u53d1\u4e00\u4e2acomponent\u3002 \u5982\u679cLoggie\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\uff0c\u65e0\u6cd5\u6ee1\u8db3\u4f60\u7684\u9700\u6c42\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5199\u4e00\u4e2a\u81ea\u5df1\u7684component\u3002 \u6bd4\u5982\u9700\u8981Loggie\u8f6c\u6362\u6210\u7279\u5b9a\u7684\u65e5\u5fd7\u683c\u5f0f\uff0c\u53ef\u4ee5\u5199\u4e00\u4e2ainterceptor\u53bb\u5904\u7406\uff1b\u9700\u8981Loggie\u5c06\u91c7\u96c6\u7684\u65e5\u5fd7\u53d1\u9001\u81f3\u5c1a\u672a\u652f\u6301\u7684\u670d\u52a1\uff0c\u53ef\u4ee5\u5199\u4e00\u4e2asink\u3002 \u5f53\u7136\uff0cLoggie\u4f7f\u7528Golang\u7f16\u5199\uff0c\u6240\u4ee5\u4f60\u76ee\u524d\u9700\u8981\u7528Golang\u6765\u5199component\u3002Golang\u548cJava\u6216\u8005C/C++\u76f8\u6bd4\uff0c\u5728\u6027\u80fd\u548c\u7814\u53d1\u6548\u7387\u4e0a\u6709\u4e00\u4e2a\u6298\u4e2d\uff0c\u66f4\u9002\u5408\u7c7b\u4f3c\u65e5\u5fd7Agent\u7684\u573a\u666f\u3002

    "},{"location":"user-guide/architecture/advantages/#kubernetes","title":"\u66f4\u65b9\u4fbf\u7684Kubernetes\u5bb9\u5668\u65e5\u5fd7\u91c7\u96c6\uff0c\u66f4\u597d\u7684\u4e91\u539f\u751f\u652f\u6301","text":"

    \u5982\u679c\u4f60\u5c1d\u8bd5\u8fc7\u5728Kubernetes\u73af\u5883\u4e0b\u91c7\u96c6\u65e5\u5fd7\uff0c\u5e94\u8be5\u9047\u5230\u8fc7\u8fd9\u4e9b\u95ee\u9898\uff1a

    \u5982\u679c\u4f60\u4f7f\u7528Loggie\uff0c\u4f60\u53ef\u4ee5\uff1a

    1. \u5feb\u901f\u90e8\u7f72\uff0c\u652f\u6301\u5404\u79cd\u90e8\u7f72\u67b6\u6784
    2. \u53ea\u9700\u8981\u4f7f\u7528ClusterLogConfig/LogConfig CRD\u914d\u7f6e\u7ba1\u7406\u65e5\u5fd7\u914d\u7f6e\uff0c\u66f4\u65b9\u4fbf\u7684\u63a5\u5165\u5404\u7c7b\u5bb9\u5668\u4e91\u5e73\u53f0\uff0c\u5bf9\u4e1a\u52a1\u65e0\u4fb5\u5165\uff0c\u65e0\u9700\u5173\u5fc3Pod\u8fc1\u79fb\u7b49\uff0c\u65e0\u9700\u624b\u52a8\u5728\u8282\u70b9\u4e0a\u64cd\u4f5c\u914d\u7f6e\u65e5\u5fd7\u6587\u4ef6\uff0c\u540c\u65f6\u53ef\u914d\u7f6e\u6ce8\u5165Namespace/PodName/NodeName\u7b49\u5143\u4fe1\u606f\u4f9b\u67e5\u8be2\u4f7f\u7528
    "},{"location":"user-guide/architecture/advantages/#_5","title":"\u66f4\u597d\u7684\u7a33\u5b9a\u6027\u3001\u66f4\u8be6\u7ec6\u7684\u76d1\u63a7\u6307\u6807\u3001\u66f4\u65b9\u4fbf\u7684\u6392\u969c\u65b9\u5f0f","text":"

    \u5728\u5b9e\u9645\u7684\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u65e5\u5fd7Agent\u672c\u8eab\u7684\u7a33\u5b9a\u6027\u5f88\u91cd\u8981\uff0c\u540c\u65f6\u4e0d\u5f71\u54cd\u4e1a\u52a1\u4e5f\u5f88\u91cd\u8981\u3002 Loggie\u53ef\u914d\u7f6e\u9650\u6d41interceptor\uff0c\u5728\u65e5\u5fd7\u91cf\u592a\u5927\u65f6\uff0c\u53ef\u4ee5\u907f\u514d\u53d1\u9001\u65e5\u5fd7\u6570\u636e\u5360\u636e\u4e86\u592a\u591a\u7f51\u7edc\u5e26\u5bbd\u3002 Loggie\u6709\u5408\u7406\u7684\u6587\u4ef6\u53e5\u67c4\u5904\u7406\u673a\u5236\uff0c\u907f\u514dfd\u88ab\u5360\u7528\u7684\u5404\u79cd\u5f02\u5e38\u573a\u666f\u5bfc\u81f4\u8282\u70b9\u4e0d\u7a33\u5b9a\u3002

    \u53e6\u5916\uff0cLoggie\u7ed3\u5408\u6211\u4eec\u5728\u5404\u79cd\u73af\u5883\u4e2d\u9047\u5230\u7684\u5404\u79cd\u95ee\u9898\uff0c\u9488\u5bf9\u6027\u7684\u68c0\u6d4b\u66b4\u9732\u51fa\u76f8\u5e94\u7684\u6307\u6807\u3002 \u6bd4\u5982\u6307\u6807\u652f\u6301\u91c7\u96c6\u548c\u53d1\u9001\u5ef6\u8fdf\u68c0\u6d4b\u3002\u6bd4\u5982\u9488\u5bf9\u6587\u4ef6size\u589e\u957f\u592a\u5feb\uff0c\u6216\u8005\u6587\u4ef6size\u592a\u5927\u7b49\u573a\u666f\uff0c\u652f\u6301\u8be5\u7c7bmetric\u4e0a\u62a5\u3002

    \u540c\u65f6Loggie\u652f\u6301\u539f\u751fPrometheus metric\uff0c\u53ef\u907f\u514d\u989d\u5916\u90e8\u7f72exporter\u5e26\u6765\u7684\u90e8\u7f72\u6210\u672c\u548c\u8d44\u6e90\u6d88\u8017\u3002Loggie\u8fd8\u63d0\u4f9b\u4e86\u5b8c\u5584\u7684Grafana\u76d1\u63a7\u56fe\u8868\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5feb\u901f\u63a5\u5165\u4f7f\u7528\u3002

    "},{"location":"user-guide/architecture/advantages/#_6","title":"\u66f4\u4f4e\u7684\u8d44\u6e90\u5360\u7528\uff0c\u66f4\u597d\u7684\u6027\u80fd","text":"

    Loggie\u57fa\u4e8eGolang\u7f16\u5199\uff0c\u5728\u4ee3\u7801\u5c42\u9762\u6211\u4eec\u6709\u5f88\u591a\u4f18\u5316\uff0c\u5728\u8f83\u5c11\u8d44\u6e90\u5360\u7528\u7684\u540c\u65f6\uff0c\u8fd8\u53ef\u63d0\u4f9b\u5f3a\u5927\u7684\u541e\u5410\u6027\u80fd\u3002

    "},{"location":"user-guide/architecture/background/","title":"Loggie\u7684\u8bde\u751f\u80cc\u666f","text":"

    \u4e3a\u4ec0\u4e48\u6211\u4eec\u4f1a\u9009\u62e9\u7814\u53d1Loggie\uff0c\u5f53\u65f6\u7684\u80cc\u666f\u548c\u539f\u56e0\u662f\u4ec0\u4e48\uff1f

    "},{"location":"user-guide/architecture/background/#_1","title":"\u4e00\u3001\u90a3\u4e9b\u5e74\u6211\u4eec\u9047\u5230\u7684\u95ee\u9898","text":"

    \u5728\u7814\u53d1Loggie\u4e4b\u524d\uff0c\u6211\u4eec\u7684\u65e5\u5fd7\u670d\u52a1\u91c7\u96c6\u7aef\u90fd\u662f\u4f7f\u7528Filebeat\uff0c\u5f53\u65f6\u4e3a\u4ec0\u4e48\u9009\u62e9Filebeat\u5462\uff1f

    Filebeat\u662fElastic\u516c\u53f8\u7684\u4ea7\u54c1\uff0c\u4e3b\u6253\u8f7b\u91cf\u7ea7\uff0c\u7528\u4e8e\u66ff\u6362\u539f\u6709Logstash\u53bb\u5b9e\u73b0\u65e5\u5fd7\u91c7\u96c6\u7684\u5de5\u4f5c\uff0c\u76f8\u6bd4\u4ed6\u4eec\u81ea\u5bb6\u57fa\u4e8eJRuby\u8bed\u8a00\u7684Logstash\uff0cFilebeat\u786e\u5b9e\u662f\u76f8\u5bf9\u8f7b\u91cf\u3001\u8d44\u6e90\u5360\u7528\u5c11\u3002\u548c\u5176\u4ed6\u7684\u5f00\u6e90\u65e5\u5fd7\u91c7\u96c6Agent\u76f8\u6bd4\uff0c\u57fa\u4e8eGolang\u5f00\u53d1\u7684Filebeat\uff0c\u4e5f\u6709\u5f88\u591a\u4f18\u52bf\u3002 \u4f8b\u5982\uff0c\u76f8\u6bd4\u57fa\u4e8eJava\u7684Flume\uff0c\u6027\u80fd\u66f4\u597d\uff0c\u8d44\u6e90\u5360\u7528\u66f4\u5c11\uff1b\u76f8\u6bd4\u57fa\u4e8eRuby\u7684Fluentd\uff0c\u6027\u80fd\u66f4\u597d\uff0c\u4e8c\u6b21\u5f00\u53d1\u66f4\u65b9\u4fbf\uff1b\u76f8\u6bd4\u57fa\u4e8eC\u7684Fluentd-bit\uff0c\u529f\u80fd\u66f4\u5b8c\u5584\uff0c\u5f00\u53d1\u66f4\u53cb\u597d\u3002 \u6240\u4ee5\uff0c\u603b\u4f53\u6765\u8bf4\uff0cFilebeat\u662f\u4e00\u4e2a\u76f8\u5bf9\u6bd4\u8f83\u5e73\u8861\u7684\u65e5\u5fd7\u91c7\u96c6Agent\uff0c\u8fd9\u4e5f\u662f\u6211\u4eec\u5f53\u521d\u9009\u62e9Filebeat\u4f5c\u4e3a\u9ed8\u8ba4\u65e5\u5fd7\u91c7\u96c6Agent\u7684\u539f\u56e0\u3002

    \u4f46\u662f\u968f\u7740\u6211\u4eec\u5bf9Filebeat\u66f4\u52a0\u6df1\u5ea6\u7684\u4f7f\u7528\uff0c\u5728\u516c\u53f8\u96c6\u56e2\u5185\u90e8\u5b9e\u8df5\u548c\u5916\u90e8\u5ba2\u6237\u7684\u4ea4\u4ed8\u4e2d\uff0c\u4e5f\u78b0\u5230\u4e86\u4e00\u4e9b\u95ee\u9898\u3002

    \u7531\u4e8eFilebeat\u8bbe\u8ba1\u5f53\u521d\u8bbe\u8ba1\u65f6\uff0c\u4e3a\u4e86\u533a\u5206\u4e8eLogstash\uff0c\u7a81\u51fa\u8f7b\u91cf\u7ea7\uff0c\u727a\u7272\u4e86\u5f88\u591a\u53ef\u6269\u5c55\u6027\u7684\u8bbe\u8ba1\u3002 \u6700\u660e\u663e\u7684\u5c31\u662f\uff0cFilebeat\u53ea\u6709\u4e00\u4e2aQueue\u548c\u4e00\u4e2aOutput\u3002\u8fd9\u6837\u4e5f\u5bfc\u81f4\u4e86\uff1a

    "},{"location":"user-guide/architecture/background/#_2","title":"\u9694\u79bb\u6027\u5f31","text":"

    \u7531\u4e8e\u6240\u6709\u7684\u670d\u52a1\u65e5\u5fd7\u90fd\u4f1a\u53d1\u9001\u5230\u5168\u5c40\u552f\u4e00\u7684Queue\u91cc\uff0c\u5bfc\u81f4\u670d\u52a1\u65e5\u5fd7\u6570\u636e\u6df7\u5728\u4e00\u8d77\uff0c\u5728\u5f02\u5e38\u573a\u666f\u53d1\u751f\u65f6\uff0c\u65e0\u6cd5\u6709\u9694\u79bb\u6027\u7684\u4fdd\u969c\u3002 \u6bd4\u5982Filebeat\u5168\u5c40\u7684Queue\u5806\u79ef\uff0c\u4f1a\u5bfc\u81f4\u8282\u70b9\u7684\u6240\u6709\u670d\u52a1\u65e5\u5fd7\u5747\u65e0\u6cd5\u53d1\u9001\uff0c\u5982\u679c\u6211\u4eec\u5bf9\u4e0d\u540c\u670d\u52a1\u7684\u65e5\u5fd7\u7684\u7ea7\u522b\u548c\u8981\u6c42\u4e0d\u4e00\u6837\uff0c\u4e0d\u7ba1\u91cd\u8981\u8fd8\u662f\u4e0d\u91cd\u8981\u7684\u65e5\u5fd7\u90fd\u4f1a\u53d7\u5230\u5f71\u54cd\u3002

    "},{"location":"user-guide/architecture/background/#output","title":"\u4e0d\u652f\u6301\u591a\u4e2aOutput","text":"

    \u6709\u4e00\u4e9b\u573a\u666f\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5c06\u4e0d\u540c\u670d\u52a1\u7684\u4e0d\u540c\u7c7b\u578b\u65e5\u5fd7\u53d1\u9001\u81f3\u4e0d\u540c\u7684\u540e\u7aef\uff0c\u4f46Filebeat\u65e0\u6cd5\u4f7f\u7528\u540c\u4e00\u4e2aAgent\u53bb\u53d1\u9001\u5230\u4e0d\u540c\u7684Kafka\u96c6\u7fa4\uff0c\u53ea\u80fd\u5728\u8282\u70b9\u4e0a\u90e8\u7f72\u591a\u4e2aAgent\uff0c\u5bfc\u81f4\u7ef4\u62a4\u548c\u8d44\u6e90\u6210\u672c\u4e0a\u5347\u3002

    "},{"location":"user-guide/architecture/background/#_3","title":"\u53ef\u6269\u5c55\u6027\u6709\u9650","text":"

    \u76f8\u6bd4Logstash/Flume\u7b49\uff0cFilebeat\u5e76\u975e\u4f7f\u7528\u7c7b\u4f3c\u7684input->queue->output\u7684\u7075\u6d3b\u591a\u4e2apipeline\u8bbe\u8ba1\uff0c\u5728\u5bf9\u4e8e\u65e5\u5fd7\u6570\u636e\u7684\u5904\u7406/\u8fc7\u6ee4/\u589e\u5f3a\u4e0a\uff0c\u4f9d\u8d56\u7684\u662fFilebeat\u6709\u9650\u7684\u4e00\u4e9bprocessor\uff0c\u53ef\u6269\u5c55\u6027\u4e0d\u8db3\u3002 \u540c\u65f6Filebeat\u4e5f\u65e0\u6cd5\u4f5c\u4e3a\u4e2d\u8f6c\u805a\u5408\u4f7f\u7528\uff0c\u5728\u4f7f\u7528\u573a\u666f\u4e0b\u5927\u5927\u53d7\u9650\uff0c\u9700\u8981\u989d\u5916\u5f15\u5165\u5176\u4ed6\u7ec4\u4ef6\u3002\u53e6\u5916\u7c7b\u4f3c\u65e5\u5fd7\u62a5\u8b66\u7b49\u573a\u666f\uff0cFilebeat\u4e5f\u65e0\u6cd5\u6ee1\u8db3\u3002 \u6211\u4eec\u4e5f\u5c1d\u8bd5\u8fc7\u5b9a\u5236\u5316\u5f00\u53d1\uff0c\u4f46Filebeat\u672c\u8eab\u7684\u67b6\u6784\u8bbe\u8ba1\u4e0a\u96be\u4ee5\u5b9e\u73b0\u66f4\u591a\u7684\u6269\u5c55\u80fd\u529b\uff0c\u5e76\u4e14\u957f\u671f\u4f1a\u5e26\u6765\u5347\u7ea7\u4e0e\u4e0a\u6e38\u793e\u533a\u4ee3\u7801\u540c\u6b65\u7684\u95ee\u9898\u3002

    "},{"location":"user-guide/architecture/background/#_4","title":"\u65e5\u5fd7\u6392\u969c\u8fd0\u7ef4\u56f0\u5883","text":"

    Filebeat\u7684metrics\u6bd4\u8f83\u6709\u9650\uff0c\u5f88\u591a\u65f6\u5019\u6211\u4eec\u60f3\u8981\u6392\u67e5\u8bf8\u5982\u5e38\u89c1\u7684\u65e5\u5fd7\u662f\u5426\u6709\u91c7\u96c6\u3001\u91c7\u96c6\u7684\u65e5\u5fd7\u662f\u5426\u5b8c\u6574\u3001\u53d1\u9001\u662f\u5426\u6709\u5ef6\u8fdf\u7b49\u7b49\u6392\u969c\u573a\u666f\uff0cFilebeat\u6ca1\u6709\u63d0\u4f9b\u76f8\u5e94\u7684\u529f\u80fd\uff0c\u5341\u5206\u5f71\u54cd\u7ebf\u4e0a\u7684\u95ee\u9898\u6392\u67e5\u6548\u7387\u3002\u800c\u4e14Filebeat\u672a\u63d0\u4f9bPrometheus\u683c\u5f0f\u7684\u76d1\u63a7\u6307\u6807\uff0c\u9700\u8981\u989d\u5916\u6ce8\u5165exporter\u3002

    "},{"location":"user-guide/architecture/background/#_5","title":"\u6027\u80fd\u4e0d\u591f","text":"

    \u867d\u7136Filebeat\u6027\u80fd\u5c1a\u53ef\uff0c\u4f46\u662f\u5728\u6211\u4eec\u7684\u5b9e\u9645\u4f7f\u7528\u65f6\uff0c\u9047\u5230\u65e5\u5fd7\u573a\u666f\u590d\u6742\u3001\u65e5\u5fd7\u91cf\u5927\u7684\u60c5\u51b5\u65f6\uff0c\u5b58\u5728\u541e\u5410\u91cf\u7684\u74f6\u9888\uff0c\u65e0\u6cd5\u6ee1\u8db3\u5b9e\u65f6\u6027\u7684\u9700\u6c42\u3002

    "},{"location":"user-guide/architecture/background/#_6","title":"\u4e8c\u3001\u4e3a\u4ec0\u4e48\u73b0\u6709\u7684\u5176\u4ed6\u5f00\u6e90\u65e5\u5fd7\u9879\u76ee\u4e0d\u80fd\u6ee1\u8db3\u9700\u6c42\uff1f","text":"

    Fluentd/Fluent-bit

    Fluentd\u57fa\u4e8eRuby\u6027\u80fd\u4e00\u822c\uff0c\u5355\u7ebf\u7a0b\uff1bFluent-bit\u57fa\u4e8eC\uff0c\u5bf9\u4e8e\u6211\u4eec\u7684\u6280\u672f\u6808\u6765\u8bf4\uff0cRuby\u548cC\u7684\u7ef4\u62a4\u548c\u4e8c\u6b21\u5f00\u53d1\u6210\u672c\u6bd4\u8f83\u5927\u3002

    Logstash

    Logstash\u6027\u80fd\u8f83\u5dee\uff0c\u57fa\u4e8eJRuby\u7684\u8d44\u6e90\u5360\u7528\u548c\u635f\u8017\u90fd\u6bd4\u8f83\u5927\u3002

    Flume

    \u8d44\u6e90\u5360\u7528\u8f83\u5927\uff0c\u6027\u80fd\u4e00\u822c\uff0c\u4e4b\u524d\u6709\u5185\u90e8\u90e8\u95e8\u4f7f\u7528\u8fc7Flume\uff0c\u5bf9\u6bd4\u7684\u538b\u6d4b\u7ed3\u8bba\u8bc1\u5b9e\u786e\u5b9e\u4e0d\u5982Filebeat\u3002

    \u6700\u91cd\u8981\u7684\u662f\uff0c\u76ee\u524d\u6240\u6709\u7684\u5f00\u6e90Agent\uff0c\u5747\u6ca1\u6709\u5bf9K8s\u6709\u5f88\u597d\u7684\u539f\u751f\u652f\u6301\uff0c\u4e2a\u522b\u652f\u6301\u7684\u4e5f\u53ea\u80fd\u91c7\u96c6stdout\u7684\u65e5\u5fd7\u3002 \u6b63\u662f\u7531\u4e8e\u76ee\u524d\u5f00\u6e90\u7684Agent\u5b58\u5728\u4e00\u4e9b\u95ee\u9898\uff0c\u4e0d\u80fd\u6ee1\u8db3\u957f\u671f\u7684\u9700\u6c42\uff0c\u6240\u4ee5\u6211\u4eec\u51b3\u5b9a\u5f00\u59cb\u81ea\u7814\u3002

    "},{"location":"user-guide/architecture/background/#agent","title":"\u4e09\u3001\u4ec0\u4e48\u624d\u662f\u6211\u4eec\u7406\u60f3\u4e2d\u7684\u65e5\u5fd7Agent\uff1f","text":"

    \u6574\u4f53\u7684\u76ee\u6807\uff1a \u9ad8\u6027\u80fd\u3001\u8d44\u6e90\u5360\u7528\u4f4e\u3001\u9ad8\u53ef\u7528\u3001\u7a33\u5b9a\u6027\u5f3a\u3001\u53ef\u6269\u5c55\u6027\u5f3a\u3001\u66f4\u9002\u5408\u4e91\u539f\u751f\u3002

    \u6027\u80fd\u4e0e\u8d44\u6e90\uff1a \u6027\u80fd\u76f8\u540c\u7684\u60c5\u51b5\u4e0b\uff0cCPU\u6bd4\u793e\u533aFilebeat\u5927\u5927\u964d\u4f4e\uff0c\u541e\u5410\u91cf\u4e0a\u9650\u8981\u8fdc\u9ad8\u4e8eFilebeat\u3002

    \u9ad8\u53ef\u7528\u3001\u7a33\u5b9a\u6027\u5f3a\uff1a \u8d44\u6e90\u9694\u79bb\uff0c\u4f5c\u4e3a\u57fa\u7840\u8bbe\u65bd\u4e00\u5b9a\u8981\u7a33\u5b9a\u53ef\u9760\uff0c\u540c\u65f6\u9ed8\u8ba4\u652f\u6301\u5927\u91cf\u76d1\u63a7\u6307\u6807\uff0c\u5bf9\u5e38\u89c1\u7684\u8fd0\u7ef4\u7c7b\u95ee\u9898\u6709\u826f\u597d\u7684\u652f\u6491\uff0c\u51cf\u5c11\u8fd0\u7ef4\u8d1f\u62c5\u3002

    \u53ef\u6269\u5c55\u6027\uff1a \u6574\u4f53\u8bbe\u8ba1\u4e0a\uff0c\u65b9\u4fbf\u7528\u6237\u6269\u5c55\uff0c\u5b9e\u73b0\u8fc7\u6ee4\u3001\u8def\u7531\u3001\u7f16\u7801\u7b49\u80fd\u529b\u3002\u6bd4\u5982\u53ef\u4ee5\u5f88\u5feb\u901f\u7684\u5199\u4e00\u4e2a\u5904\u7406\u903b\u8f91\uff0c\u5c31\u53ef\u4ee5\u8fdb\u884c\u6570\u636e\u5904\u7406\u3002

    \u603b\u7ed3\u4e00\u4e0b\uff0c\u6211\u4eec\u7406\u60f3\u4e2d\u7684\u65e5\u5fd7Agent\u662f\u4e00\u4e2a\uff1a

    1. \u5f00\u7bb1\u5373\u7528\uff1a\u53ef\u5feb\u901f\u90e8\u7f72\u5bb9\u5668\u5316\u573a\u666f\u4e0b\u7684\u65e5\u5fd7\u91c7\u96c6\u670d\u52a1\uff1b\u6709\u5b8c\u5584\u7684\u6587\u6863\u4e0e\u7ecf\u9a8c\u4ecb\u7ecd\uff1b
    2. \u9ad8\u6027\u80fd\uff1a\u6bd4\u539f\u751fFilebeat\u6027\u80fd\u9ad8\uff0c\u8d44\u6e90\u5360\u7528\u5c11\uff1b
    3. \u9ad8\u53ef\u9760\uff1a\u9694\u79bb\u6027\u7a33\u5b9a\u6027\u66f4\u5f3a\uff1b\u9ed8\u8ba4\u96c6\u6210\u66f4\u591a\u7684\u76d1\u63a7\u6307\u6807\uff0c\u65b9\u4fbf\u8fd0\u7ef4\u6392\u969c\uff1b
    4. \u53ef\u6269\u5c55\uff1a\u57fa\u4e8e\u5fae\u5185\u6838\u7684\u67b6\u6784\uff0c\u7528\u6237\u53ef\u65b9\u4fbf\u5feb\u6377\u7684\u5199\u81ea\u5df1\u7684\u63d2\u4ef6\uff0c\u6ee1\u8db3\u5404\u79cd\u5b9a\u5236\u5316\u9700\u6c42\uff1b
    "},{"location":"user-guide/architecture/compare/","title":"\u5f00\u6e90\u9879\u76ee\u5bf9\u6bd4","text":"Loggie Filebeat Fluentd Logstash Flume \u5f00\u53d1\u8bed\u8a00 Golang Golang Ruby JRuby Java \u591aPipeline \u652f\u6301 \u5355\u961f\u5217 \u5355\u961f\u5217 \u652f\u6301 \u652f\u6301 \u591a\u8f93\u51fa\u6e90 \u652f\u6301 \u4e0d\u652f\u6301\uff0c\u4ec5\u4e00\u4e2aOutput \u914d\u7f6ecopy \u652f\u6301 \u652f\u6301 \u4e2d\u8f6c\u673a \u652f\u6301 \u4e0d\u652f\u6301 \u652f\u6301 \u652f\u6301 \u652f\u6301 \u65e5\u5fd7\u62a5\u8b66 \u652f\u6301 \u4e0d\u652f\u6301 \u4e0d\u652f\u6301 \u4e0d\u652f\u6301 \u4e0d\u652f\u6301 Kubernetes\u5bb9\u5668\u65e5\u5fd7\u91c7\u96c6 \u652f\u6301\u5bb9\u5668\u7684stdout\u548c\u5bb9\u5668\u5185\u90e8\u65e5\u5fd7\u6587\u4ef6 \u53ea\u652f\u6301\u5bb9\u5668stdout \u53ea\u652f\u6301\u5bb9\u5668stdout \u4e0d\u652f\u6301 \u4e0d\u652f\u6301 \u914d\u7f6e\u4e0b\u53d1 Kubernetes\u4e0b\u53ef\u901a\u8fc7CRD\u914d\u7f6e\uff0c\u4e3b\u673a\u573a\u666f\u914d\u7f6e\u4e2d\u5fc3\u9646\u7eed\u652f\u6301\u4e2d \u624b\u52a8\u914d\u7f6e \u624b\u52a8\u914d\u7f6e \u624b\u52a8\u914d\u7f6e \u624b\u52a8\u914d\u7f6e \u76d1\u63a7 \u539f\u751f\u652f\u6301Prometheus metrics\uff0c\u540c\u65f6\u53ef\u914d\u7f6e\u5355\u72ec\u8f93\u51fa\u6307\u6807\u65e5\u5fd7\u6587\u4ef6\u3001\u53d1\u9001metrics\u7b49\u65b9\u5f0f API\u63a5\u53e3\u66b4\u9732\uff0c\u63a5\u5165Prometheus\u9700\u4f7f\u7528\u989d\u5916\u7684exporter \u652f\u6301API\u548cPrometheus metrics \u9700\u4f7f\u7528\u989d\u5916\u7684exporter \u9700\u4f7f\u7528\u989d\u5916\u7684exporter \u8d44\u6e90\u5360\u7528 \u4f4e \u4f4e \u4e00\u822c \u8f83\u9ad8 \u8f83\u9ad8"},{"location":"user-guide/architecture/compare/#_2","title":"\u57fa\u51c6\u6027\u80fd\u6d4b\u8bd5\u4e0e\u5bf9\u6bd4","text":"

    \u6d4b\u8bd5\u73af\u5883\uff1a

    \u6d4b\u8bd5\u76ee\u7684\uff1a

    Filebeat\u548cLoggie\u7684\u6027\u80fd\u5bf9\u6bd4

    \u6d4b\u8bd5\u601d\u8def\uff1a

    Filebeat\u548cLoggie\uff0c\u5747\u91c7\u96c6\u65e5\u5fd7\u53d1\u9001\u81f3Kafka\uff0c\u89c2\u5bdf\u76f8\u5e94\u7684\u8d44\u6e90\u5360\u7528\u548c\u53d1\u9001\u541e\u5410\u91cf

    \u6d4b\u8bd5\u8be6\u60c5\uff1a

    \u5355\u6587\u4ef6\u81ea\u52a8\u751f\u62105000000\u884c\u65e5\u5fd7\uff0c\u6bcf\u884c\u5185\u5bb9\u5982\u4e0b\u6240\u793a\uff1a

    [13/May/2021:10:20:29 +0800] 0.015 10.200.170.107 \"GET /static/3tJHS3Ubrf.html?activity_channel_id=22=1_00000&fromMiniapp=1&miniapp_uuid=uEd93lG2eG8Qj5fRXuiJwNt4bmiylkmg HTTP/1.1\" 200 138957 \"110.183.45.54, 10.200.151.37\" act.you.163.com \"\" \"Mozilla/5.0 (Linux; Android 8.1.0; PADM00Build/O11019; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 XWEB/568 MMWEBSDK/190102 Mobile Safari/537.36 MMWEBID/6881 MicroMessenger/7.0.3.1400(0x2700033B) Process/appbrand0 NetType/WIFI Language/zh_CN miniProgram\" \"\" [127.0.0.1:8990] [0.014] [] [] immsg={\"st\":1553307293614,\"sb\":138963,\"rc\":200,\"cf\":{\"sr\":1},\"if\":\"default\",\"ut\":14,\"sv\":\"static\",\"pd\":\"activity\",\"qb\":764}\n

    \u914d\u7f6eFilebeat\u548cLoggie\u91c7\u96c6\u65e5\u5fd7\uff0c\u5e76\u53d1\u9001\u81f3Kafka\u67d0\u4e2aTopic\uff0c\u4e0d\u4f7f\u7528\u5ba2\u6237\u7aef\u538b\u7f29\uff0cKafka Topic\u914d\u7f6ePartition\u4e3a3\u3002

    \u5728\u4fdd\u8bc1Agent\u89c4\u683c\u8d44\u6e90\u5145\u8db3\u7684\u60c5\u51b5\u4e0b\uff0c\u4fee\u6539\u91c7\u96c6\u7684\u6587\u4ef6\u4e2a\u6570\u3001\u53d1\u9001\u5ba2\u6237\u7aef\u5e76\u53d1\u5ea6\uff08\u914d\u7f6eFilebeat worker\u548cLoggie parallelism)\uff0c\u89c2\u5bdf\u5404\u81ea\u7684CPU\u3001Memory\u548cPod\u7f51\u5361\u53d1\u9001\u901f\u7387\u3002

    \u6d4b\u8bd5\u5f97\u5230\u5982\u4e0b\u6570\u636e\uff1a

    Agent \u6587\u4ef6\u5927\u5c0f \u65e5\u5fd7\u6587\u4ef6\u6570 \u53d1\u9001\u5e76\u53d1\u5ea6 CPU MEM (rss) \u7f51\u5361\u53d1\u5305\u901f\u7387 Filebeat 3.2G 1 3 7.5~8.5c 63.8MiB 75.9MiB/s Filebeat 3.2G 1 8 10c 65MiB 70MiB/s Filebeat 3.2G 10 8 11c 65MiB 80MiB/s Loggie 3.2G 1 3 2.1c 60MiB 120MiB/s Loggie 3.2G 1 8 2.4c 68.7MiB 120MiB/s Loggie 3.2G 10 8 3.5c 70MiB 210MiB/s

    \u6d4b\u8bd5\u7ed3\u8bba\uff1a

    \u76f8\u540c\u538b\u6d4b\u6761\u4ef6\u548c\u573a\u666f\u4e0b\uff1a

    "},{"location":"user-guide/architecture/core-arch/","title":"\u8bbe\u8ba1\u67b6\u6784","text":""},{"location":"user-guide/architecture/core-arch/#_2","title":"\u5185\u90e8\u8bbe\u8ba1","text":"

    Loggie\u8be6\u7ec6\u7684\u8bbe\u8ba1\u5982\u4e0b\u56fe\u6240\u793a\uff1a

    \u6570\u636e\u94fe\u8def:

    \u63a7\u5236\u94fe\u8def:

    "},{"location":"user-guide/architecture/core-arch/#_3","title":"\u4f7f\u7528\u5f62\u6001","text":"

    \u672c\u8d28\u4e0aLoggie\u662f\u4e00\u4e2a\u6570\u636e\u4f20\u8f93\u6d41\u5f0f\u8bbe\u8ba1\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u7075\u6d3b\u7684\u4f7f\u7528Loggie\u7684Pipeline\u3002\u4ece\u4f7f\u7528\u5f62\u6001\u4e0a\u53ef\u5206\u4e3a\uff1a

    \u9664\u4e86\u65e5\u5fd7\u91c7\u96c6\uff0c\u5f88\u591a\u6d89\u53ca\u5230\u6570\u636e\u4f20\u8f93\u3001\u8f6c\u6362\u7684\u573a\u666f\uff0c\u90fd\u53ef\u4ee5\u8003\u8651\u4f7f\u7528Loggie\uff0c\u5373\u4f7fLoggie\u6ca1\u6709\u4f60\u60f3\u8981\u7684\u7ec4\u4ef6\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5feb\u901f\u5f00\u53d1\u4e00\u4e2asource\u3001sink\u6216interceptor\uff0c\u540c\u65f6\u590d\u7528Loggie\u7684\u5f88\u591a\u80fd\u529b\uff0c\u907f\u514d\u91cd\u590d\u7684\u5f00\u53d1\u5de5\u4f5c\uff0c\u6bd4\u5982\uff1a

    "},{"location":"user-guide/architecture/core-arch/#_4","title":"\u5e94\u7528\u573a\u666f","text":""},{"location":"user-guide/architecture/schema/","title":"\u6570\u636e\u683c\u5f0f","text":"

    Info

    \u4e86\u89e3Loggie\u5185\u90e8\u6570\u636e\u683c\u5f0f\u7684\u8bbe\u8ba1\uff0c\u80fd\u5e2e\u52a9\u6211\u4eec\u914d\u7f6e\u5408\u9002\u7684\u65e5\u5fd7\u5904\u7406\u548c\u65e5\u5fd7\u683c\u5f0f\u8f6c\u6362

    "},{"location":"user-guide/architecture/schema/#_2","title":"\u7ed3\u6784\u8bbe\u8ba1","text":"

    \u5728Loggie\u5185\u90e8\u7684\u65e5\u5fd7\u6570\u636e\uff0c\u5305\u62ec\uff1a

    "},{"location":"user-guide/architecture/schema/#_3","title":"\u683c\u5f0f\u8f6c\u6362","text":"

    \u5982\u679c\u4ee5\u4e0a\u7684\u683c\u5f0f\u4e0d\u6ee1\u8db3\u9700\u6c42\uff0c\u53ef\u4ee5\u53c2\u8003\uff1a

    "},{"location":"user-guide/architecture/schema/#_4","title":"\u65e5\u5fd7\u5207\u5206","text":"

    \u5bf9\u4e8e\u539f\u59cb\u65e5\u5fd7\u6570\u636e\u7684\u5207\u5206\u4e0e\u5904\u7406\uff0c\u8bf7\u4f7f\u7528 normalize interceptor\uff0c\u8bf7\u53c2\u8003\uff1a

    "},{"location":"user-guide/best-practice/aggregator/","title":"\u4f7f\u7528Loggie\u4e2d\u8f6c\u673a","text":"

    Loggie\u53ef\u4ee5\u90e8\u7f72\u4e3aAgent\uff0c\u540c\u65f6\u652f\u6301\u72ec\u7acb\u90e8\u7f72\uff0c\u8fdb\u884c\u805a\u5408\u3001\u8f6c\u53d1\u548c\u5904\u7406\u3002

    "},{"location":"user-guide/best-practice/aggregator/#_1","title":"\u51c6\u5907\uff1a\u9009\u62e9\u67b6\u6784","text":"

    \u4f7f\u7528\u4e2d\u8f6c\u673a\u67b6\u6784\u7684\u65b9\u5f0f\u4e00\u822c\u6709\u591a\u79cd\uff0c\u5e38\u89c1\u7684\u6709\uff1a

    \u662f\u5426\u5f15\u5165Kafka\u7b49\u6d88\u606f\u961f\u5217\uff0c\u4e3b\u8981\u53d6\u51b3\u4e8e\u81ea\u8eab\u7684\u573a\u666f\u9700\u6c42\u548c\u6570\u636e\u7684\u91cf\u7ea7\u3002

    "},{"location":"user-guide/best-practice/aggregator/#_2","title":"\u51c6\u5907\uff1a\u90e8\u7f72","text":"
    1. \u90e8\u7f72Agent

    2. \u90e8\u7f72Aggregator

    \u90e8\u7f72\u4e3aAggregator\u7c7b\u578b\u65f6\uff0c\u8bf7\u52a1\u5fc5\u5728Kubernetes\u914d\u7f6e\u4e2d\u6307\u5b9acluster\u96c6\u7fa4\u540d\u79f0\u3002

    "},{"location":"user-guide/best-practice/aggregator/#_3","title":"\u914d\u7f6e\u4f7f\u7528","text":""},{"location":"user-guide/best-practice/aggregator/#agent","title":"Agent","text":"

    \u91c7\u96c6\u65e5\u5fd7\u7684LogConfig\u914d\u7f6e\u65e0\u533a\u522b\uff0c\u53ea\u9700\u8981\u4fee\u6539sink\u53d1\u9001\u81f3Loggie Aggregator\u6216\u8005Kafka\u5373\u53ef\u3002

    \u88ab\u91c7\u96c6\u7684\u5bb9\u5668\u521b\u5efa\u4ee5\u53ca\u5339\u914d\u7684LogConfig\uff0c\u8bf7\u53c2\u8003Loggie\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\u3002

    \u8fd9\u91cc\u6211\u4eec\u5c06\u5176\u4e2d\u7684sink\u4fee\u6539\u4e3a\u4ee5\u4e0b\u793a\u4f8b\uff1a

    Example

    AggregatorKafka
    apiVersion: loggie.io/v1beta1\nkind: Sink\nmetadata:\nname: aggregator\nspec:\nsink: |\ntype: grpc\nhost: \"loggie-aggregator.loggie-aggregator:6066\"\n
    apiVersion: loggie.io/v1beta1\nkind: Sink\nmetadata:\nname: kafka\nspec:\nsink: |\ntype: kafka\nbrokers: [\"127.0.0.1:6400\"]\ntopic: \"log-${fields.topic}\"\n
    "},{"location":"user-guide/best-practice/aggregator/#aggregator","title":"Aggregator","text":"

    \u914d\u7f6eLogConfig\u4e0b\u53d1\u81f3Aggregator\u672c\u8d28\u4e0a\u548cAgent\u4fa7\u65e0\u533a\u522b\uff0c\u53ea\u9700\u8981\u4fee\u6539\u5176\u4e2dselector\u90e8\u5206\u3002

    \u7c7b\u4f3c\u5982\u4e0b\uff1a

    Example

    apiVersion: loggie.io/v1beta1\nkind: ClusterLogConfig\nmetadata:\nname: aggre\nspec:\nselector:\ntype: cluster\ncluster: aggregator\npipeline:\nsources: |\n- type: grpc\nname: rec1\nport: 6066\nsinkRef: dev\n
    apiVersion: loggie.io/v1beta1\nkind: Sink\nmetadata:\nname: dev\nspec:\nsink: |\ntype: dev\nprintEvents: true\ncodec:\ntype: json\npretty: true\n

    type: cluster\u8868\u793a\u9009\u62e9\u4e0b\u53d1\u914d\u7f6e\u5230cluster\u6307\u5b9a\u7684Loggie\u96c6\u7fa4\uff0c\u5373\u6211\u4eec\u521a\u90e8\u7f72\u7684\u4e2d\u8f6c\u673a\u96c6\u7fa4\uff0c\u5982\u679c\u4e0d\u586b\u5199\u4f1a\u5c06\u914d\u7f6e\u6307\u5b9a\u5230\u9ed8\u8ba4\u7684Agent\u96c6\u7fa4\uff0c\u5bfc\u81f4\u65e0\u6cd5\u751f\u6548\u3002

    \u8fd9\u91cc\u7684source\u4e3aGrpc\uff0c\u63a5\u6536Agent Grpc sink\u53d1\u51fa\u7684\u6570\u636e\uff0c\u7136\u540e\u8f6c\u53d1\u81f3\u81ea\u8eabsinkRef\u6307\u5b9a\u7684sink\u4e2d\u3002\u8fd9\u91cc\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2adev sink\u7528\u4e8e\u67e5\u770b\u4e2d\u8f6c\u673a\u8f93\u51fa\u7684\u6570\u636e\u3002

    "},{"location":"user-guide/best-practice/aggregator/#_4","title":"\u67e5\u770b\u65e5\u5fd7","text":"

    \u901a\u8fc7kubectl -nloggie-aggregator logs -f <podName> --tail=200\u547d\u4ee4\u3002 \u53ef\u4ee5\u5728\u4e2d\u8f6c\u673a\u8282\u70b9\u4e0a\u67e5\u770b\u5230\u7c7b\u4f3c\u5982\u4e0b\u65e5\u5fd7\uff1a

    events

    2021-12-20 09:58:50 INF go/src/loggie.io/loggie/pkg/sink/dev/sink.go:98 > event: {\n\"body\": \"14-Dec-2021 06:19:58.306 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [141] milliseconds\",\n\"fields\": {\n\"podname\": \"tomcat-684c698b66-gkrfs\",\n\"containername\": \"tomcat\",\n\"logconfig\": \"tomcat\",\n\"namespace\": \"default\",\n\"nodename\": \"kind-control-plane\"\n},\n}\n
    "},{"location":"user-guide/best-practice/concurrency/","title":"\u81ea\u9002\u5e94sink\u6d41\u91cf\u63a7\u5236","text":"

    \u5728\u65e5\u5fd7\u88ab\u53d1\u9001\u81f3\u4e0b\u6e38\u670d\u52a1\u65f6\uff0c\u5e76\u53d1\u5ea6\u53ef\u4ee5\u88ab\u63a7\u5236\u3002\u4f46\u8d77\u7801\u6709\u4ee5\u4e0b\u4e24\u70b9\u4f1a\u5bf9\u5b9e\u9645\u60c5\u51b5\u9020\u6210\u5f71\u54cd\uff1a\u4e0b\u6e38\u670d\u52a1\u5668\u662f\u5426\u6709\u538b\u529b\uff0c\u6570\u636e\u53d1\u9001\u662f\u5426\u6709\u538b\u529b\u3002\u8fd9\u4e24\u70b9\u662f\u5b9e\u65f6\u53d8\u5316\u7684\uff0c\u4e00\u4e2a\u5b9a\u503c\u5f88\u96be\u957f\u671f\u6ee1\u8db3\u5b9e\u9645\u9700\u6c42\u3002

    \u81ea\u9002\u5e94sink\u6d41\u91cf\u63a7\u5236\u529f\u80fd\u53ef\u4ee5\uff1a

    \u914d\u7f6e\u7ec6\u8282\u53ef\u53c2\u8003sink concurrency\u3002

    "},{"location":"user-guide/best-practice/concurrency/#_1","title":"\u5173\u952e\u8bcd","text":""},{"location":"user-guide/best-practice/concurrency/#_2","title":"\u5b9e\u73b0\u601d\u8def","text":"

    \u6838\u5fc3\u662f\u6a21\u4efftcp\u6d41\u91cf\u63a7\u5236\uff0c\u5e76\u6839\u636eloggie\u81ea\u8eab\u505a\u8c03\u6574\u3002

    1. \u5feb\u901f\u542f\u52a8\u9636\u6bb5

    2. \u5feb\u901f\u542f\u52a8\u7ed3\u675f

    3. \u5e73\u7a33\u9636\u6bb5

    4. \u5176\u4ed6\u7ec6\u8282

    "},{"location":"user-guide/best-practice/concurrency/#_3","title":"\u4f7f\u7528\u6848\u4f8b\u4e0e\u89e3\u8bfb","text":""},{"location":"user-guide/best-practice/concurrency/#_4","title":"\u4e0b\u6e38\u670d\u52a1\u5668","text":"

    \u4e0b\u6e38\u989d\u5916\u642d\u5efa\u4e86\u672c\u5730\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u81ea\u7531\u8c03\u6574rtt\u503c\uff0c\u7528\u6765\u6a21\u62df\u7f51\u7edc\u6ce2\u52a8\u3002

    \u52a0\u5165\u4e86\u968f\u673a\u7684\u5931\u8d25\u8fd4\u56de\uff0c\u6982\u7387\u53ef\u4ee5\u8bbe\u5b9a\u3002

    \u963b\u585e\u60c5\u51b5\u7528\u5927\u5e45\u589e\u5927rtt\u60c5\u51b5\u6765\u6a21\u62df\uff0c\u7531\u4e8erttT\u7684\u4e0d\u662f\u56fa\u5b9a\u7684\u503c\uff0c\u6240\u4ee5\u5f53rtt\u7a33\u5b9a\u540e\uff0c\u4e0d\u4f1a\u5bf9\u5224\u65ad\u903b\u8f91\u6709\u5f71\u54cd\u3002

    "},{"location":"user-guide/best-practice/concurrency/#_5","title":"\u914d\u7f6e","text":"

    Config

    concurrency:\nenable: true\ngoroutine:\ninitThreshold: 16\nmaxGoroutine: 30\nunstableTolerate: 3\nchannelLenOfCap: 0.4\nrtt:\nblockJudgeThreshold: 120%\nnewRttWeigh: 0.5\nratio:\nmulti: 2\nlinear: 2\nlinearWhenBlocked: 4\nduration:\nunstable: 15\nstable: 30\n
    "},{"location":"user-guide/best-practice/concurrency/#_6","title":"\u6848\u4f8b\u4e00","text":"

    \u6a21\u62df\u4e0b\u6e38\u670d\u52a1\u6ca1\u6709\u8fd4\u56de\u9519\u8bef\u60c5\u51b5\uff0c\u4ec5\u8c03\u6574rtt\uff0c\u6d4b\u8bd5\u7b97\u6cd5\u5bf9\u7f51\u7edc\u5ef6\u8fdf\u7684\u54cd\u5e94\u3002

    \u89e3\u8bfb

    "},{"location":"user-guide/best-practice/concurrency/#_7","title":"\u6848\u4f8b\u4e8c","text":"

    \u5728\u6848\u4f8b\u4e00\u7684\u57fa\u7840\u4e0a\uff0c\u6a21\u62df\u4e0b\u6e38\u6709\u9519\u8bef\u8fd4\u56de\u7684\u60c5\u51b5\uff0c\u6982\u7387\u8bbe\u5b9a\u4e3a0.15%\u3002

    \u89e3\u8bfb

    Info

    \u6b64\u529f\u80fd\u5728\u8bd5\u9a8c\u9636\u6bb5\uff0c\u9ed8\u8ba4\u4e3a\u5173\u95ed\uff0c\u6b22\u8fce\u4ea4\u6d41\u8ba8\u8bba\u3002

    "},{"location":"user-guide/best-practice/log-collect-rotate/","title":"\u65e5\u5fd7rotate\u548c\u65e5\u5fd7\u91c7\u96c6","text":""},{"location":"user-guide/best-practice/log-collect-rotate/#_1","title":"\u4e24\u79cd\u5207\u5272\u6a21\u5f0f","text":""},{"location":"user-guide/best-practice/log-collect-rotate/#11create","title":"1.1\u3001create\u6a21\u5f0f","text":"

    1\u3001\u9996\u5148\u91cd\u547d\u540d\u5f53\u524d\u8fdb\u7a0b\u6b63\u5728\u8f93\u51fa\u7684\u65e5\u5fd7\u6587\u4ef6\u540d\u79f0\uff0c\u56e0\u4e3a\u8fdb\u7a0b\u662f\u6839\u636e inode \u53f7\u6765\u786e\u5b9a\u5f80\u54ea\u4e2a\u65e5\u5fd7\u6587\u4ef6\u8f93\u51fa\uff0c\u66f4\u6539\u65e5\u5fd7\u6587\u4ef6\u540d\u79f0\u5e76\u4e0d\u4f1a\u5f71\u54cdinode\u53f7\uff0c\u6240\u4ee5\u8fd9\u6b65\u884c\u4e3a\u4e2d\uff0c\u8fdb\u7a0b\u4f9d\u65e7\u4f1a\u5f80\u4fee\u6539\u4e86\u540d\u79f0\u7684\u65e5\u5fd7\u6587\u4ef6\u5185\u8f93\u51fa\u65e5\u5fd7\u3002

    2\u3001\u8fdb\u884c\u65b0\u7684\u65e5\u5fd7\u521b\u5efa\uff0c\u521b\u5efa\u65b0\u7684\u65e5\u5fd7\u540d\u79f0\u548c\u8001\u65e7\u7684\u65e5\u5fd7\u540d\u79f0\u4e00\u6837\uff0c\u4f46\u662f\u56e0\u4e3a\u662f\u65b0\u5efa\u7684\u3002\u6240\u4ee5inode\u53f7\u4e0d\u4e00\u6837\u3002\u6b64\u65f6\u8fdb\u7a0b\u65e5\u5fd7\u8fd8\u662f\u4f9d\u65e7\u8f93\u51fa\u5230\u8001\u7684\u88ab\u91cd\u547d\u540d\u4e86\u7684\u65e5\u5fd7\u6587\u4ef6\u91cc\u9762\u3002

    3\u3001\u5bf9\u8fdb\u7a0b\u53d1\u8d77\u4fe1\u53f7\u901a\u77e5\uff0c\u8ba9\u5176\u91cd\u65b0\u5199\u65e5\u5fd7\u3002

    \u5e38\u7528\u7684logback\u5c31\u662f\u57fa\u4e8e\u8be5\u6a21\u5f0f\u3002

    "},{"location":"user-guide/best-practice/log-collect-rotate/#12copytruncate","title":"1.2\u3001copytruncate\u6a21\u5f0f","text":"

    1\u3001copy\u5f53\u524d\u65e5\u5fd7\u6587\u4ef6\uff0c\u91cd\u547d\u540d\u4e3a\u65b0\u6587\u4ef6\uff0c\u8fd9\u6837\u8fdb\u7a0b\u8fd8\u662f\u5f80\u8001\u7684\u6587\u4ef6\u5199\u5165\u3002

    2\u3001\u7136\u540elogrotate\u5bf9\u8001\u6587\u4ef6\u8fdb\u884ctruncate\uff0c\u5bf9\u8001\u6587\u4ef6\u8fdb\u884c\u6e05\u7a7a\u3002\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86\u4e00\u6b21\u65e5\u5fd7\u5207\u5272\u3002

    \u8fd9\u79cd\u65e5\u5fd7\u5207\u5272\u4e0d\u9700\u8981\u5bf9\u8fdb\u7a0b\u53d1\u8d77\u91cd\u8f7d\u4fe1\u53f7\u3002

    \u98ce\u9669\uff1a

    Caution

    \u4e00\u822c\u4e0d\u5efa\u8bae\u4f7f\u7528copytruncate\u6a21\u5f0f\uff0c\u5982\u679c\u4f7f\u7528Loggie\u91c7\u96c6copytruncate\u6a21\u5f0f\u5207\u5272\u7684\u65e5\u5fd7\uff0cfile source\u7684path\u8bf7\u914d\u7f6e\u5177\u4f53\u5199\u5165\u7684\u6587\u4ef6\u540d\u79f0\u3002

    \u6bd4\u5982\u4e00\u76f4\u5199\u5165app.log\uff0c\u5207\u5272\u540e\u7684\u6587\u4ef6\u4e3aapp-1.log\uff0capp-2.log\u7b49\uff0c\u8bf7\u914d\u7f6epath\u4e3aapp.log\uff0c\u800c\u4e0d\u662f*.log\uff0c\u56e0\u4e3acopy\u4e4b\u540e\u662f\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\uff0c\u7531\u4e8eLoggie\u6839\u636einode+deviceId\u7b49\u6765\u8bc6\u522b\u6587\u4ef6\u7684\u552f\u4e00\u6027\u800c\u4e0d\u662f\u6587\u4ef6\u540d\uff0c\u5982\u679c\u5339\u914d\u5230\u5207\u5272\u540e\u7684\u6587\u4ef6\uff0c\u4f1a\u91cd\u590d\u91c7\u96c6\u8fd9\u90e8\u5206\u7684\u65e5\u5fd7\u3002

    "},{"location":"user-guide/best-practice/log-enrich/","title":"\u65e5\u5fd7\u683c\u5f0f\u4e0e\u5143\u4fe1\u606f\u5b57\u6bb5","text":"

    \u5efa\u8bae\u5148\u4e86\u89e3Loggie\u5185\u90e8\u65e5\u5fd7\u6570\u636eschema\u8bbe\u8ba1\u3002

    Loggie\u90e8\u7f72\u5728\u4e0d\u540c\u7684\u73af\u5883\u4e2d\uff0c\u5982\u679c\u9700\u8981\u5728\u539f\u59cb\u7684\u65e5\u5fd7\u6570\u636e\u91cc\uff0c\u589e\u52a0\u4e00\u4e9b\u5143\u4fe1\u606f\uff0c\u540c\u65f6\u517c\u5bb9\u5df2\u6709\u7684\u683c\u5f0f\uff0c\u53ef\u4ee5\u53c2\u8003\u5982\u4e0b\u7684\u529e\u6cd5\u3002

    "},{"location":"user-guide/best-practice/log-enrich/#_2","title":"\u5b57\u6bb5\u683c\u5f0f\u8f6c\u6362","text":""},{"location":"user-guide/best-practice/log-enrich/#schema-interceptor","title":"\u4f7f\u7528schema interceptor","text":"

    \u4f7f\u7528schema interceptor\u53ef\u4ee5\u589e\u52a0\u65f6\u95f4\u5b57\u6bb5\uff0c\u4ee5\u53capipelineName\u4e0esourceName\u5b57\u6bb5\u3002\u53e6\u5916\u8fd8\u53ef\u4ee5\u5bf9\u5b57\u6bb5\u8fdb\u884c\u91cd\u547d\u540d\uff0c\u6bd4\u5982\u4fee\u6539body\u4e3amessage\u3002 \u8bf7\u53c2\u8003schema interceptor\u3002

    \u7531\u4e8e\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u9700\u8981\u5168\u5c40\u751f\u6548\uff0c\u800c\u4e0d\u662f\u4ec5\u4ec5\u53ea\u5728\u67d0\u4e2apipeline\u91cc\u6dfb\u52a0\u8be5interceptor\uff0c\u6240\u4ee5\u5efa\u8bae\u5728\u7cfb\u7edf\u914d\u7f6e\u7684defaults\u4e2d\u6dfb\u52a0schema interceptor\uff0c \u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u6bcf\u4e2apipeline\u5747\u9700\u914d\u7f6e\u8be5interceptor\u3002

    loggie.yml

    loggie:\ndefaults:\ninterceptors:\n- type: schema\nname: global\norder: 700\naddMeta:\ntimestamp:\nkey: \"@timestamp\"\nremap:\nbody:\nkey: message\n

    \u8fd9\u91cc\u7684name\u662f\u4e3a\u4e86\u589e\u52a0\u6807\u8bc6\uff0c\u907f\u514d\u5982\u679c\u5728pipeline\u4e2d\u53c8\u65b0\u589eschema interceptor\u4f1a\u5bfc\u81f4\u6821\u9a8c\u4e0d\u901a\u8fc7\u3002\u53e6\u5916\u589e\u52a0order\u5b57\u6bb5\u4e3a\u4e00\u4e2a\u8f83\u5c0f\u7684\u503c\uff08\u9ed8\u8ba4\u4e3a900)\uff0c\u8fd9\u6837default\u91cc\u7684interceptor\u4f1a\u4f18\u5148\u4e8epipeline\u91cc\u5b9a\u4e49\u7684\u5176\u4ed6interceptor\u6267\u884c\u3002

    "},{"location":"user-guide/best-practice/log-enrich/#transformer-interceptor","title":"\u4f7f\u7528transformer interceptor","text":"

    tranformer\u63d0\u4f9b\u4e86\u66f4\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u5e94\u5bf9\u590d\u6742\u65e5\u5fd7\u7684\u573a\u666f\u3002 \u5177\u4f53\u8bf7\u53c2\u8003transformer interceptor\u3002

    "},{"location":"user-guide/best-practice/log-enrich/#_3","title":"\u6dfb\u52a0\u5143\u4fe1\u606f","text":""},{"location":"user-guide/best-practice/log-enrich/#fields","title":"\u6dfb\u52a0fields\u81ea\u5b9a\u4e49\u5143\u4fe1\u606f","text":"

    \u5982\u679c\u6211\u4eec\u5728source\u4e0a\u914d\u7f6e\u4e86\u4e00\u4e9b\u81ea\u5b9a\u4e49\u7684fields\u3002

    pipelines.yml

    pipelines:\n- name: local\nsources:\n- type: file\nname: demo\npaths:\n- /tmp/log/*.log\nfields:\ntopic: \"loggie\"\n\nsink:\ntype: dev\nprintEvents: true\ncodec:\npretty: true\n

    \u90a3\u4e48sink\u8f93\u51fa\u7684\u4e3a\uff1a

    {\n\"fields\": {\n\"topic\": \"loggie\",\n},\n\"body\": \"01-Dec-2021 03:13:58.298 INFO [main] Starting service [Catalina]\"\n}\n

    \u5f53\u7136\u6211\u4eec\u4e5f\u53ef\u4ee5\u914d\u7f6efieldsUnderRoot: true\uff0c\u8ba9fields\u91cc\u7684key:value\u548cbody\u540c\u4e00\u5c42\u7ea7\u3002

    pipelines.yml

    pipelines:\n- name: local\nsources:\n- type: file\nfields:\ntopic: \"loggie\"\nfieldsUnderRoot: true\n...\n
    {\n\"topic\": \"loggie\",\n\"body\": \"01-Dec-2021 03:13:58.298 INFO [main] Starting service [Catalina]\"\n}\n
    "},{"location":"user-guide/best-practice/log-enrich/#file-source","title":"\u6dfb\u52a0\u65e5\u5fd7\u91c7\u96c6file source\u7684\u72b6\u6001\u4fe1\u606f","text":"

    \u5728\u6211\u4eec\u4f7f\u7528file source\u65f6\uff0c\u53ef\u80fd\u5e0c\u671b\u81ea\u52a8\u5728\u65e5\u5fd7\u539f\u59cb\u6570\u636e\u91cc\uff0c\u589e\u52a0\u4e00\u4e9b\u65e5\u5fd7\u91c7\u96c6\u7684\u72b6\u6001\uff0c\u6bd4\u5982\u91c7\u96c6\u7684\u6587\u4ef6\u540d\u79f0\u3001\u91c7\u96c6\u7684\u6587\u4ef6offsest\u7b49\uff0cfile source\u63d0\u4f9b\u4e86\u4e00\u4e2aaddonMeta\u914d\u7f6e\uff0c\u53ef\u5feb\u901fenable\u3002

    \u793a\u4f8b\uff1a\u6dfb\u52a0\u5982\u4e0baddonMeta\uff0c\u5e76\u8bbe\u7f6e\u4e3atrue\u3002

    file source

    sources:\n- type: file\npaths:\n- /var/log/*.log\naddonMeta: true\n

    \u6b64\u65f6\uff0c\u91c7\u96c6\u7684event\u4f1a\u53d8\u6210\u7c7b\u4f3c\u5982\u4e0b\uff1a

    Example

    {\n\"body\": \"this is test\",\n\"state\": {\n\"pipeline\": \"local\",\n\"source\": \"demo\",\n\"filename\": \"/var/log/a.log\",\n\"timestamp\": \"2006-01-02T15:04:05.000Z\",\n\"offset\": 1024,\n\"bytes\": 4096,\n\"hostname\": \"node-1\"\n}\n}\n

    \u5177\u4f53\u5b57\u6bb5\u542b\u4e49\u53ef\u53c2\u8003file source

    "},{"location":"user-guide/best-practice/log-enrich/#kubernetes","title":"\u589e\u52a0Kubernetes\u5143\u4fe1\u606f","text":"

    \u5728Kubernetes\u7684\u573a\u666f\u4e2d\uff0c\u91c7\u96c6\u7684\u5bb9\u5668\u65e5\u5fd7\uff0c\u4e3a\u4e86\u5728\u67e5\u8be2\u7684\u65f6\u5019\uff0c\u4f7f\u7528namespace/podName\u7b49\u4fe1\u606f\u8fdb\u884c\u68c0\u7d22\uff0c\u5f80\u5f80\u9700\u8981\u589e\u52a0\u76f8\u5173\u7684\u5143\u6570\u636e\u3002

    \u6211\u4eec\u53ef\u4ee5\u5728\u7cfb\u7edf\u914d\u7f6e\u7684discovery.kubernetes\u4e2d\uff0c\u914d\u7f6e\u989d\u5916\u7684k8s fields\u5b57\u6bb5\u3002

    \u53ef\u53c2\u8003discovery\u3002

    "},{"location":"user-guide/best-practice/log-enrich/#meta","title":"\u6dfb\u52a0meta\u7cfb\u7edf\u5185\u7f6e\u5143\u4fe1\u606f","text":"

    \u6709\u4e00\u4e9bLoggie\u7cfb\u7edf\u5185\u7f6e\u7684\u5143\u4fe1\u606f\uff0c\u6211\u4eec\u4e5f\u5e0c\u671b\u53d1\u9001\u7ed9\u4e0b\u6e38\uff0c\u8fd9\u4e2a\u65f6\u5019\uff0c\u9700\u8981\u4f7f\u7528normalize interceptor\u4e2d\u7684addMeta processors\u3002 \uff08\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8be5\u64cd\u4f5c\u4f1a\u5bf9\u91c7\u96c6\u4f20\u8f93\u6027\u80fd\u6709\u4e00\u5b9a\u5f71\u54cd\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u5e76\u4e0d\u5efa\u8bae\u4f7f\u7528\u8be5\u65b9\u5f0f\uff09

    pipelines.yml

    pipelines:\n- name: local\nsources:\n- type: file\nname: demo\npaths:\n- /tmp/log/*.log\nfields:\ntopic: \"loggie\"\ninterceptors:\n- type: normalize\nprocessors:\n- addMeta: ~\n\nsink:\ntype: dev\nprintEvents: true\ncodec:\npretty: true\n

    \u914d\u7f6e\u4e86addMeta processor\u4e4b\u540e\uff0c\u9ed8\u8ba4\u4f1a\u628a\u6240\u6709\u7684\u7cfb\u7edf\u5185\u7f6e\u5143\u4fe1\u606f\u8f93\u51fa\u3002

    \u9ed8\u8ba4Json\u683c\u5f0f\u8f93\u51fa\u793a\u4f8b\u5982\u4e0b\uff1a

    Example

    {\n\"fields\": {\n\"topic\": \"loggie\"\n},\n\"meta\": {\n\"systemState\": {\n\"nextOffset\": 720,\n\"filename\": \"/tmp/log/a.log\",\n\"collectTime\": \"2022-03-08T11:33:47.369813+08:00\",\n\"contentBytes\": 90,\n\"jobUid\": \"43772050-16777231\",\n\"lineNumber\": 8,\n\"offset\": 630\n},\n\"systemProductTime\": \"2022-03-08T11:33:47.370166+08:00\",\n\"systemPipelineName\": \"local\",\n\"systemSourceName\": \"demo\"\n},\n\"body\": \"01-Dec-2021 03:13:58.298 INFO [main] Starting service [Catalina]\"\n}\n

    \u5f53\u7136\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u89c9\u5f97\u8fd9\u4e9b\u6570\u636e\u592a\u591a\u4e86\uff0c\u6216\u8005\u60f3\u5bf9\u5b57\u6bb5\u8fdb\u884c\u4fee\u6539\u3002\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528transformer interceptor\u91cc\u7684action\u8fdb\u884c\u64cd\u4f5c\u3002

    "},{"location":"user-guide/best-practice/log-process/","title":"\u65e5\u5fd7\u5207\u5206\u5904\u7406","text":"

    Loggie\u53ef\u4f7f\u7528transformer interceptor\u6765\u8fdb\u884c\u65e5\u5fd7\u7684\u5207\u5206\u548c\u5904\u7406\uff0c\u5c06\u65e5\u5fd7\u6570\u636e\u8fdb\u884c\u7ed3\u6784\u5316\u7684\u63d0\u53d6\uff0c\u540c\u65f6\u53ef\u4ee5\u5bf9\u63d0\u53d6\u540e\u7684\u5b57\u6bb5\u8fdb\u884c\u5904\u7406\u3002 \u5efa\u8bae\u5148\u4e86\u89e3Loggie\u5185\u90e8\u65e5\u5fd7\u6570\u636eschema\u8bbe\u8ba1\u3002

    "},{"location":"user-guide/best-practice/log-process/#_2","title":"\u9700\u6c42\u573a\u666f","text":"

    \u6700\u4e3b\u8981\u7684\u662f\u5bf9\u65e5\u5fd7\u8fdb\u884c\u5207\u5206\u89e3\u6790\u63d0\u53d6\u548c\u5904\u7406\u3002

    \u6bd4\u5982\u4ee5\u4e0b\u65e5\u5fd7\uff1a

    01-Dec-2021 03:13:58.298 INFO [main] Starting service [Catalina]\n

    \u6211\u4eec\u53ef\u80fd\u4f1a\u9700\u8981\u5c06\u5176\u4e2d\u7684\u65e5\u671f\u3001\u65e5\u5fd7\u7ea7\u522b\u89e3\u6790\u51fa\u6765\uff0c\u6700\u7ec8\u5f62\u6210\uff1a

    {\n\"time\": \"01-Dec-2021 03:13:58.298\",\n\"level\": \"INFO\",\n\"message\": \"[main] Starting service [Catalina]\"\n}\n

    \u8fd9\u79cd\u7ed3\u6784\u5316\u7684\u6570\u636e\uff0c\u5b58\u50a8\u7684\u65f6\u5019\u4fbf\u4e8e\u8fc7\u6ee4\u67e5\u8be2\uff0c\u6216\u8005\u6839\u636e\u65e5\u5fd7\u91cc\u7684\u65f6\u95f4\u6765\u6392\u5e8f\uff0c\u800c\u4e0d\u662f\u91c7\u96c6\u7684\u65f6\u95f4\u6233\uff0c\u6216\u8005\u6839\u636e\u65e5\u5fd7\u7ea7\u522b\u8fdb\u884c\u4e00\u4e9b\u8fc7\u6ee4\uff0c\u53ef\u4ee5\u65b9\u4fbf\u67e5\u8be2\u5230ERROR\u7ea7\u522b\u7684\u65e5\u5fd7\u7b49\u7b49\u3002 \u5f53\u7136\u4e0d\u4ec5\u4ec5\u662f\u50cf\u4ee5\u4e0atomcat\u7684\u8fd0\u7ef4\u7c7b\u65e5\u5fd7\uff0c\u8fd8\u6709\u8bf8\u5982\u4e1a\u52a1\u7684\u4e00\u4e9b\u8ba2\u5355\u7b49\u7b49\u65e5\u5fd7\uff0c\u90fd\u6709\u7c7b\u4f3c\u7684\u9700\u6c42\u548c\u4f7f\u7528\u573a\u666f\u3002

    \u5173\u4e8estdout\u65e5\u5fd7\u7684\u89e3\u6790\u63d0\u53d6

    \u4ee5\u4e0b\u793a\u4f8b\u4ec5\u63d0\u4f9b\u65e5\u5fd7\u5207\u5206\u5904\u7406\u7684\u53c2\u8003\u601d\u8def\uff0c\u5982\u679c\u4f60\u9700\u8981\u63d0\u53d6\u5bb9\u5668\u6807\u51c6\u8f93\u51fa\u7684\u539f\u59cb\u65e5\u5fd7\uff0c\u8bf7\u53c2\u8003\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\u3002

    "},{"location":"user-guide/best-practice/log-process/#_3","title":"\u914d\u7f6e\u793a\u4f8b","text":"

    \u65e5\u5fd7\u5207\u5206\u5904\u7406\u5728Loggie Agent\u7aef\u6216\u8005Loggie\u4e2d\u8f6c\u673a\u4fa7\u5747\u53ef\uff0c\u53d6\u51b3\u4e8e\u6211\u4eec\u662f\u5426\u9700\u8981\u4e2d\u8f6c\u673a\uff0c\u4ee5\u53ca\u5e0c\u671b\u65e5\u5fd7\u5904\u7406\u8fd9\u79cdCPU\u5bc6\u96c6\u578b\u7684\u8ba1\u7b97\u662f\u5206\u5e03\u5728Agent\u4e0a\uff0c\u7531\u5404\u4e2a\u8282\u70b9\u627f\u62c5\uff0c\u8fd8\u662f\u5e0c\u671b\u5728\u4e2d\u8f6c\u673a\u96c6\u7fa4\u4e2d\u96c6\u4e2d\u8fdb\u884c\u3002

    \u4e0b\u9762\u4ee5\u91c7\u96c6tomcat\u670d\u52a1\u7684access\u65e5\u5fd7\u4e3a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u5bf9access\u65e5\u5fd7\u8fdb\u884c\u5b57\u6bb5\u5207\u5206\u3002

    \u7b80\u5355\u8d77\u89c1\uff0c\u793a\u4f8b\u4f7f\u7528CRD\u5b9e\u4f8b\u914d\u7f6e\u4e0b\u53d1\u5728Agent\uff0c\u540c\u65f6\u4f7f\u7528dev sink\u76f4\u63a5\u8f93\u51fa\u5904\u7406\u7ed3\u679c\u5c55\u793a\u3002

    "},{"location":"user-guide/best-practice/log-process/#tomcat-deployment","title":"\u521b\u5efatomcat deployment","text":"

    \u8bf7\u53c2\u8003

    "},{"location":"user-guide/best-practice/log-process/#logconfig","title":"\u521b\u5efalogconfig","text":"

    \u914d\u7f6elogconfig\u5982\u4e0b\u6240\u793a\uff1a

    Example

    apiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: tomcat\nnamespace: default\nspec:\nselector:\nlabelSelector:\napp: tomcat\ntype: pod\npipeline:\nsources: |\n- type: file\nname: access\npaths:\n- /usr/local/tomcat/logs/localhost_access_log.*.txt\n\ninterceptors: |\n- type: transformer\nactions:\n- action: regex(body)\npattern: (?<ip>\\S+) (?<id>\\S+) (?<u>\\S+) (?<time>\\[.*?\\]) (?<url>\\\".*?\\\") (?<status>\\S+) (?<size>\\S+)\n\nsink: |\ntype: dev\nprintEvents: true\ncodec:\ntype: json\npretty: true\n

    \u8fd9\u91cc\u6211\u4eec\u5728transformer interceptors\u91cc\uff0c\u914d\u7f6e\u4e86regex action\uff0c\u9488\u5bf9access\u65e5\u5fd7\u8fdb\u884c\u6b63\u5219\u63d0\u53d6\u3002

    \u539f\u59cb\u7684access\u65e5\u5fd7\u5927\u6982\u5982\u4e0b\u6240\u793a\uff1a

    10.244.0.1 - - [31/Aug/2022:03:13:40 +0000] \"GET / HTTP/1.1\" 404 683\n

    \u7ecf\u8fc7transformer\u5904\u7406\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7kubectl -nloggie logs -f <loggie-pod-name> --tail=100\u6765\u67e5\u770b\u8f93\u51fa\u7684\u65e5\u5fd7\u3002

    \u8f6c\u6362\u540e\u7684event\u793a\u4f8b\u5982\u4e0b\uff1a

    {\n\"status\": \"404\",\n\"size\": \"683\",\n\"fields\": {\n\"logconfig\": \"tomcat\",\n\"namespace\": \"test1\",\n\"nodename\": \"kind-control-plane\",\n\"podname\": \"tomcat-85c84988d8-frs4n\",\n\"containername\": \"tomcat\"\n},\n\"ip\": \"10.244.0.1\",\n\"id\": \"-\",\n\"u\": \"-\",\n\"time\": \"[31/Aug/2022:03:13:40 +0000]\",\n\"url\": \"\\\"GET / HTTP/1.1\\\"\"\n}\n

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/","title":"\u65e5\u5fd7\u7cfb\u7edf\u67b6\u6784\u4e0e\u6f14\u8fdb","text":"

    \u6211\u4eec\u53ef\u4ee5\u6253\u9020\u4ee5Loggie\u4e3a\u6838\u5fc3\u7684\u4e91\u539f\u751f\u53ef\u6269\u5c55\u7684\u5168\u94fe\u8def\u6570\u636e\u5e73\u53f0\uff0cLoggie\u652f\u6301\u4f7f\u7528\u4e0d\u540c\u7684\u6280\u672f\u9009\u578b\u3002

    \u5728\u4e0d\u540c\u7684\u4e1a\u52a1\u7c7b\u578b\u3001\u4e0d\u540c\u7684\u4f7f\u7528\u573a\u666f\u3001\u4e0d\u540c\u7684\u65e5\u5fd7\u89c4\u6a21\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u91c7\u7528\u4e0d\u540c\u7684\u65e5\u5fd7\u7cfb\u7edf\u67b6\u6784\uff0c\u67b6\u6784\u4e0d\u5b58\u5728\u597d\u574f\uff0c\u53ea\u6709\u5408\u4e0d\u5408\u9002\u3002\u4e00\u4e2a\u7b80\u5355\u7684\u573a\u666f\u4e0b\uff0c\u4f7f\u7528\u590d\u6742\u7684\u67b6\u6784\u642d\u5efa\u51fa\u6765\u7684\u65e5\u5fd7\u7cfb\u7edf\uff0c\u5927\u6982\u4f1a\u5e26\u6765\u8fd0\u7ef4\u707e\u96be\u3002

    \u8fd9\u91cc\u901a\u8fc7\u89c4\u6a21\u6f14\u8fdb\u7684\u89c6\u89d2\uff0c\u603b\u7ed3\u4e00\u4e0b\u5e38\u89c1\u7684\u65e5\u5fd7\u7cfb\u7edf\u67b6\u6784\uff0c\u5f53\u7136\u5b9e\u9645\u7684\u6280\u672f\u9009\u578b\u53ca\u53d8\u79cd\u6709\u5f88\u591a\uff0c\u6211\u4eec\u65e0\u6cd5\u4e00\u4e00\u5217\u51fa\uff0c\u76f8\u4fe1\u4f60\u53ef\u4ee5\u901a\u8fc7\u53c2\u8003\u4e0b\u6587\uff0c\u642d\u5efa\u9002\u5408\u81ea\u5df1\u4e1a\u52a1\u7684\u67b6\u6784\u3002

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/#_2","title":"\u67b6\u6784\u6f14\u8fdb","text":"

    \u9700\u8981\u63d0\u524d\u8bf4\u660e\u7684\u662f:

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/#_3","title":"\u5c0f\u89c4\u6a21\u4e1a\u52a1\u573a\u666f","text":"

    \u6bcf\u5929\u7684\u65e5\u5fd7\u89c4\u6a21\u8f83\u5c0f\uff0c\u6bd4\u5982\u53ea\u6709\u51e0\u767eG\uff08\u9884\u4f30500G\u4ee5\u4e0b\uff09\u5de6\u53f3\uff0c\u65e5\u5fd7\u7684\u4f7f\u7528\u573a\u666f\u4ec5\u4ec5\u7528\u4e8e\u65e5\u5e38\u8fd0\u7ef4\u6392\u67e5\u95ee\u9898\uff0c\u53ef\u4ee5\u91c7\u7528Loggie\u76f4\u63a5\u53d1\u9001\u81f3Elasticsearch\u96c6\u7fa4\u7684\u65b9\u5f0f\u3002 \u67b6\u6784\u56fe\u5982\u4e0b\u6240\u793a\uff1a

    \u4f18\u70b9\uff1a

    \u7f3a\u70b9\uff1a

    \u53d8\u79cd\uff1a \u56e0\u4e3a\u4e00\u76f4\u4ee5\u6765ELK\u67b6\u6784\u7684\u6d41\u884c\uff0cElasticsearch\u662f\u6700\u5e38\u7528\u7684\u65e5\u5fd7\u5b58\u50a8\u3002 \u5982\u679c\u6709\u5176\u4ed6\u670d\u52a1\u5bf9Elasticsearch\u7684\u4f9d\u8d56\uff0c\u6216\u8005\u6709Elasticsearch\u7684\u8fd0\u7ef4\u7ecf\u9a8c\uff0cElasticsearch\u662f\u4e00\u4e2a\u8fd8\u4e0d\u9519\u7684\u9009\u62e9\u3002 \u4f46\u662f\uff0cElasticsearch\u5bf9\u8d44\u6e90\u548c\u8fd0\u7ef4\u6709\u4e00\u5b9a\u7684\u8981\u6c42\uff0c\u5728\u67d0\u4e9b\u8f7b\u91cf\u7ea7\u548c\u8d44\u6e90\u654f\u611f\u7684\u73af\u5883\u4e0b\uff0c\u53ef\u4ee5\u8003\u8651\uff1a

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/#_4","title":"\u4e2d\u578b\u89c4\u6a21\u4e1a\u52a1\u573a\u666f","text":"

    \u5728\u6bcf\u5929\u7684\u65e5\u5fd7\u91cf\u7ea7\u7a0d\u5927\uff0c\u6bd4\u5982\u5728500G\u81f31T\u7684\u89c4\u6a21\uff0c\u67b6\u6784\u548c\u4e1a\u52a1\u4f7f\u7528\u4e0a\u6709\u6269\u5c55\u6027\u7684\u8003\u8651\uff0c\u53ef\u8003\u8651\u5f15\u5165Loggie\u4e2d\u8f6c\u96c6\u7fa4\u3002

    \u4f18\u70b9\uff1a

    \u7f3a\u70b9\uff1a

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/#_5","title":"\u5927\u578b\u89c4\u6a21\u4e1a\u52a1\u573a\u666f","text":"

    \u5982\u679c\u65e5\u5fd7\u91cf\u8f83\u5927\uff0c\u6bd4\u59821T\u4ee5\u4e0a\u573a\u666f\uff0c\u5bf9\u6027\u80fd\u4e0e\u7a33\u5b9a\u6027\u8981\u6c42\u6bd4\u8f83\u9ad8\uff0c\u53ef\u8003\u8651\u4f7f\u7528Kafka\u7b49\u6d88\u606f\u961f\u5217\u96c6\u7fa4\u3002

    \u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cKafka\u672c\u8eab\u5e76\u4e0d\u80fd\u76f4\u63a5\u53d1\u9001\u81f3\u540e\u7aef\uff0c\u6240\u4ee5\u8fd9\u91cc\u9700\u8981\u8003\u8651\u5982\u4f55\u5c06Kafka\u7684\u6570\u636e\u5b9e\u65f6\u5bfc\u5165\u5230\u540e\u7aef\u5b58\u50a8\u4e2d\u3002 \u8fd9\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u4ee5\u9009\u62e9\u4e00\u4e9b\u7ec4\u4ef6\u6d88\u8d39Kafka\uff0c\u53d1\u9001\u81f3\u540e\u7aef\uff0c\u6bd4\u5982Loggie/Logstash/Kafka connect/Flink\u7b49\u3002 \u4f46\u662fFlink\u9002\u5408\u6709\u81ea\u5df1\u7684\u5b9e\u65f6\u6d41\u5e73\u53f0\u6216\u8005\u8fd0\u7ef4\u80fd\u529b\u7684\u4f01\u4e1a\uff0c\u5426\u5219\u53ef\u80fd\u5f15\u5165\u66f4\u591a\u8fd0\u7ef4\u6210\u672c\u3002

    \u4f18\u70b9\uff1a

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/#_6","title":"\u8d85\u5927\u578b\u89c4\u6a21\u4e1a\u52a1\u573a\u666f","text":"

    \u51e0\u5341TB\u81f3PB\u7ea7\uff0c\u76f8\u6bd4\u4e0a\u9762\u5927\u89c4\u6a21\u573a\u666f\uff0c\u96c6\u7fa4\u6570\u91cf\u591a\uff0c\u673a\u623f\u67b6\u6784\u590d\u6742\uff0c\u53ef\u4ee5\u6839\u636e\u4ee5\u4e0a\u67b6\u6784\u589e\u52a0\u66f4\u591a\u7075\u6d3b\u7684\u6269\u5c55\u3002

    \u6bd4\u5982\uff1a

    \u6700\u7ec8\u6211\u4eec\u53ef\u4ee5\u57fa\u4e8eLoggie\uff0c\u642d\u5efa\u4e00\u5957\u751f\u4ea7\u7ea7\u522b\u7684\u5168\u94fe\u8def\u65e5\u5fd7\u6570\u636e\u5e73\u53f0\u3002

    "},{"location":"user-guide/enterprise-practice/architecture-and-evolution/#_7","title":"\u66f4\u591a","text":"

    \u5b9e\u9645\u5728\u843d\u5730\u4e00\u5957\u5b8c\u5584\u7684\u65e5\u5fd7\u67b6\u6784\u548c\u5e73\u53f0\uff0c\u8fd8\u9700\u8981\u8003\u8651\uff1a

    "},{"location":"user-guide/enterprise-practice/sls/","title":"\u4f7f\u7528\u963f\u91cc\u4e91\u53ef\u89c2\u6d4b\u7edf\u4e00\u5b58\u50a8SLS","text":"

    \u4e0d\u7ba1\u4f60\u7684\u670d\u52a1\u90e8\u7f72\u5728\u963f\u91cc\u4e91\u8fd8\u662f\u4f7f\u7528\u6df7\u5408\u4e91\u7684\u67b6\u6784\uff0cLoggie\u540c\u6837\u652f\u6301\u91c7\u96c6\u65e5\u5fd7\u6570\u636e\u81f3\u963f\u91cc\u4e91\u53ef\u89c2\u6d4b\u7edf\u4e00\u5b58\u50a8SLS\u3002 \u800c\u4f60\u53ea\u9700\u8981\u4f7f\u7528sls sink\u5373\u53ef\u3002

    \u963f\u91cc\u4e91\u5b98\u65b9\u6587\u6863\u4e2d\u5173\u4e8eLoggie\u7684\u4f7f\u7528\u8bf7\u53c2\u8003\uff1a\u4f7f\u7528Loggie\u4e0a\u4f20\u65e5\u5fd7

    "},{"location":"user-guide/enterprise-practice/sls/#sls-project","title":"\u51c6\u5907\uff1a\u521b\u5efaSLS Project","text":"

    \u4e3a\u4e86\u4f7f\u7528\u963f\u91cc\u4e91\u53ef\u89c2\u6d4b\u7edf\u4e00\u5b58\u50a8SLS\uff0c\u6211\u4eec\u9700\u8981\u5148\u521b\u5efa\u4e00\u4e2a\u5bf9\u5e94\u7684Project\u3002 \u5982\u4e0b\u6240\u793a\uff0c\u5728SLS\u9875\u9762\u4e2d\uff0c\u70b9\u51fb\u521b\u5efaProject\uff0c\u586b\u5165project\u540d\u79f0\u548c\u5bf9\u5e94\u7684\u5730\u57df\uff0c\u521b\u5efa\u5b8c\u4e4b\u540e\u540c\u6b65\u521b\u5efa\u76f8\u5e94\u7684Logstore\u3002

    \u7136\u540e\u6211\u4eec\u53ef\u4ee5\u51c6\u5907\u4e00\u4e0bsls sink\u7684\u914d\u7f6e\uff0c\u793a\u4f8b\u5982\u4e0b\u6240\u793a\uff0c\u5177\u4f53\u53ef\u53c2\u8003sls sink \u914d\u7f6e\u53c2\u6570\uff1a

    sls sink

        sink:\ntype: sls\nname: demo\nendpoint: cn-hangzhou.log.aliyuncs.com\naccessKeyId: xxxx\naccessKeySecret: xxxx\nproject: test\nlogstore: test1\ntopic: myservice\n
    "},{"location":"user-guide/enterprise-practice/sls/#ecs","title":"\u91c7\u96c6ECS\u4e0a\u7684\u65e5\u5fd7","text":"

    \u53c2\u8003\u4e3b\u673a\u90e8\u7f72\u7684\u65b9\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u4fee\u6539pipeline.yml\uff0c\u52a0\u4e0asls sink\u7684\u914d\u7f6e\u5373\u53ef\u3002

    Pipeline\u914d\u7f6e\u53c2\u8003\u793a\u4f8b\u5982\u4e0b\uff1a

    sls pipeline

    pipelines:\n- name: test\nsources:\n- type: file\nname: demo\naddonMeta: true\npaths:\n- /tmp/log/*.log\nsink:\ntype: sls\nendpoint: cn-hangzhou.log.aliyuncs.com\naccessKeyId: ${accessKeyId}\naccessKeySecret: ${accessKeySecret}\nproject: loggietest\nlogstore: demo1\ntopic: myservice\n
    "},{"location":"user-guide/enterprise-practice/sls/#ack-kubernetes","title":"\u91c7\u96c6ACK Kubernetes\u96c6\u7fa4\u7684\u65e5\u5fd7","text":"

    \u548c\u81ea\u5efaKubernetes\u96c6\u7fa4\u4e00\u6837\uff0cLoggie\u540c\u6837\u53ef\u4ee5\u90e8\u7f72\u5728\u963f\u91cc\u4e91ACK\u7684Kubernetes\u96c6\u7fa4\u4e2d\u3002 \u6211\u4eec\u53ef\u4ee5\u6839\u636eACK\u63d0\u4f9b\u7684kubeconfig\u6587\u4ef6\uff0c\u4f7f\u7528kubectl\u6216\u8005helm\u6765\u90e8\u7f72\u3002\u53ef\u53c2\u8003Kubernetes\u90e8\u7f72\u3002

    \u8bf7\u6ce8\u610f\uff1a

    \u90e8\u7f72\u5b8c\u4e4b\u540e\uff0c\u548c\u5e38\u89c4\u7684Kubernetes\u96c6\u7fa4\u4e0b\u7684\u4f7f\u7528\u59ff\u52bf\u7c7b\u4f3c\uff0c\u540c\u6837\u53ef\u4ee5\u4f7f\u7528ClusterLogConfig/LogConfig/Interceptor/Sink CR\u7684\u65b9\u5f0f\u3002

    ACK\u63d0\u4f9b\u4e86CRD\u7684\u4f7f\u7528\u9875\u9762\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u5728\u8be5\u9875\u9762\u4e2d\u8fdb\u884c\u521b\u5efa\u548c\u4fee\u6539\u3002

    \u91c7\u96c6\u67d0\u4e2a\u670d\u52a1\u7684\u65e5\u5fd7\u793a\u4f8b\u53c2\u8003\u5982\u4e0b\uff0c\u53ea\u9700\u4f7f\u7528sls sink\u5373\u53ef\u3002\u5f53\u7136\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5355\u72ec\u521b\u5efa\u4e00\u4e2asink CR\u5b58\u50a8sls sink\u914d\u7f6e\uff0c\u5728LogConfig\u4e2d\u901a\u8fc7sinkRef\u5f15\u7528\u3002

    logconfig

    apiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: tomcat\nnamespace: default\nspec:\nselector:\nlabelSelector:\napp: tomcat\ntype: pod\n\npipeline:\nsources: |\n- type: file\nname: stdout\npaths:\n- stdout\n- type: file\nname: access\nignoreOlder: 3d\npaths:\n- /usr/local/tomcat/logs/*.log\n\nsink: |\ntype: sls\nendpoint: cn-hangzhou.log.aliyuncs.com\naccessKeyId: ${accessKeyId}\naccessKeySecret: ${accessKeySecret} \nproject: loggietest\nlogstore: demo1\ntopic: myservice\n
    "},{"location":"user-guide/enterprise-practice/sls/#_1","title":"\u67e5\u770b\u65e5\u5fd7","text":"

    \u6211\u4eec\u53ef\u4ee5\u5728SLS\u5177\u4f53\u7684Project\u4e2d\u67e5\u770b\u91c7\u96c6\u7684\u65e5\u5fd7\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a

    \u5177\u4f53\u7684\u5143\u4fe1\u606f\u7684\u6dfb\u52a0\u548c\u65e5\u5fd7\u5b57\u6bb5\u4fee\u6539\uff0c\u53ef\u53c2\u8003\u65e5\u5fd7\u5207\u5206\u5904\u7406\u4ee5\u53ca\u65e5\u5fd7\u589e\u52a0\u5143\u4fe1\u606f\u3002

    "},{"location":"user-guide/monitor/loggie-monitor/","title":"Loggie\u7684\u76d1\u63a7\u4e0e\u62a5\u8b66","text":"

    Loggie\u7684monitor eventbus\u88ab\u8bbe\u8ba1\u4e3a\u53d1\u5e03\u548c\u8ba2\u9605\u6a21\u5f0f\uff0c\u5404\u4e2a\u7ec4\u4ef6\u53d1\u9001metrics\u5230\u6307\u5b9a\u7684topic\u4e2d\uff0c\u7531\u72ec\u7acb\u7684listener\u6765\u6d88\u8d39\u5904\u7406\u3002

    \u6bd4\u5982file source\u4f1a\u5c06\u91c7\u96c6\u65e5\u5fd7\u7684\u4e00\u4e9b\u6307\u6807\u6570\u636e\uff0c\u53d1\u9001\u81f3filesource topic\uff0c\u7531filesource listener\u6765\u6d88\u8d39\uff0cfilesource listener\u4f1a\u5c06\u6570\u636e\u805a\u5408\u8ba1\u7b97\u4e4b\u540e\uff0c\u6253\u5370\u81f3\u65e5\u5fd7\uff0c\u66b4\u9732\u51faPrometheus\u6307\u6807\u3002

    \u7ec4\u4ef6\u548ctopic\u4ee5\u53calistener\u4e4b\u95f4\u662f\u677e\u8026\u5408\u5173\u7cfb\uff0c\u6bd4\u5982file source\u8fd8\u4f1a\u5b9a\u65f6\u5c06\u5168\u91cf\u5339\u914d\u7684\u65e5\u5fd7\u6587\u4ef6\u6307\u6807\u53d1\u9001\u81f3filewatcher topic\uff0cfilewatcher listener\u4f1a\u5904\u7406\u548c\u66b4\u9732\u6307\u6807\u3002

    "},{"location":"user-guide/monitor/loggie-monitor/#monitor","title":"Monitor\u914d\u7f6e","text":"

    monitor eventbus\u914d\u7f6e\u5728\u5168\u5c40\u7684\u7cfb\u7edf\u914d\u7f6e\u4e2d\uff0c\u793a\u4f8b\u5982\u4e0b\uff1a

    Config

    loggie:\nmonitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nqueue: ~\nsink: ~\nhttp:\nenabled: true\nport: 9196\n

    \u5176\u4e2dlogger\u63a7\u5236\u6240\u6709\u7684metrics\u6307\u6807\u7684\u65e5\u5fd7\u6253\u5370\uff0c\u4f1a\u5728period\u65f6\u95f4\u95f4\u9694\u5c06\u914d\u7f6elisteners\u4ea7\u751f\u7684metrics\u805a\u5408\u6253\u5370\u5728Loggie\u65e5\u5fd7\u4e2d\uff0c\u4fbf\u4e8e\u56de\u6eaf\u548c\u6392\u67e5\u95ee\u9898\u3002

    listeners\u5219\u7528\u4e8e\u914d\u7f6e\u76f8\u5173\u7684listener\u662f\u5426\u5f00\u542f\u3002

    Prometheus\u683c\u5f0fmetrics\u9ed8\u8ba4\u901a\u8fc7http.port\u7aef\u53e3\u66b4\u9732\u5728/metrics\u3002\u53ef\u4ee5\u901a\u8fc7curl <podIp>:9196/metrics\u6765\u67e5\u770b\u5f53\u524d\u7684metrics\u6307\u6807\u3002

    "},{"location":"user-guide/monitor/loggie-monitor/#_1","title":"\u65e5\u5fd7\u91c7\u96c6\u6838\u5fc3\u6307\u6807","text":"

    \u76ee\u524d\u6709\u4ee5\u4e0b\u7684listener\uff0c\u4e3b\u8981\u5305\u542b\uff1a

    "},{"location":"user-guide/monitor/loggie-monitor/#prometheusgrafana","title":"\u90e8\u7f72Prometheus\u548cGrafana","text":"

    \u53ef\u4ee5\u4f7f\u7528\u73af\u5883\u5df2\u6709\u7684Prometheus\u6216\u8005Grafana\uff0c\u5982\u679c\u9700\u8981\u65b0\u90e8\u7f72\uff0c\u53ef\u53c2\u8003\uff1ahttps://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack\u3002

    \u4f7f\u7528Helm\u90e8\u7f72:

    helm repo add prometheus-community https://prometheus-community.github.io/helm-charts\nhelm repo update\nhelm install prometheus prometheus-community/kube-prometheus-stack -nprometheus --create-namespace\n

    Note

    \u7531\u4e8e\u4f17\u6240\u5468\u77e5\u7684\u539f\u56e0\uff0c\u4f60\u7684\u73af\u5883\u91cc\u53ef\u80fd\u65e0\u6cd5\u4e0b\u8f7d\u5176\u4e2d\u7684\u67d0\u4e9bk8s.gcr.io\u955c\u50cf\uff0c\u53ef\u4ee5\u8003\u8651\u4e0b\u8f7dchart\u5305\u66ff\u6362\u540e\u518d\u91cd\u65b0\u90e8\u7f72\u3002

    \u786e\u8ba4Pod\u6b63\u5e38running\u540e\uff0c\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u73af\u5883\u8bbf\u95eegrafana\u3002\u901a\u8fc7\u4ee3\u7406\u8bbf\u95eegrafana\u7684\u65b9\u5f0f\u53ef\u53c2\u8003\uff1a

    kubectl -nprometheus port-forward --address 0.0.0.0 service/prometheus-grafana 8181:80\n

    Grafana\u7528\u6237\u540d\u548c\u5bc6\u7801\u53ef\u5728prometheus-grafana sercret\u4e2d\uff0c\u901a\u8fc7base64 -d\u6765\u67e5\u770b\u3002

    "},{"location":"user-guide/monitor/loggie-monitor/#loggie-prometheus","title":"\u589e\u52a0Loggie Prometheus\u76d1\u63a7","text":"

    \u5728\u90e8\u7f72\u4e86Loggie\u7684Kubernetes\u96c6\u7fa4\u4e2d\uff0c\u9700\u8981\u521b\u5efa\u5982\u4e0b\u7684ServiceMonitor\u6765\u8ba9Prometheus\u91c7\u96c6Loggie Agent\u6307\u6807\u3002

    apiVersion: monitoring.coreos.com/v1\nkind: ServiceMonitor\nmetadata:\nlabels:\napp: loggie\nrelease: prometheus\nname: loggie-agent\nnamespace: prometheus\nspec:\nnamespaceSelector:\nmatchNames:\n- loggie\nendpoints:\n- port: monitor\nselector:\nmatchLabels:\napp: loggie\ninstance: loggie\n

    \u540c\u65f6\uff0c\u6211\u4eec\u9700\u8981\u5728Grafana\u4e2d\u6dfb\u52a0install\u5de5\u7a0b\u4e2d\u7684json\u6765\u5c55\u793aLoggie\u7684\u76d1\u63a7\u63a7\u5236\u53f0\u3002

    Note

    Kubernetes\u7248\u672c\u548cGrafana\u7248\u672c\u4e0d\u540c\uff0c\u53ef\u80fd\u5bfc\u81f4\u56fe\u8868\u5c55\u793a\u4e0d\u517c\u5bb9\uff0c\u9700\u8981\u6839\u636e\u60c5\u51b5\u8fdb\u884c\u4fee\u6539\u3002

    \u5bfc\u5165\u7684Grafana\u56fe\u8868\u76ee\u524d\u5305\u542b\u76d1\u63a7\u5927\u76d8\u548c\u8282\u70b9Agent\u7684\u76d1\u63a7\u56fe\u8868\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a

    "},{"location":"user-guide/monitor/service-log-alarm/","title":"\u4e1a\u52a1\u65e5\u5fd7\u62a5\u8b66","text":"

    \u9664\u4e86Loggie\u672c\u8eab\u7684\u62a5\u8b66\uff0c\u4e1a\u52a1\u65e5\u5fd7\u672c\u8eab\u7684\u76d1\u63a7\u62a5\u8b66\u4e5f\u662f\u4e00\u4e2a\u5e38\u7528\u7684\u529f\u80fd\uff0c\u6bd4\u5982\u5728\u65e5\u5fd7\u4e2d\u5305\u542b\u4e86ERROR\u65e5\u5fd7\uff0c\u53ef\u4ee5\u53d1\u9001\u62a5\u8b66\uff0c\u8fd9\u79cd\u62a5\u8b66\u4f1a\u66f4\u8d34\u8fd1\u4e1a\u52a1\u672c\u8eab\uff0c\u662f\u57fa\u4e8emetrics\u62a5\u8b66\u7684\u4e00\u79cd\u5f88\u597d\u7684\u8865\u5145\u3002

    "},{"location":"user-guide/monitor/service-log-alarm/#_2","title":"\u4f7f\u7528\u65b9\u5f0f","text":"

    \u6709\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\u53ef\u4ee5\u9009\u62e9\uff1a

    "},{"location":"user-guide/monitor/service-log-alarm/#_3","title":"\u91c7\u96c6\u94fe\u8def\u68c0\u6d4b","text":""},{"location":"user-guide/monitor/service-log-alarm/#_4","title":"\u539f\u7406","text":"

    \u91c7\u96c6\u94fe\u8def\u4e0d\u9700\u8981\u72ec\u7acb\u90e8\u7f72Loggie\uff0c\u4f46\u662f\u7531\u4e8e\u5728\u91c7\u96c6\u7684\u6570\u636e\u94fe\u8def\u4e0a\u8fdb\u884c\u5339\u914d\uff0c\u7406\u8bba\u4e0a\u4f1a\u5bf9\u4f20\u8f93\u6027\u80fd\u9020\u6210\u4e00\u5b9a\u5f71\u54cd\uff0c\u4f46\u80dc\u5728\u65b9\u4fbf\u7b80\u5355\u3002

    logAlert interceptor\u7528\u4e8e\u5728\u65e5\u5fd7\u4f20\u8f93\u7684\u65f6\u5019\u68c0\u6d4b\u5f02\u5e38\u65e5\u5fd7\uff0c\u5f02\u5e38\u65e5\u5fd7\u4f1a\u88ab\u5c01\u88c5\u6210\u62a5\u8b66\u7684\u4e8b\u4ef6\u53d1\u9001\u81f3monitor eventbus\u7684logAlert topic\uff0c\u7531logAlert listener\u6765\u6d88\u8d39\u3002logAlert listener\u652f\u6301\u53d1\u9001\u81f3\u4efb\u610fhttp\u540e\u7aef\uff08\u53ef\u4ee5\u591a\u4e2a\uff09\u3002 \u53d1\u9001\u4f53\u6839\u636e\u81ea\u5b9a\u4e49\u6a21\u677f\u8fdb\u884c\u6e32\u67d3\uff0c\u82e5\u6a21\u677f\u672a\u5b9a\u4e49\uff0c\u5219\u4f1a\u53d1\u9001\u539f\u59cb\u6570\u636e\u3002\u5728\u914d\u7f6e\u6a21\u677f\u524d\uff0c\u53ef\u4ee5\u5148\u89c2\u5bdf\u539f\u59cb\u6570\u636e\uff08\u8bbe\u7f6edebug\u6a21\u5f0f\u542f\u52a8\uff09\uff0c\u518d\u8fdb\u884c\u6a21\u677f\u914d\u7f6e\uff0c\u539f\u59cb\u6570\u636e\u53ef\u80fd\u4f1a\u6839\u636epipeline\u914d\u7f6e\u88ab\u5176\u4ed6interceptor\u6539\u52a8\u800c\u4e0e\u793a\u4f8b\u4e0d\u540c\u3002

    "},{"location":"user-guide/monitor/service-log-alarm/#_5","title":"\u914d\u7f6e\u793a\u4f8b","text":""},{"location":"user-guide/monitor/service-log-alarm/#1-logalert-listener","title":"1. \u65b0\u589elogAlert listener","text":"

    \u914d\u7f6e\u65b0\u589elogAlert listener\u53d1\u9001\u544a\u8b66\u914d\u7f6e\u3002\u7528\u4e8e\u5728\u68c0\u6d4b\u5230\u5339\u914d\u7684\u65e5\u5fd7\u540e\uff0c\u5c06\u65e5\u5fd7\u62a5\u8b66\u53d1\u9001\u81f3\u8bf8\u5982alertManager\u7b49\u540e\u7aef\uff0c\u8be6\u7ec6\u914d\u7f6e\u53ef\u53c2\u8003logAlert listener\u3002

    \u5168\u5c40Config\u6587\u4ef6

    loggie:\nmonitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nlogAlert:\naddr: [\"http://127.0.0.1:8080/loggie\"]\nbufferSize: 100\nbatchTimeout: 10s\nbatchSize: 10\nlinelimit: 10\ntemplate: |\n{\n\"alerts\":\n[\n{{$first := true}}\n{{range .Alerts}}\n{{if $first}}{{$first = false}}{{else}},{{end}}\n{\n\"labels\": {\n\"topic\": \"{{.fields.topic}}\"\n},\n\"annotations\": {\n\"message\": \"\\nNew alert: \\nbody:\\n{{range .body}}{{.}}\\n{{end}}\\ncontainerid: {{._meta.pipelineName}}\\nsource: {{._meta.sourceName}}\\ncontainername: {{.fields.containername}}\\nlogconfig: {{.fields.logconfig}}\\nname: {{.fields.name}}\\nnamespace: {{.fields.namespace}}\\nnodename: {{.fields.nodename}}\\npodname: {{.fields.podname}}\\nfilename: {{.state.filename}}\\n\",\n\"reason\": \"{{.reason}}\"\n},\n\"startsAt\": \"{{._meta.timestamp}}\",\n\"endsAt\": \"{{._meta.timestamp}}\"\n}\n{{end}}\n],\n{{$first := true}}\n{{range .Alerts}}\n{{if $first}}{{$first = false}}{{else}}\n\"commonLabels\": {\n\"module\": \"{{._additions.module}}\",\n\"alertname\": \"{{._additions.alertname}}\",\n\"cluster\": \"{{._additions.cluster}}\"\n}\n{{end}}\n{{end}}\n}\nfilesource: ~\nfilewatcher: ~\nreload: ~\nqueue: ~\nsink: ~\nhttp:\nenabled: true\nport: 9196\n

    \u4e0a\u9762\u7684template\u6a21\u7248\u8868\u793a\u53d1\u9001\u7684\u544a\u8b66\u5185\u5bb9\u683c\u5f0f\uff0c\u4f7f\u7528go template\u683c\u5f0f\u3002\u53ef\u53c2\u8003GO Template\uff0c\u6216\u8005\u8bf7\u81ea\u884c\u641c\u7d22go template\u4f7f\u7528\u6559\u7a0b\u3002

    \u5176\u4e2d\u53ef\u4f7f\u7528\u7c7b\u4f3c{{._meta.timestamp}}\u7b49\u5f62\u5f0f\u52a8\u6001\u6e32\u67d3\u539f\u59cbalert\u6570\u636e\u4e2d\u7684\u5b57\u6bb5\u3002

    alert\u5b57\u6bb5\u89e3\u91ca\uff1a

    \u5b57\u6bb5 \u662f\u5426\u5185\u7f6e \u542b\u4e49 _meta \u662f alert\u5143\u6570\u636e _meta.pipelineName \u8868\u793apipeline\u540d\u79f0 _meta.sourceName \u8868\u793asource\u540d\u79f0 _meta.timestamp \u8868\u793a\u65e5\u5fd7\u65f6\u95f4\u6233 body \u662f logBody reason \u662f \u5339\u914d\u6210\u529f\u539f\u56e0 fields \u5426 field\u5b57\u6bb5\uff0c\u7531\u5176\u4f59\u914d\u7f6e\u6dfb\u52a0 state \u5426 \u91c7\u96c6\u4fe1\u606f\uff0c\u9700\u8981\u5728file source\u914d\u7f6eaddonMeta: true _additions \u5426 \u7531\u914d\u7f6e\u6307\u5b9a

    \u539f\u59cbalert\u6570\u636e\u4e3a\u4e00\u4e2ajson\uff0c\u5176\u4e2dAlerts\u4e3a\u56fa\u5b9a\u7684key\u3002

    \u539f\u59cbalert\u6570\u636e\u793a\u4f8b

      {\n\"Alerts\": [\n{\n\"_meta\": {\n\"pipelineName\": \"default/spring\",\n\"sourceName\": \"loggie-source-756fd6bb94-4skqv/loggie-alert/common\",\n\"timestamp\": \"2022-10-28T13:12:30.528824+08:00\"\n},\n\"body\": [\n\"2022-10-28 01:48:07.093 ERROR 1 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].  [dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in   context with path [] threw exception [Request processing failed; nested   exception is java.lang.ArithmeticException: / by zero] with root cause\",\n\"\",\n\"java.lang.ArithmeticException: / by zero\"\n],\n\"fields\": {\n\"containerid\":   \"0dc5f07983bfdf7709ee4fce752679983c4184e94c70dab5fe6df5843d5cbb68\",\n\"containername\": \"loggie-alert\",\n\"logconfig\": \"spring\",\n\"name\": \"loggie-source\",\n\"namespace\": \"default\",\n\"nodename\": \"docker-desktop\",\n\"podname\": \"loggie-source-756fd6bb94-4skqv\",\n\"topic\": \"loggie\"\n},\n\"reason\": \"matches some rules\",\n\"state\": {\n\"bytes\": 6913,\n\"filename\": \"/var/log/pods/  default_loggie-source-756fd6bb94-4skqv_9da3e440-e749-4930-8e4d-41e0d5b66417/  loggie-alert/1.log\",\n\"hostname\": \"docker-desktop\",\n\"offset\": 3836,\n\"pipeline\": \"default/spring\",\n\"source\": \"loggie-source-756fd6bb94-4skqv/loggie-alert/common\",\n\"timestamp\": \"2022-10-28T13:12:30.527Z\"\n},\n\"_additions\": {\n\"namespace\": \"default\",\n\"cluster\": \"local\",\n\"alertname\": \"loggie-test\",\n\"module\": \"loggie\"\n}\n}\n]\n}\n
    "},{"location":"user-guide/monitor/service-log-alarm/#2-logalert-interceptor","title":"2. \u589e\u52a0logAlert interceptor","text":"

    Pipeline\u4e2d\u589e\u52a0logAlert interceptor\u7528\u4e8e\u5728\u91c7\u96c6\u7684\u65f6\u5019\u68c0\u6d4b\u65e5\u5fd7\u5e76\u5339\u914d\u65e5\u5fd7\u62a5\u8b66\u89c4\u5219\uff0c\u53ef\u5728ClusterLogConfig/LogConfig\u4e2d\u5f15\u7528\u3002\u5176\u4e2dadditions\u4e3a\u7ed9alert\u989d\u5916\u6dfb\u52a0\u7684\u5b57\u6bb5\uff0c\u4f1a\u653e\u5165alert\u539f\u59cb\u6570\u636e\u7684_addtions\u5b57\u6bb5\u4e2d\uff0c\u53ef\u7528\u505a\u6a21\u677f\u6e32\u67d3\u3002

    \u5efa\u8bae\u5148\u4f7f\u7528debug\u6a21\u5f0f\uff08-log.level=debug\uff09\u89c2\u5bdf\u539f\u59cbalert\u6570\u636e\u683c\u5f0f\uff0c\u518d\u914d\u7f6e\u6a21\u677f\u8fdb\u884c\u6e32\u67d3\uff0c\u539f\u59cb\u6570\u636e\u4f1a\u53d7\u5230\u5176\u4ed6\u914d\u7f6e\u7684\u5f71\u54cd\uff0c\u8fd9\u91cc\u4ec5\u5c55\u793a\u4e00\u4e2a\u793a\u4f8b\u3002

    \u8be6\u7ec6\u914d\u7f6e\u53ef\u53c2\u8003logAlert interceptor\u3002

    Config

    apiVersion: loggie.io/v1beta1\nkind: Interceptor\nmetadata:\nname: logalert\nspec:\ninterceptors: |\n- type: logAlert\nmatcher:\ncontains: [\"ERROR\"]\nadditions:\nmodule: \"loggie\"\nalertname: \"loggie-test\"\ncluster: \"local\"\n

    \u5339\u914d\u5230\u65e5\u5fd7\u544a\u8b66\u89c4\u5219\u4e4b\u540e\uff0c\u544a\u8b66\u540e\u7aef\u53ef\u63a5\u6536\u5230\u7c7b\u4f3c\u7684\u6570\u636e\u5982\u4e0b\u6240\u793a\uff1a

    Example

    {\n\"alerts\": [\n{\n\"labels\": {\n\"topic\": \"loggie\"\n},\n\"annotations\": {\n\"message\": \"\\nNew alert: \\nbody:\\n2022-10-28 01:48:07.093 ERROR 1 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ArithmeticException: / by zero] with root cause\\n\\njava.lang.ArithmeticException: / by zero\\ncontainerid: 0dc5f07983bfdf7709ee4fce752679983c4184e94c70dab5fe6df5843d5cbb68\\nsource: loggie-source-756fd6bb94-4skqv/loggie-alert/common\\ncontainername: loggie-alert\\nlogconfig: spring\\nname: loggie-source\\nnamespace: default\\nnodename: docker-desktop\\npodname: loggie-source-756fd6bb94-4skqv\\nfilename: /var/log/pods/default_loggie-source-756fd6bb94-4skqv_9da3e440-e749-4930-8e4d-41e0d5b66417/loggie-alert/1.log\\n\",\n\"reason\": \"matches some rules\"\n},\n\"startsAt\": \"2022-10-28T13:12:30.527Z\",\n\"endsAt\": \"2022-10-28T13:12:30.527Z\"\n}\n],\n\"commonLabels\": {\n\"module\": \"loggie\",\n\"alertname\": \"loggie-test\",\n\"cluster\": \"local\"\n}\n}\n
    "},{"location":"user-guide/monitor/service-log-alarm/#_6","title":"\u72ec\u7acb\u94fe\u8def\u68c0\u6d4b","text":""},{"location":"user-guide/monitor/service-log-alarm/#_7","title":"\u539f\u7406","text":"

    Loggie\u914d\u7f6esource\u91c7\u96c6\u65e5\u5fd7\uff0c\u7ecf\u8fc7logAlert interceptor\u5339\u914d\u65f6\uff0c\u53ef\u914d\u7f6esendOnlyMatched\u4ec5\u5c06\u5339\u914d\u6210\u529f\u7684\u65e5\u5fd7\u53d1\u9001\u81f3alertWebhook sink\uff0c\u5339\u914d\u5931\u8d25\u7684\u65e5\u5fd7\u770b\u4f5c\u6b63\u5e38\u65e5\u5fd7\u88ab\u5ffd\u7565\u3002\u5efa\u8bae\u5728\u4f7f\u7528alertWebhook sink\u65f6\uff0c\u540c\u65f6\u5f00\u542flogAlert interceptor, \u8bbe\u7f6esendOnlyMatched\u4e3atrue\u642d\u914d\u4f7f\u7528\u3002

    "},{"location":"user-guide/monitor/service-log-alarm/#_8","title":"\u914d\u7f6e\u793a\u4f8b","text":"

    \u914d\u7f6e\u65b0\u589ealertWebhook sink\u3002\u8be6\u7ec6\u914d\u7f6e\u53ef\u53c2\u8003alertWebhook Sink\u3002

    Config

        sink:\ntype: alertWebhook\naddr: http://localhost:8080/loggie\nlinelimit: 10\ntemplate: |\n{\n\"alerts\":\n[\n{{$first := true}}\n{{range .Alerts}}\n{{if $first}}{{$first = false}}{{else}},{{end}}\n{\n\"labels\": {\n\"topic\": \"{{.fields.topic}}\"\n},\n\"annotations\": {\n\"message\": \"\\nNew alert: \\nbody:\\n{{range .body}}{{.}}\\n  {{end}}\\ncontainerid: {{._meta.pipelineName}}\\nsource: {{.  _meta.sourceName}}\\ncontainername: {{.fields.  containername}}\\nlogconfig: {{.fields.logconfig}}\\nname:   {{.fields.name}}\\nnamespace: {{.fields.namespace}}  \\nnodename: {{.fields.nodename}}\\npodname: {{.fields.  podname}}\\nfilename: {{.state.filename}}\\n\",\n\"reason\": \"{{.reason}}\"\n},\n\"startsAt\": \"{{._meta.timestamp}}\",\n\"endsAt\": \"{{._meta.timestamp}}\"\n}\n{{end}}\n],\n{{$first := true}}\n{{range .Alerts}}\n{{if $first}}{{$first = false}}{{else}}\n\"commonLabels\": {\n\"namespace\": \"{{._additions.namespace}}\",\n\"module\": \"{{._additions.module}}\",\n\"alertname\": \"{{._additions.alertname}}\",\n\"cluster\": \"{{._additions.cluster}}\"\n}\n{{end}}\n{{end}}\n}\n

    logAlert Interceptor\u914d\u7f6e\u548c\u63a5\u6536\u65b9\u6536\u5230\u7684\u62a5\u8b66\u4e0e\u91c7\u96c6\u94fe\u8def\u68c0\u6d4b\u62a5\u8b66\u7c7b\u4f3c\u3002

    "},{"location":"user-guide/troubleshot/log-collection/","title":"\u65e5\u5fd7\u91c7\u96c6\u5feb\u901f\u6392\u969c\u6307\u5357","text":"

    \u4e3a\u4ec0\u4e48\u6211\u7684\u65e5\u5fd7\u6ca1\u6709\u91c7\u96c6\uff1f

    \u65e5\u5fd7\u91c7\u96c6\u4e2d\uff0c\u6700\u4e3a\u5173\u952e\u6838\u5fc3\u7684\u95ee\u9898\u662f\uff0c\u65e5\u5fd7\u6709\u6ca1\u6709\u88ab\u91c7\u96c6\u5230\uff0c\u4e3a\u4ec0\u4e48\u6211\u914d\u7f6e\u7684\u65e5\u5fd7\u6ca1\u6709\u53d1\u9001\u8fc7\u53bb\uff1f \u4e0b\u9762\u63d0\u4f9b\u4e86\u6838\u5fc3\u7684\u6392\u67e5\u601d\u8def\u548c\u624b\u6bb5\u4f9b\u53c2\u8003\u3002 \u53e6\u5916\uff0c\u6700\u91cd\u8981\u7684\u662f\uff0c\u5728\u73af\u5883\u91cc\u914d\u7f6eLoggie\u7684Prometheus\u76d1\u63a7\u548cGrafana\u56fe\u8868\uff0c\u53ef\u4ee5\u5feb\u901f\u53d1\u73b0\u95ee\u9898\u3002

    "},{"location":"user-guide/troubleshot/log-collection/#_2","title":"\u65e5\u5fd7\u91c7\u96c6\u6838\u5fc3\u673a\u5236","text":"

    \u4e86\u89e3\u5b9e\u73b0\u673a\u5236\u662f\u6392\u969c\u7684\u57fa\u7840\uff1a

    1. \u4e0b\u53d1\u91c7\u96c6\u4efb\u52a1\uff1a\u521b\u5efa\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1LogConfig CR\u81f3Kubernetes
    2. \u63a5\u6536\u65e5\u5fd7\u914d\u7f6e\uff1a\u8282\u70b9\u7684Agent Loggie\u76d1\u542c\u5230K8s\u76f8\u5e94\u4e8b\u4ef6\uff0c\u5c06LogConfig\u8f6c\u6362\u6210Pipelines\u914d\u7f6e\u6587\u4ef6
    3. \u91c7\u96c6\u65e5\u5fd7\u6587\u4ef6\uff1aLoggie\u4f1a\u81ea\u52a8Reload\u7136\u540e\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff0c\u7136\u540e\u6839\u636e\u914d\u7f6e\u53d1\u9001\u76f8\u5e94\u7684\u65e5\u5fd7\u6570\u636e\u5230\u4e0b\u6e38\u670d\u52a1

    \uff08\u9488\u5bf9\u975eKubernetes\u7684\u4e3b\u673a\u573a\u666f\uff0c\u53ea\u662f\u5c11\u4e86LogConfig CRD\u914d\u7f6e\u4e0b\u53d1\u7684\u6b65\u9aa4\uff0c\u5176\u4f59\u7c7b\u4f3c\uff09

    "},{"location":"user-guide/troubleshot/log-collection/#loggie-terminal","title":"Loggie Terminal","text":"

    \u5728Kubernetes\u7684\u573a\u666f\u4e0b\uff0c\u76ee\u524dLoggie\u63d0\u4f9b\u4e86\u4e00\u4e2a\u57fa\u4e8eterminal\u7684\u53ef\u4ea4\u4e92\u5f0fdashboard\uff0c\u53ef\u4ee5\u66f4\u597d\u7684\u5e2e\u52a9\u6211\u4eec\u4fbf\u6377\u7684\u6392\u67e5\u95ee\u9898\u3002

    \u8fdb\u5165Terminal

    \u627e\u5230\u4efb\u610f\u4e00\u4e2aLoggie Pod\u5e76\u6267\u884cloggie inspect:

    kubectl -nloggie exec -it $(kubectl -nloggie get po -oname|head -n1|cut -d/ -f2) -- ./loggie inspect\n

    \u6216\u8005\uff0c \u5982\u679c\u4f60\u8bb0\u4e0d\u4f4f\u4ee5\u4e0a\u547d\u4ee4\uff0c\u53ef\u4ee5\uff1a - \u627e\u5230\u4efb\u610f\u4e00\u4e2aLoggie Pod

    kubectl -nloggie get po -owide\n

    \u4f7f\u7528terminal

    terminal\u9996\u9875\u5c55\u793a\u793a\u4f8b\u5982\u4e0b\u6240\u793a\uff1a

    \u5177\u4f53\u8bf7\u53c2\u8003\u4f7f\u7528\u8bf4\u660e\u89c6\u9891\u3002

    Tips

    Loggie terminal\u529f\u80fd\u4ec5\u4ecev1.4\u7248\u672c\u5f00\u59cb\u63d0\u4f9b\uff0c\u5982\u679c\u4ece\u4f4e\u7248\u672c\u5347\u7ea7\uff0c\u9700\u589e\u52a0clusterrole\u914d\u7f6e\uff0c\u8bf7\u53c2\u8003\u8fd9\u91cc\u3002

    "},{"location":"user-guide/troubleshot/log-collection/#_3","title":"\u624b\u52a8\u6392\u67e5\u6b65\u9aa4","text":"

    \u6392\u67e5\u95ee\u9898\u5173\u952e\u5148\u8981\u786e\u5b9a\u662f\u54ea\u4e00\u6b65\u51fa\u73b0\u4e86\u95ee\u9898\u3002

    "},{"location":"user-guide/troubleshot/log-collection/#_4","title":"\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1\u6392\u67e5","text":"

    \u67e5\u770b\u6211\u4eec\u8981\u6392\u67e5\u7684\u65e5\u5fd7\u91c7\u96c6\u4efb\u52a1LogConfig/ClusterLogConfig\u7684Events\u4e8b\u4ef6\uff1a

    kubectl -n ${namespace} describe lgc ${name}\n

    \u5982\u679c\u6ca1\u6709events\uff0c\u5219\u53ef\u80fd\u4e3a\uff1a

    \u5982\u679c\u6ca1\u6709\u7c7b\u4f3csync success\u7684events\uff0c\u53ef\u6839\u636eevents\u540c\u65f6\u7ed3\u5408Loggie\u65e5\u5fd7\u6392\u67e5\u95ee\u9898\uff1a

    \u5e38\u89c1\u7684\u5f02\u5e38\u6709\uff1a

    "},{"location":"user-guide/troubleshot/log-collection/#agent","title":"\u8282\u70b9\u65e5\u5fd7Agent\u6392\u67e5","text":""},{"location":"user-guide/troubleshot/log-collection/#1-logconfigpodagent","title":"1. \u627e\u5230logConfig\u5339\u914d\u7684pod\u6240\u5728\u8282\u70b9\u7684\u65e5\u5fd7Agent","text":"

    \u6839\u636e\u5728logConfig\u7684labelSelector\u627e\u5230\u4e00\u4e2a\u5339\u914d\u7684\u4e1a\u52a1pod\uff1a

    kubectl -n ${namespace} get po -owide -l ${labels}\n
    \u627e\u5230\u4efb\u610f\u4e00\u4e2a\u6240\u5728\u7684Node\u8282\u70b9${node-name}\uff0c\u7136\u540e\u901a\u8fc7\uff1a
    kubectl -n ${loggie-namespace} get po -owide |grep ${node-name}\n
    \u627e\u5230\u8be5\u8282\u70b9\u6240\u5728\u7684Loggie\u3002

    "},{"location":"user-guide/troubleshot/log-collection/#2-loggie","title":"2. \u67e5\u770b\u5bf9\u5e94\u8282\u70b9\u7684Loggie\u65e5\u5fd7","text":"

    \u68c0\u67e5\u662f\u5426\u6709\u5f02\u5e38\uff0c\u5982\u679c\u6709\u5f02\u5e38\uff0c\u5219\u9700\u6839\u636e\u5f02\u5e38\u65e5\u5fd7\u518d\u505a\u5206\u6790\u5224\u65ad

    kubectl -n ${loggie-namespace} logs -f ${loggie-pod-name} \u2014-tail=${N}\n

    "},{"location":"user-guide/troubleshot/log-collection/#3","title":"3. \u67e5\u770b\u91c7\u96c6\u60c5\u51b5","text":"

    \u8c03\u7528\u81ea\u52a8\u6392\u969c\u63a5\u53e3

    \u9488\u5bf9\u5bf9\u5e94\u7684Agent\uff0c\u8c03\u7528help\u63a5\u53e3\uff1a

    curl <ip>:9196/api/v1/help\n

    \u63a5\u53e3\u8fd4\u56de\u91cc\u6700\u5f00\u5934\u5305\u62ec\u4e86\u4e00\u4e2a\u4f7f\u7528\u63d0\u793a\uff1a

    --------- Usage: -----------------------\n|--- view details: /api/v1/help?detail=<module>, module is one of: all/pipeline/log\n|--- query by pipeline name: /api/v1/help?pipeline=<name>\n|--- query by source name: /api/v1/help?source=<name>\n
    \u6211\u4eec\u53ef\u4ee5\u4f7f\u7528curl <ip>:9196/api/v1/help?detail=all\u6765\u67e5\u8be2\u6240\u6709\u7684\u7ec6\u8282\u8be6\u60c5\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u6839\u636epipeline\u6216\u8005source\u7684\u540d\u79f0\u6765\u641c\u7d22\u3002

    \u76ee\u524d\u8fd4\u56de\u4e3b\u8981\u5305\u62ec\u4e24\u90e8\u5206\uff1a

    \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u8be5\u63a5\u53e3\u8986\u76d6\u4e86\u4ee5\u4e0b\u64cd\u4f5c\u5f97\u5230\u7684\u5185\u5bb9\uff0c\u65e0\u9700\u7ee7\u7eed\u8fdb\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff0c\u4e0b\u6587\u6b65\u9aa4\u4ec5\u4f9b\u53c2\u8003\u3002

    \u67e5\u770b\u8282\u70b9Loggie\u6e32\u67d3\u751f\u6210\u7684\u914d\u7f6e

    \u8fdb\u5165\u5230\u5bb9\u5668\u4e2d\uff1a

    kubectl -n ${loggie-namespace} exec -it ${loggie-pod-name} bash\n
    \u67e5\u770b\u6e32\u67d3\u751f\u6210\u7684Pipeline\u914d\u7f6e\uff1a
    ls /opt/loggie/pipeline/\n
    \u5f53\u7136\uff0c\u4f60\u4e5f\u53ef\u4ee5\u9009\u62e9\u901a\u8fc7\u8c03\u7528Loggie\u63a5\u53e3\u6765\u67e5\u770b\u6e32\u67d3\u751f\u6210\u7684Pipeline\u914d\u7f6e\uff1a
    curl ${loggie-pod-ip}:9196/api/v1/reload/config\n

    \u786e\u8ba4\u65e5\u5fd7\u91c7\u96c6\u914d\u7f6e

    cat /opt/loggie/pipeline/\n
    \u67e5\u770b\u73b0\u5728\u6e32\u67d3\u540e\u7684\u65e5\u5fd7\u914d\u7f6e\uff0c\u8fd9\u91cc\u7684path\u4e3a\u6839\u636elogconfig\u91cc\u586b\u5199\u7684\u5bb9\u5668\u91ccpath\u8f6c\u6362\u540e\u7684\u8def\u5f84\uff0c\u4e3a\u5b9e\u9645\u8282\u70b9\u7684path\uff0c\u6b63\u5e38\u53ef\u4ee5\u5728\u8282\u70b9\u4e0a\u627e\u5230\u3002 \u5f53\u7136\uff0c\u56e0\u4e3aLoggie\u4f7f\u7528\u5bb9\u5668\u5316\u90e8\u7f72\uff0cLoggie Pod\u91cc\u65e0\u6cd5\u67e5\u770b\u5230\u8282\u70b9\u6240\u6709\u7684\u914d\u7f6e\uff0c\u9700\u8981\u786e\u4fddLoggie\u4e5f\u6302\u8f7d\u4e86\u76f8\u5173\u7684\u8def\u5f84\u524d\u7f00\u3002

    \u67e5\u770b\u65e5\u5fd7\u91c7\u96c6\u6301\u4e45\u5316\u72b6\u6001

    Loggie\u4f1a\u8bb0\u5f55\u6bcf\u4e2a\u65e5\u5fd7\u6587\u4ef6\u7684\u91c7\u96c6\u72b6\u6001\uff0c\u8fd9\u6837\u5373\u4f7fLoggie\u91cd\u542f\u540e\uff0c\u4e5f\u53ef\u4ee5\u7ee7\u7eed\u4fdd\u6301\u4e0a\u4e00\u6b21\u7684\u91c7\u96c6\u8fdb\u5ea6\uff0c\u907f\u514d\u91cd\u65b0\u91c7\u96c6\u65e5\u5fd7\u6587\u4ef6\u3002 \u53ef\u4ee5\u901a\u8fc7\u8c03\u7528\u63a5\u53e3\u6765\u67e5\u770b\uff1a

    curl ${loggie-pod-ip}:9196/api/v1/source/file/registry?format=text | grep XXX\n
    \u4e00\u822c\u8fd4\u56de\u7684\u7c7b\u4f3c\uff1a
      {\n    \"id\": 85,\n    \"pipelineName\": \"default/tomcat\",\n    \"sourceName\": \"tomcat-7d64c4f6c9-cm8jm/tomcat/common\",\n    \"filename\": \"/var/lib/kubelet/pods/9397b8be-8927-44ba-8b94-73e5a4459377/volumes/kubernetes.io~empty-dir/log/catalina.2022-06-02.log\",\n    \"jobUid\": \"3670030-65025\",\n    \"offset\": 4960,\n    \"collectTime\": \"2022-06-06 12:44:12.861\",\n    \"version\": \"0.0.1\"\n  },\n
    \u5176\u4e2d\u7684filename\u4e3aLoggie\u8f6c\u6362\u540e\u7684\u5b9e\u9645\u8282\u70b9\u4e0a\u7684\u65e5\u5fd7\u8def\u5f84\uff0cjobUid\u7ec4\u6210\u4e3a\u6587\u4ef6\u7684inode-deviceId\uff0coffset\u4e3asink\u53d1\u9001\u6210\u529f\u63a5\u6536\u5230ack\u540e\u7684offset\u3002 \u53e6\u5916\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5728Loggie\u5bb9\u5668\u4e2d\u6267\u884c\uff1a
    stat ${filename}\n
    \u67e5\u770b\u6587\u4ef6\u7684size/inode\u7b49\u4fe1\u606f\uff0c\u4f8b\u5982\uff1a

    stat

      File: /var/lib/kubelet/pods/9397b8be-8927-44ba-8b94-73e5a4459377/volumes/kubernetes.io~empty-dir/log/catalina.2022-06-02.log\nSize: 4960        Blocks: 16         IO Block: 4096   regular file\nDevice: fe01h/65025d    Inode: 3670030     Links: 1\nAccess: (0640/-rw-r-----)  Uid: (    0/    root)   Gid: (    0/    root)\nAccess: 2022-06-06 12:44:12.859236003 +0000\nModify: 2022-06-02 08:54:33.177240007 +0000\nChange: 2022-06-02 08:54:33.177240007 +0000\n

    \u53ef\u901a\u8fc7\u6bd4\u8f83size\u548coffset\u6765\u5224\u65ad\u91c7\u96c6\u8fdb\u5ea6\u3002\u5982\u679csize=offset\uff0c\u5219\u8bf4\u660e\u5df2\u7ecf\u6587\u4ef6\u5df2\u7ecf\u5168\u90e8\u91c7\u96c6\u5e76\u53d1\u9001\u6210\u529f\u3002

    "},{"location":"user-guide/troubleshot/problems/","title":"\u95ee\u9898\u6848\u4f8b","text":""},{"location":"user-guide/troubleshot/problems/#netcgolookupip-segmentation-violation","title":"net.cgoLookupIP \u5bfc\u81f4segmentation violation","text":"

    \u73b0\u8c61

    \u53ef\u80fd\u5728\u4f7f\u7528\u4e86\u6bd4\u5982unix sock source\u7684\u65f6\u5019\uff0cLoggie\u542f\u52a8\u540ecrash\uff0c\u5e76\u6709\u5982\u4e0b\u7684\u65e5\u5fd7\uff1a

    fatal error: unexpected signal during runtime execution\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x47 pc=0x7f59b4528360]\n\nruntime stack:\nruntime.throw({0x213b1a1, 0x7f59b423b640})\n    /usr/local/go/src/runtime/panic.go:1198 +0x71\nruntime.sigpanic()\n    /usr/local/go/src/runtime/signal_unix.go:719 +0x396\n\ngoroutine 86 [syscall]:\nruntime.cgocall(0x1a39d30, 0xc000510d90)\n    /usr/local/go/src/runtime/cgocall.go:156 +0x5c fp=0xc000510d68 sp=0xc000510d30 pc=0x40565c\nnet._C2func_getaddrinfo(0xc00030bc40, 0x0, 0xc000724fc0, 0xc0005bd990)\n    _cgo_gotypes.go:91 +0x56 fp=0xc000510d90 sp=0xc000510d68 pc=0x5c7bb6\nnet.cgoLookupIPCNAME.func1({0xc00030bc40, 0xc0004d29c0, 0x4}, 0xc00030bb80, 0xc000510e50)\n    /usr/local/go/src/net/cgo_unix.go:163 +0x9f fp=0xc000510de8 sp=0xc000510d90 pc=0x5c98ff\nnet.cgoLookupIPCNAME({0x20f751c, 0x3}, {0xc00030bb80, 0xc00022b5e0})\n    /usr/local/go/src/net/cgo_unix.go:163 +0x16d fp=0xc000510f38 sp=0xc000510de8 pc=0x5c914d\nnet.cgoIPLookup(0x358aed0, {0x20f751c, 0xc00030bbc0}, {0xc00030bb80, 0xc000510fb8})\n    /usr/local/go/src/net/cgo_unix.go:220 +0x3b fp=0xc000510fa8 sp=0xc000510f38 pc=0x5c99bb\nnet.cgoLookupIP\u00b7dwrap\u00b725()\n    /usr/local/go/src/net/cgo_unix.go:230 +0x36 fp=0xc000510fe0 sp=0xc000510fa8 pc=0x5c9e36\nruntime.goexit()\n    /usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000510fe8 sp=0xc000510fe0 pc=0x46ae81\ncreated by net.cgoLookupIP\n    /usr/local/go/src/net/cgo_unix.go:230 +0x125\n

    \u539f\u56e0

    \u5177\u4f53\u539f\u56e0\u8bf7\u53c2\u8003\uff1ago net\u3002

    Name Resolution\n\nThe method for resolving domain names, whether indirectly with functions like Dial\nor directly with functions like LookupHost and LookupAddr, varies by operating system.\n\nOn Unix systems, the resolver has two options for resolving names.\nIt can use a pure Go resolver that sends DNS requests directly to the servers\nlisted in /etc/resolv.conf, or it can use a cgo-based resolver that calls C\nlibrary routines such as getaddrinfo and getnameinfo.\n\nBy default the pure Go resolver is used, because a blocked DNS request consumes\nonly a goroutine, while a blocked C call consumes an operating system thread.\nWhen cgo is available, the cgo-based resolver is used instead under a variety of\nconditions: on systems that do not let programs make direct DNS requests (OS X),\nwhen the LOCALDOMAIN environment variable is present (even if empty),\nwhen the RES_OPTIONS or HOSTALIASES environment variable is non-empty,\nwhen the ASR_CONFIG environment variable is non-empty (OpenBSD only),\nwhen /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the\nGo resolver does not implement, and when the name being looked up ends in .local\nor is an mDNS name.\n\nThe resolver decision can be overridden by setting the netdns value of the\nGODEBUG environment variable (see package runtime) to go or cgo, as in:\n\n    export GODEBUG=netdns=go    # force pure Go resolver\n    export GODEBUG=netdns=cgo   # force cgo resolver\n\nThe decision can also be forced while building the Go source tree\nby setting the netgo or netcgo build tag.\n

    \u89e3\u51b3\u529e\u6cd5

    \u5728Loggie \u90e8\u7f72\u811a\u672c\u91cc\u589e\u52a0\u73af\u5883\u53d8\u91cf\uff1a

      env:\n- name: GODEBUG\nvalue: netdns=go\n
    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/","title":"\u4f7f\u7528Loggie\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7","text":"

    \u9605\u8bfb\u672c\u6587\u4e4b\u524d\uff0c\u5efa\u8bae\u5148\u53c2\u8003Kubernetes\u4e0b\u65e5\u5fd7\u91c7\u96c6\u95ee\u9898\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#loggie_1","title":"Loggie\u5982\u4f55\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff1f","text":"

    \u7531\u4e8eKubernetes\u826f\u597d\u7684\u53ef\u6269\u5c55\u6027\uff0cKubernetes\u8bbe\u8ba1\u4e86\u4e00\u79cd\u81ea\u5b9a\u4e49\u8d44\u6e90CRD\u7684\u6982\u5ff5\uff0c\u7528\u6237\u53ef\u4ee5\u81ea\u5df1\u5b9a\u4e49CRD\u8868\u793a\u81ea\u5df1\u7684\u671f\u671b\u72b6\u6001\uff0c\u5e76\u501f\u52a9\u4e00\u4e9bframework\u5f00\u53d1Controller\uff0c\u4f7f\u7528Controller\u5c06\u6211\u4eec\u7684\u671f\u671b\u53d8\u6210\u73b0\u5b9e\u3002

    \u57fa\u4e8e\u8fd9\u4e2a\u601d\u8def\uff0c\u4e00\u4e2a\u670d\u52a1\u9700\u8981\u91c7\u96c6\u54ea\u4e9b\u65e5\u5fd7\uff0c\u9700\u8981\u4ec0\u4e48\u6837\u7684\u65e5\u5fd7\u914d\u7f6e\uff0c\u662f\u7528\u6237\u7684\u671f\u671b\uff0c\u800c\u8fd9\u5c31\u9700\u8981\u6211\u4eec\u5f00\u53d1\u4e00\u4e2a\u65e5\u5fd7\u91c7\u96c6\u7684Controller\u53bb\u5b9e\u73b0\u3002

    \u6240\u4ee5\uff0c\u7528\u6237\u53ea\u9700\u8981\u5728\u6211\u4eec\u5b9a\u4e49\u7684CRD LogConfig\u4e2d\uff0c\u586b\u5199\u9700\u8981\u91c7\u96c6\u54ea\u4e9bPods\u7684\u65e5\u5fd7\uff0c\u5728Pod\u4e2d\u7684\u65e5\u5fd7\u8def\u5f84\u662f\u4ec0\u4e48\u3002

    \u6838\u5fc3\u67b6\u6784\u5982\u4e0b\u56fe\u6240\u793a\uff1a

    Loggie\u4f1a\u611f\u77e5\u5230Pod\u548cCRD\u7684\u4e8b\u4ef6\uff0c\u8fdb\u884c\u914d\u7f6e\u7684\u52a8\u6001\u66f4\u65b0\u3002\u540c\u65f6\uff0cLoggie\u53ef\u4ee5\u6839\u636e\u65e5\u5fd7\u6587\u4ef6\u8def\u5f84\u6302\u8f7d\u7684Volume\uff0c\u627e\u5230\u76f8\u5e94\u5728\u8282\u70b9\u7684\u6587\u4ef6\u8fdb\u884c\u91c7\u96c6\u3002\u53e6\u5916\u8fd8\u53ef\u4ee5\u6839\u636e\u914d\u7f6e\uff0c\u81ea\u52a8\u5c06Pod\u4e0a\u7684Env/Annotation/Label\u52a0\u5165\u5230\u65e5\u5fd7\u91cc\u4f5c\u4e3a\u5143\u4fe1\u606f\u3002

    \u540c\u65f6\u76f8\u6bd4\u7c97\u66b4\u7684\u6240\u6709\u8282\u70b9\u6302\u8f7d\u76f8\u540c\u8def\u5f84\u8fdb\u884c\u901a\u914d\u91c7\u96c6\u7684\u65b9\u5f0f\uff0c\u4e5f\u89e3\u51b3\u4e86\u6ca1\u6cd5\u9488\u5bf9\u5355\u4e2a\u670d\u52a1\u7cbe\u7ec6\u5316\u914d\u7f6e\u3001\u91c7\u96c6\u65e0\u5173\u65e5\u5fd7\u7684\u95ee\u9898\u3002

    \u5f53\u7136\u5e26\u6765\u7684\u597d\u5904\u4e0d\u4ec5\u4ec5\u8fd9\u4e9b\uff0cLoggie\u5728\u52a8\u6001\u914d\u7f6e\u4e0b\u53d1\u3001\u76d1\u63a7\u6307\u6807\u7b49\u65b9\u9762\u90fd\u53ef\u4ee5\u57fa\u4e8eKubernetes\u8fdb\u884c\u76f8\u5e94\u7684\u9002\u914d\u548c\u652f\u6301\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#crd","title":"CRD\u4f7f\u7528\u8bf4\u660e","text":"

    Loggie\u76ee\u524d\u6709\u4ee5\u4e0b\u51e0\u79cdCRD\uff1a

    \u4f7f\u7528CRD\u7684\u6d41\u7a0b\u67b6\u6784\u5982\u4e0b\u6240\u793a\uff1a

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#_1","title":"\u51c6\u5907\u5de5\u4f5c","text":""},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#_2","title":"\u90e8\u7f72\u67b6\u6784","text":"

    \u6574\u4f53\u7684\u90e8\u7f72\u67b6\u6784\u662f\u4ec0\u4e48\uff1f

    1. Loggie Agent\u76f4\u63a5\u53d1\u9001\u7ed9\u540e\u7aef\u6bd4\u5982Elasticsearch\u8fd8\u662f\u5176\u4ed6\u5b58\u50a8\u7b49
    2. Loggie Agent\u53d1\u9001\u81f3Loggie Aggregator\u4e2d\u8f6c\u5904\u7406\uff0c\u518d\u8f6c\u53d1\u81f3\u5176\u4ed6\u540e\u7aef\u5b58\u50a8
    3. Loggie Agent\u53d1\u9001\u81f3Kafka\uff0cLoggie Aggregator\u6d88\u8d39Kafka\u518d\u53d1\u9001\u81f3\u540e\u7aef ...

    \u672c\u6587\u4ec5\u5173\u6ce8\u91c7\u96c6\u7aef\uff0c\u5982\u679c\u9700\u8981\u4f7f\u7528\u90e8\u7f72Loggie Aggregator\uff0c\u8bf7\u53c2\u8003Loggie\u4e2d\u8f6c\u673a\u3002

    \u5728\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u5df2\u7ecf\u5728Kubernetes\u4e2d\u90e8\u7f72\u4e86Loggie DaemonSet\u3002\u5982\u4f55\u5728Kubernetes\u4e2d\u90e8\u7f72Loggie\uff1f

    Info

    \u6211\u4eec\u63a8\u8350\u4f7f\u7528DaemonSet\u7684\u65b9\u5f0f\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff0cLoggie\u5df2\u652f\u6301\u81ea\u52a8\u6ce8\u5165Loggie Sidecar\u7684\u65b9\u5f0f\u91c7\u96c6\u65e5\u5fd7\u3002\u8bf7\u53c2\u8003\uff1ahttps://github.com/loggie-io/loggie-operator

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#_3","title":"\u4f7f\u7528\u65b9\u5f0f","text":"

    \u4e1a\u52a1Pod\u4f7f\u7528\u4ec0\u4e48\u65b9\u5f0f\u6302\u8f7d\u65e5\u5fd7\uff1f \u5efa\u8bae\u5982\u679c\u5bf9\u65e5\u5fd7\u53ef\u80fd\u6027\u7684\u4e22\u5931\u4e0d\u654f\u611f\uff0c\u6bd4\u5982\u8fd0\u7ef4\u7c7b\u7684\u65e5\u5fd7\uff0c\u53ef\u4ee5\u4f7f\u7528emptyDir\u3002\u5982\u679c\u65e5\u5fd7\u6bd4\u8f83\u91cd\u8981\uff0c\u4e0d\u5141\u8bb8\u4e22\u5931\uff0c\u8bf7\u4f7f\u7528hostPath\uff0c\u5e76\u5728volumeMount\u914d\u7f6esubPathExpr\u5b9e\u73b0\u8def\u5f84\u9694\u79bb\u3002

    Example

    tomcat-emptydir.ymltomcat-hostpath.yml
    apiVersion: apps/v1\nkind: Deployment\nmetadata:\nlabels:\napp: tomcat\nname: tomcat\nnamespace: default\nspec:\nreplicas: 1\nselector:\nmatchLabels:\napp: tomcat\ntemplate:\nmetadata:\nlabels:\napp: tomcat\nspec:\ncontainers:\n- name: tomcat\nimage: tomcat\nvolumeMounts:\n- mountPath: /usr/local/tomcat/logs\nname: log\nvolumes:\n- emptyDir: {}\nname: log        
    apiVersion: apps/v1\nkind: Deployment\nmetadata:\nlabels:\napp: tomcat\nname: tomcat\nnamespace: default\nspec:\nreplicas: 1\nselector:\nmatchLabels:\napp: tomcat\ntemplate:\nmetadata:\nlabels:\napp: tomcat\nspec:\ncontainers:\n- env:\n- name: POD_NAME\nvalueFrom:\nfieldRef:\napiVersion: v1\nfieldPath: metadata.name\n- name: NAMESPACE\nvalueFrom:\nfieldRef:\napiVersion: v1\nfieldPath: metadata.namespace\nimage: tomcat\nname: tomcat\nvolumeMounts:\n- mountPath: /log\nname: datalog\nsubPathExpr: $(NAMESPACE)/$(POD_NAME)\nvolumes:\n- hostPath:\npath: /data/log\ntype: \"\"\nname: datalog\n

    Caution

    \u8bf7\u786e\u4fddPod\u6302\u8f7d\u7684\u65e5\u5fd7\u8def\u5f84\u4e0d\u4f1a\u88ab\u591a\u4e2aPod\u5171\u4eab\u3002\u6bd4\u5982\u4e00\u4e2aDeployment\u4e0b\u7684\u4e24\u4e2aPod\uff0c\u4f7f\u7528\u672a\u914d\u7f6esubPathExpr\u7684hostPath\u6302\u8f7d\u65e5\u5fd7\u76ee\u5f55\uff0c\u5982\u679c\u4e24\u4e2aPod\u8c03\u5ea6\u5728\u76f8\u540c\u7684\u8282\u70b9\uff0c\u4f1a\u6253\u5370\u5230\u76f8\u540c\u7684\u65e5\u5fd7\u76ee\u5f55\u548c\u6587\u4ef6\u4e2d\uff0c\u6b64\u65f6\u53ef\u80fd\u5f15\u8d77\u91c7\u96c6\u5f02\u5e38\u3002

    \u6211\u4eec\u9996\u5148\u521b\u5efa\u4ee5\u4e0a\u793a\u4f8b\u7684tomcat Deployment\u4f5c\u4e3a\u6211\u4eec\u88ab\u91c7\u96c6\u65e5\u5fd7\u7684\u5bf9\u8c61\u3002

    kubectl apply -f tomcat-emptydir.yml\n

    \u63a5\u4e0b\u6765\u5c06\u6f14\u793a\u91c7\u96c6\u4e0a\u9762\u793a\u4f8b\u7684tomcat\u65e5\u5fd7\uff0c\u5e76\u53d1\u9001\u81f3Elasticsearch\u3002 \u5982\u679c\u4f60\u5e0c\u671b\u91c7\u96c6\u5176\u4ed6\u7684\u5bb9\u5668\u65e5\u5fd7\uff0c\u6216\u8005\u53d1\u9001\u81f3\u5176\u4ed6\u7684\u540e\u7aef\uff0c\u53ea\u9700\u8981\u4fee\u6539\u5176\u4e2d\u7684\u914d\u7f6e\u5373\u53ef\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#elasticsearchkibana","title":"\u90e8\u7f72Elasticsearch\u548cKibana\uff08\u53ef\u9009\uff09","text":"

    \u7531\u4e8e\u672c\u6587\u6f14\u793a\u53d1\u9001\u81f3Elasticsearch\uff0c\u6240\u4ee5\u8fd9\u91cc\u6211\u4eec\u90e8\u7f72\u4e00\u4e0bElasticsearch\u548cKibana\u3002 \u5982\u679c\u4f60\u7684\u73af\u5883\u4e2d\u5df2\u7ecf\u6709Elasticsearch\u548cKibana\uff0c\u8fd9\u4e00\u6b65\u53ef\u4ee5\u5ffd\u7565\u3002 \u5982\u679c\u5e0c\u671b\u81ea\u5df1\u642d\u5efa\u4e00\u5957Elasticsearch\u548cKibana\u8bd5\u7528\uff0c\u8fd9\u91cc\u5efa\u8bae\uff1a

    \u5982\u679c\u672c\u5730\u6ca1\u6709helm\u5ba2\u6237\u7aef\uff0c\u9700\u8981\u4e0b\u8f7dhelm\u3002

    \u4f7f\u7528\u5982\u4e0b\u547d\u4ee4:

    helm repo add elastic https://helm.elastic.co\nhelm install elasticsearch elastic/elasticsearch --set replicas=1\nhelm install kibana elastic/kibana\n

    \u901a\u8fc7\uff1a

    kubectl port-forward service/kibana-kibana 5601:http\n

    \u53ef\u4ee5\u76f4\u63a5\u5728\u6d4f\u89c8\u5668\u8f93\u5165localhost:5601\uff0c\u8bbf\u95eeKibana\u9875\u9762\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#_4","title":"\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7","text":""},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#sink","title":"\u521b\u5efasink","text":"

    \u4e3a\u4e86\u8868\u660e\u6211\u4eec\u5373\u5c06\u91c7\u96c6\u65e5\u5fd7\u53d1\u9001\u5230\u7684Elasticsearch\uff0c\u9700\u8981\u914d\u7f6e\u5bf9\u5e94\u7684Sink\u3002 \u8fd9\u91cc\u6709\u4e24\u79cd\u65b9\u5f0f\uff1a

    1. \u5982\u679c\u6574\u4e2a\u96c6\u7fa4\u53ea\u4f1a\u6709\u4e00\u4e2a\u5b58\u50a8\u540e\u7aef\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u5168\u5c40\u7684\u914d\u7f6e\u6587\u4ef6configMap\u91cc\uff0c\u914d\u7f6edefaults\u53c2\u6570\uff0c\u5177\u4f53\u53ef\u53c2\u8003\u3002

    2. \u4f7f\u7528Sink CRD\uff0c\u5e76\u5728logConfig\u4e2d\u5f15\u7528\u3002\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u6269\u5c55\u4e3a\u591a\u4e2a\u540e\u7aef\uff0c\u4e0d\u540c\u7684logConfig\u53ef\u4ee5\u914d\u7f6e\u4f7f\u7528\u4e0d\u540c\u7684\u540e\u7aef\u5b58\u50a8\uff0c\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u5efa\u8bae\u4f7f\u7528\u8be5\u65b9\u5f0f\u3002

    \u521b\u5efa\u4e00\u4e2aSink\u5982\u4e0b\uff0cSink\u4e3a\u96c6\u7fa4\u7ea7\u522bCRD\u3002\u53ef\u4ee5\u5728spec.sink\u4e2d\u4fee\u6539\u4e3a\u5176\u4ed6\u914d\u7f6e\u3002

    Example

    cat << EOF | kubectl apply -f -\napiVersion: loggie.io/v1beta1\nkind: Sink\nmetadata:\nname: default\nspec:\nsink: |\ntype: elasticsearch\nindex: \"loggie\"\nhosts: [\"elasticsearch-master.default.svc:9200\"]\nEOF\n

    \u53ef\u4ee5\u901a\u8fc7kubectl get sink default\u67e5\u770b\u662f\u5426\u521b\u5efa\u6210\u529f\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#interceptor","title":"\u521b\u5efainterceptor(\u53ef\u9009)","text":"

    \u548cSink\u4e00\u6837\uff0c\u914d\u7f6einterceptor\u6709\u4e24\u79cd\u65b9\u5f0f\uff1a

    1. \u5728\u5168\u5c40\u914d\u7f6e\u6587\u4ef6configMap\u4e2d\uff0c\u914d\u7f6edefaults\u53c2\u6570\u3002\u6b64\u65f6\u610f\u5473\u7740\u6240\u6709\u7684Loggie Agent\u90fd\u4f7f\u7528\u8be5default interceptors\u914d\u7f6e\u3002

    2. \u4f7f\u7528Interceptor CRD\uff0c\u5e76\u5728logConfig\u4e2d\u88ab\u5f15\u7528\u3002\u8fd9\u79cd\u65b9\u5f0f\u4f1a\u66f4\u52a0\u7075\u6d3b\uff0c\u9002\u5408\u6709\u4e00\u5b9a\u8fd0\u7ef4\u548c\u529f\u80fd\u9700\u6c42\u7684\u573a\u666f\u3002

    Loggie\u76ee\u524d\u9ed8\u8ba4\u5185\u7f6e\u4e86metric\uff08\u76d1\u63a7\u6307\u6807\u53d1\u9001\uff09\u3001 maxbytes\uff08\u6700\u5927event\u5b57\u8282\u6570\u9650\u5236\uff09\u3001 retry\uff08\u91cd\u8bd5\uff09\u4e09\u4e2ainterceptors\u3002\u5373\u4f7f\u6211\u4eec\u6ca1\u6709\u4f7f\u7528\u4ee5\u4e0a\u4e24\u79cd\u65b9\u5f0f\u914d\u7f6e\uff0c\u4ecd\u7136\u4f1a\u81ea\u52a8\u4f7f\u7528\u8fd93\u4e2a\u9ed8\u8ba4interceptor\uff0c\u6240\u4ee5interceptor\u5176\u5b9e\u662f\u53ef\u9009\u9879\u3002

    Caution

    \u521b\u5efa\u4e00\u4e2ainterceptor\u793a\u4f8b\u5982\u4e0b\uff1a

    Example

    cat << EOF | kubectl apply -f -\napiVersion: loggie.io/v1beta1\nkind: Interceptor\nmetadata:\nname: default\nspec:\ninterceptors: |\n- type: rateLimit\nqps: 90000\nEOF\n

    \u8fd9\u91cc\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2arateLimit interceptor\uff0c\u53ef\u7528\u4e8e\u91c7\u96c6\u53d1\u9001\u65e5\u5fd7\u7684\u9650\u6d41\u3002 \u53ef\u4ee5\u901a\u8fc7kubectl get interceptor default\u6216\u8005kubectl get icp default\u67e5\u770b\u662f\u5426\u521b\u5efa\u6210\u529f\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#logconfig","title":"\u521b\u5efalogConfig","text":"

    \u521b\u5efa\u5b8csink\u548cinterceptor\u540e\uff0c\u6700\u91cd\u8981\u7684\u4fbf\u662f\u521b\u5efalogConfig\uff0c\u8868\u660e\u6211\u4eec\u5e0c\u671b\u91c7\u96c6\u54ea\u4e9bPod\u7684\u65e5\u5fd7\uff0c\u4ee5\u53ca\u91c7\u96c6Pod\u7684\u54ea\u4e9b\u65e5\u5fd7\u3002

    logConfig\u91ccspec.selector\u90e8\u5206\u8868\u793a\u65e5\u5fd7\u914d\u7f6e\u7684\u4e0b\u53d1\u8303\u56f4\uff0c\u5bf9\u91c7\u96c6Pod\u65e5\u5fd7\u6765\u8bf4\uff0c\u9700\u8981\u914d\u7f6etype: pod\uff0c\u5e76\u4e14\u4f7f\u7528labelSelector\u9009\u62e9\u6307\u5b9a\u7684Pods\uff0c\u5373\u91c7\u96c6\u8fd9\u4e9bPods\u7684\u65e5\u5fd7\u3002 \u793a\u4f8b\u5982\u4e0b\uff1a

    spec:\nselector:\ntype: pod\nlabelSelector:\napp: tomcat\n

    \u53e6\u5916\uff0c\u6211\u4eec\u9700\u8981\u5728pipeline.sources\u4e2d\u914d\u7f6efile source\uff0c\u5373\u91c7\u96c6Pods\u7684\u54ea\u4e9b\u65e5\u5fd7\u3002

      pipeline:\nsources: |\n- type: file\nname: mylog\npaths:\n- stdout\n- /var/log/*.log\n
    \u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a

    \u6700\u540e\uff0c\u6211\u4eec\u4f7f\u7528sinkRef\u548cinterceptorRef\u5f15\u7528\u4e0a\u9762\u521b\u5efa\u7684sink\u548cinterceptor\u3002 \u6700\u7ec8\u521b\u5efa\u4e00\u4e2alogConfig\u793a\u4f8b\u5982\u4e0b\uff1a

    Example

    cat << EOF | kubectl apply -f -\napiVersion: loggie.io/v1beta1\nkind: LogConfig\nmetadata:\nname: tomcat\nnamespace: default\nspec:\nselector:\ntype: pod\nlabelSelector:\napp: tomcat\npipeline:\nsources: |\n- type: file\nname: common\npaths:\n- stdout\n- /usr/local/tomcat/logs/*.log\nsinkRef: default\ninterceptorRef: default\nEOF\n

    \u6211\u4eec\u53ef\u4ee5\u901a\u8fc7kubectl get logconfig tomcat\u6216\u8005kubectl get lgc tomcat\u6765\u67e5\u770b\u662f\u5426\u521b\u5efa\u6210\u529f\u3002 \u540c\u65f6\u53ef\u4ee5\u901a\u8fc7kubectl describe lgc tomcat\u67e5\u770blogConfig\u7684events\uff0c\u7528\u4e8e\u6392\u67e5\u72b6\u6001\u3002 \u5982\u679c\u6709\u4ee5\u4e0b\u7c7b\u4f3c\u7684events\uff0c\u8bf4\u660e\u914d\u7f6e\u5df2\u7ecf\u4e0b\u53d1\u6210\u529f\u3002

    Events:\n  Type    Reason       Age   From                       Message\n  ----    ------       ----  ----                       -------\n  Normal  syncSuccess  55s   loggie/kind-control-plane  Sync type pod [tomcat-684c698b66-hvztn] success\n

    \u6211\u4eec\u8fd8\u53ef\u4ee5\u901a\u8fc7kubectl -nloggie logs -f ${loggie-name}\u6765\u67e5\u770b\u6307\u5b9a\u8282\u70b9Loggie\u7684\u65e5\u5fd7\u6765\u5224\u65ad\u65e5\u5fd7\u91c7\u96c6\u60c5\u51b5\u3002

    \u53d1\u9001\u6210\u529f\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Kibana\u4e0a\u67e5\u8be2\u5230\u91c7\u96c6\u5230\u7684\u65e5\u5fd7\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#_5","title":"\u81ea\u52a8\u89e3\u6790\u5bb9\u5668\u6807\u51c6\u8f93\u51fa\u539f\u59cb\u65e5\u5fd7","text":"

    \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u91c7\u96c6\u5230\u7684\u6807\u51c6\u8f93\u51fa\u5e76\u4e0d\u662f\u6253\u5370\u7684\u65e5\u5fd7\u5185\u5bb9\uff0c\u800c\u662f\u88ab\u5bb9\u5668\u8fd0\u884c\u65f6\u589e\u52a0\u4e86\u4e00\u5c42\u5c01\u88c5\u3002

    \u4f8b\u5982docker\u7684\u6807\u51c6\u8f93\u51fa\u4e3ajson\u5f62\u5f0f\uff1a

    {\"log\":\"I0610 08:29:07.698664 Waiting for caches to sync\\n\", \"stream\":\"stderr\", \"time:\"2021-06-10T08:29:07.698731204Z\"}\n
    \u4e1a\u52a1\u6253\u5370\u7684\u539f\u59cb\u65e5\u5fd7\u5185\u5bb9\u5b58\u50a8\u5728log\u5b57\u6bb5\u91cc\u3002

    containerd\u7684\u6807\u51c6\u8f93\u51fa\u5f62\u5f0f\u7c7b\u4f3c\u5982\u4e0b\uff1a

    2021-12-01T03:13:58.298476921Z stderr F INFO [main] Starting service [Catalina]\n
    \u524d\u97622021-12-01T03:13:58.298476921Z stderr F\u4e3a\u8fd0\u884c\u65f6\u589e\u52a0\u7684\u524d\u7f00\u5185\u5bb9\uff0c\u540e\u9762\u5219\u4e3a\u539f\u59cb\u7684\u65e5\u5fd7\u3002

    \u7279\u522b\u662f\u5982\u679c\u6211\u4eec\u914d\u7f6e\u4e86\u65e5\u5fd7\u91c7\u96c6\u591a\u884c\u914d\u7f6e\uff0c\u56e0\u4e3a\u91c7\u96c6\u5230\u7684\u65e5\u5fd7\u5185\u5bb9\u548c\u4e1a\u52a1\u8f93\u51fa\u7684\u65e5\u5fd7\u4e0d\u4e00\u81f4\uff0c\u4f1a\u5bfc\u81f4\u91c7\u96c6\u6807\u51c6\u8f93\u51fa\u65e5\u5fd7\u5339\u914d\u591a\u884c\u6709\u95ee\u9898\u3002

    \u6240\u4ee5\uff0cLoggie\u63d0\u4f9b\u4e86\u4e00\u952e\u5f00\u5173\u914d\u7f6e\uff0c\u5728\u7cfb\u7edf\u914d\u7f6e\u4e2d\uff0c\u5c06parseStdout\u53c2\u6570\u8bbe\u7f6e\u4e3atrue\u5373\u53ef\u3002

    parseStdout

    config:\nloggie:\ndiscovery:\nenabled: true\nkubernetes:\nparseStdout: true\n

    Loggie\u4f1a\u5728\u6e32\u67d3LogConfig\u7684\u65f6\u5019\u81ea\u52a8\u589e\u52a0source codec\u89e3\u6790\u51fa\u539f\u59cb\u7684\u4e1a\u52a1\u65e5\u5fd7\u3002

    \u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a

    "},{"location":"user-guide/use-in-kubernetes/collect-container-logs/#volume","title":"\u65e0\u9700\u6302\u8f7dvolume\u7684\u5bb9\u5668\u65e5\u5fd7\u91c7\u96c6","text":"

    \u867d\u7136\u6211\u4eec\u5efa\u8bae\u4f7f\u7528\u6302\u8f7dvolume(emptyDir/hostPath+subPathExpr)\u7684\u65b9\u5f0f\u5c06\u65e5\u5fd7\u6587\u4ef6\u6302\u51fa\u7ed9Loggie\u91c7\u96c6\uff0c\u4f46\u4ecd\u7136\u5b58\u5728\u5f88\u591a\u60c5\u51b5\u6211\u4eec\u6ca1\u529e\u6cd5\u5c06\u4e1a\u52a1\u7684Pod\u7edf\u4e00\u6302\u8f7d\u51fa\u65e5\u5fd7\u8def\u5f84\u3002 \u6bd4\u5982\u4e00\u4e9b\u57fa\u7840\u7ec4\u4ef6\u65e0\u6cd5\u914d\u7f6e\u72ec\u7acb\u7684\u65e5\u5fd7volume\uff0c\u6216\u8005\u4e1a\u52a1\u5355\u7eaf\u7684\u4e0d\u613f\u610f\u6539\u90e8\u7f72\u914d\u7f6e\u3002

    Loggie\u63d0\u4f9b\u4e86\u65e0\u9700\u6302\u8f7d\u5373\u53ef\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\u7684\u80fd\u529b\uff0c\u53ef\u81ea\u52a8\u8bc6\u522b\u5e76\u91c7\u96c6\u5bb9\u5668root filesystem\u91cc\u7684\u65e5\u5fd7\u6587\u4ef6\u3002

    \u4f60\u53ea\u9700\u8981\u5c06\u90e8\u7f72\u7684helm chart\u4e2dvalues.yml\u91cc\u7684\u914d\u7f6erootFsCollectionEnabled\u8bbe\u7f6e\u4e3atrue\uff0c \u540c\u65f6\u586b\u4e0a\u5b9e\u9645\u73af\u5883\u7684\u5bb9\u5668\u8fd0\u884c\u65f6\uff08docker/containerd\uff09\uff0c\u5982\u4e0b\u6240\u793a\uff1a

    rootFsCollectionEnabled

    config:\nloggie:\ndiscovery:\nenabled: true\nkubernetes:\ncontainerRuntime: containerd\nrootFsCollectionEnabled: false\n

    \u4fee\u6539\u5b8c\u6210\u540e\uff0c\u91cd\u65b0helm upgrade\u5373\u53ef\u3002 helm\u6a21\u7248\u4f1a\u81ea\u52a8\u6e32\u67d3\u589e\u52a0\u989d\u5916\u7684\u4e00\u4e9b\u6302\u8f7d\u8def\u5f84\u548c\u914d\u7f6e\uff0c\u5982\u679c\u4f60\u4ece\u4f4e\u7248\u672c\u5347\u7ea7\uff0c\u9700\u8981\u989d\u5916\u4fee\u6539\u90e8\u7f72\u7684Daemonset yaml\u3002 \u5177\u4f53\u539f\u7406\u8bf7\u53c2\u8003issues #208\u3002

    \u8bf7\u6ce8\u610f\uff1a - containerd\u8fd0\u884c\u65f6\u4e0b\u7684\u65e0\u6302\u8f7dvolume\u7684\u5bb9\u5668\u65e5\u5fd7\u91c7\u96c6\u6682\u672a\u5927\u89c4\u6a21\u751f\u4ea7\u8fd0\u884c\u8fc7\uff0c\u8bf7\u8c28\u614e\u4f7f\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-node-logs/","title":"\u4f7f\u7528Loggie\u91c7\u96c6Node\u8282\u70b9\u65e5\u5fd7","text":"

    \u5728Kubernetes\u96c6\u7fa4\u4e2d\uff0c\u9664\u4e86\u91c7\u96c6Pod\u91cc\u7684\u65e5\u5fd7\uff0c\u8fd8\u53ef\u80fd\u6709\u91c7\u96c6Node\u8282\u70b9\u4e0a\u7684\u4e00\u4e9b\u8bf8\u5982kubelet\u65e5\u5fd7\u3001\u7cfb\u7edf\u65e5\u5fd7\u7b49\u9700\u6c42\u3002

    "},{"location":"user-guide/use-in-kubernetes/collect-node-logs/#_1","title":"\u914d\u7f6e\u8bf4\u660e","text":"

    \u548c\u91c7\u96c6\u5bb9\u5668\u4e0d\u540c\u7684\u662f\uff0c\u8282\u70b9\u65e5\u5fd7\u91c7\u96c6\u9700\u4f7f\u7528\u96c6\u7fa4\u7ea7\u522b\u7684ClusterLogConfig\uff0cselector\u4f7f\u7528type: node\uff0c\u5e76\u4e14\u586b\u5199nodeSelector\u7528\u4e8e\u9009\u62e9\u4e0b\u53d1\u914d\u7f6e\u5230\u54ea\u4e9b\u8282\u70b9\uff0c\u540c\u65f6\u9700\u786e\u4fddNode\u4e0a\u5305\u542b\u8fd9\u4e9blabels\u3002

    \u793a\u4f8b\u5982\u4e0b\uff1a

    Example

    apiVersion: loggie.io/v1beta1\nkind: ClusterLogConfig\nmetadata:\nname: varlog\nspec:\nselector:\ntype: node\nnodeSelector:\nnodepool: demo\npipeline:\nsources: |\n- type: file\nname: varlog\npaths:\n- /var/log/*.log\nsinkRef: default\ninterceptorRef: default\n

    \u53e6\u5916\u5e94\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u9700\u8981\u91c7\u96c6Node\u8282\u70b9\u4e0a\u67d0\u8def\u5f84\u7684\u65e5\u5fd7\uff0c\u9700\u8981Loggie\u540c\u6837\u6302\u8f7d\u76f8\u540c\u7684\u8def\u5f84\uff0c\u5426\u5219\u7531\u4e8e\u5bb9\u5668\u9694\u79bb\u6027Loggie\u65e0\u6cd5\u83b7\u53d6\u5230\u8282\u70b9\u7684\u65e5\u5fd7\u3002 \u6bd4\u5982\u91c7\u96c6Node\u4e0a/var/log/\u8def\u5f84\u4e0b\u7684\u65e5\u5fd7\uff0c\u9700\u8981Loggie Agent\u589e\u52a0\u6302\u8f7d\u8be5\u8def\u5f84\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/","title":"Kubernetes\u4e0b\u7684\u65e5\u5fd7\u91c7\u96c6","text":"

    Cite

    \u76f8\u6bd4\u4f20\u7edf\u7684\u4e3b\u673a\u65e5\u5fd7\u91c7\u96c6\uff0c\u5728Kubernetes\u96c6\u7fa4\u4e2d\uff0c\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\u6709\u4e00\u4e9b\u5dee\u5f02\uff0c\u4f7f\u7528\u65b9\u5f0f\u4e0a\u4e5f\u6709\u6240\u533a\u522b\u3002 \u8fd9\u91cc\u6211\u4eec\u7f57\u5217\u4e86\u4e00\u4e9b\u5e38\u89c4\u7684\u90e8\u7f72\u548c\u4f7f\u7528\u65b9\u5f0f\u4ee5\u4f9b\u53c2\u8003\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#1","title":"1. \u4ece\u4e3b\u673a\u5230\u5bb9\u5668","text":"

    \u5728\u4f20\u7edf\u7684\u4f7f\u7528\u865a\u62df\u673a/\u4e91\u4e3b\u673a/\u7269\u7406\u673a\u7684\u65f6\u4ee3\uff0c\u4e1a\u52a1\u8fdb\u7a0b\u90e8\u7f72\u5728\u56fa\u5b9a\u7684\u8282\u70b9\u4e0a\uff0c\u4e1a\u52a1\u65e5\u5fd7\u76f4\u63a5\u8f93\u51fa\u5230\u5bbf\u4e3b\u673a\u4e0a\uff0c\u8fd0\u7ef4\u53ea\u9700\u8981\u624b\u52a8\u6216\u8005\u4f7f\u7528\u81ea\u52a8\u5316\u5de5\u5177\u628a\u65e5\u5fd7\u91c7\u96c6Agent\u90e8\u7f72\u5728\u8282\u70b9\u4e0a\uff0c\u52a0\u4e00\u4e0bAgent\u7684\u914d\u7f6e\uff0c\u5c31\u53ef\u4ee5\u5f00\u59cb\u91c7\u96c6\u65e5\u5fd7\u4e86\u3002

    \u800c\u5728Kubernetes\u73af\u5883\u4e2d\uff0c\u60c5\u51b5\u5c31\u6ca1\u8fd9\u4e48\u7b80\u5355\u4e86\uff1a

    \u4ee5\u4e0a\u90fd\u662f\u6709\u522b\u4e8e\u4f20\u7edf\u65e5\u5fd7\u91c7\u96c6\u914d\u7f6e\u65b9\u5f0f\u7684\u9700\u6c42\u548c\u75db\u70b9\uff0c\u7a76\u5176\u539f\u56e0\uff0c\u8fd8\u662f\u56e0\u4e3a\u4f20\u7edf\u7684\u65b9\u5f0f\u8131\u79bb\u4e86Kubernetes\uff0c\u65e0\u6cd5\u611f\u77e5Kubernetes\uff0c\u65e0\u6cd5\u548cKubernetes\u96c6\u6210\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#2-kubernetes","title":"2. \u5728Kubernetes\u4e0b\u7684\u65e5\u5fd7\u5f62\u6001","text":"

    \u4e3a\u4e86\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff0c\u6211\u4eec\u5148\u6765\u770b\u4e00\u4e0b\u5e02\u9762\u4e0a\u4e00\u822c\u90fd\u6709\u54ea\u4e9b\u89e3\u51b3\u65b9\u6848\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#21","title":"2.1 \u91c7\u96c6\u7684\u65e5\u5fd7\u7c7b\u578b","text":"

    \u9996\u5148\uff0c\u9700\u8981\u63d0\u53ca\u7684\u662f\uff0c\u5728\u4e91\u539f\u751f\u768412\u8981\u7d20\u91cc\uff0c\u63a8\u8350\u4e1a\u52a1\u5bb9\u5668\u5c06\u65e5\u5fd7\u8f93\u51fa\u5230stdout\u4e2d\uff0c\u800c\u4e0d\u662f\u91c7\u7528\u6253\u5370\u65e5\u5fd7\u6587\u4ef6\u7684\u65b9\u5f0f\u3002\u5f53\u7136\uff0c\u5b9e\u9645\u60c5\u51b5\u662f\uff0c\u6211\u4eec\u5f88\u96be\u8fd9\u4e48\u505a\uff0c\u539f\u56e0\u5927\u6982\u6709\uff1a

    \u6240\u4ee5\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u9700\u8981\u540c\u65f6\u91c7\u96c6\uff1a

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#22-agent","title":"2.2 Agent\u90e8\u7f72\u65b9\u5f0f","text":"

    \u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff0cAgent\u6709\u4e24\u79cd\u90e8\u7f72\u65b9\u5f0f\uff1a

    1. DaemonSet\uff1a\u6bcf\u4e2a\u8282\u70b9\u90e8\u7f72\u4e00\u4e2aAgent
    2. Sidecar\uff1a\u6bcf\u4e2aPod\u589e\u52a0\u4e00\u4e2aSidecar\u5bb9\u5668\uff0c\u8fd0\u884c\u65e5\u5fd7Agent

    \u4e24\u79cd\u90e8\u7f72\u65b9\u5f0f\u7684\u4f18\u52a3\u90fd\u663e\u800c\u6613\u89c1\uff1a

    Tip

    \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u4f18\u5148\u4f7f\u7528DaemonSet\u7684\u65b9\u5f0f\u91c7\u96c6\u65e5\u5fd7\uff0c\u5982\u679c\u5355\u4e2aPod\u65e5\u5fd7\u91cf\u7279\u522b\u5927\uff0c\u8d85\u8fc7\u4e00\u822cAgent\u53d1\u9001\u541e\u5410\u91cf\uff0c\u53ef\u4ee5\u5355\u72ec\u5bf9\u8be5Pod\u4f7f\u7528Sidecar\u7684\u65b9\u5f0f\u91c7\u96c6\u65e5\u5fd7\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#23","title":"2.3 \u91c7\u96c6\u65b9\u5f0f","text":""},{"location":"user-guide/use-in-kubernetes/general-usage/#daemonset-stdout","title":"DaemonSet + Stdout","text":"

    \u5982\u679c\u4f7f\u7528\u5bb9\u5668\u8fd0\u884c\u65f6\u7684\u662fdocker\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\u6211\u4eec\u53ef\u4ee5\u5728\u8282\u70b9\u7684docker\u8def\u5f84\u4e2d\u627e\u5230\u5bb9\u5668\u7684stdout\u7684\u65e5\u5fd7\uff0c\u9ed8\u8ba4\u4e3a/var/lib/docker/containers/{containerId}/{containerId}-json.log\u3002

    \u5728Kubernetes 1.14\u7248\u672c\u4e4b\u524d\uff0ckubelet\u4f1a\u5728/var/log/pods/<podUID>/<containerName>/<num>.log\u5efa\u7acb\u4e00\u4e2a\u8f6f\u94fe\u63a5\u5230stdout\u6587\u4ef6\u4e2d\u3002

    \u7c7b\u4f3c\u5982\u4e0b\u6240\u793a\uff1a

    root@master0:/var/log/pods# tree .\n|-- 6687e53201c01e3fad31e7d72fbb92a6\n|   `-- kube-apiserver\n|       |-- 865.log -> /var/lib/docker/containers/3a35ae0a1d0b26455fbd9b267cd9d6ac3fbd3f0b12ee03b4b22b80dc5a1cde03/3a35ae0a1d0b26455fbd9b267cd9d6ac3fbd3f0b12ee03b4b22b80dc5a1cde03-json.log\n|       `-- 866.log -> /var/lib/docker/containers/15a6924f14fcbf15dd37d1c185c5b95154fa2c5f3de9513204b1066bbe474662/15a6924f14fcbf15dd37d1c185c5b95154fa2c5f3de9513204b1066bbe474662-json.log\n|-- a1083c6d-3b12-11ea-9af1-fa163e28f309\n|   `-- kube-proxy\n|       |-- 3.log -> /var/lib/docker/containers/4b63b5a90a8f9ca6b6f20b49b5ab2564f92df21a5590f46de2a46b031e55c80e/4b63b5a90a8f9ca6b6f20b49b5ab2564f92df21a5590f46de2a46b031e55c80e-json.log\n|       `-- 4.log -> /var/lib/docker/containers/fc7c315d33935887ca3479a38cfca4cca66fad782b8a120c548ad0b9f0ff7207/fc7c315d33935887ca3479a38cfca4cca66fad782b8a120c548ad0b9f0ff7207-json.log\n

    \u5728Kubernetes 1.14\u7248\u672c\u4e4b\u540e\uff0c\u6539\u6210\u4e86/var/log/pods/<namespace>_<pod_name>_<pod_id>/<container_name>/<num>.log\u7684\u5f62\u5f0f\u3002

    root@master-0:/var/log/pods# tree .\n|-- kube-system_kube-apiserver-kind-control-plane_bd1c21fe1f0ef615e0b5e41299f1be61\n|   `-- kube-apiserver\n|       `-- 0.log\n|-- kube-system_kube-proxy-gcrfq_f07260b8-6055-4c19-9491-4a825579528f\n|   `-- kube-proxy\n|       `-- 0.log\n`-- loggie_loggie-csd4g_f1cc32e9-1002-4e64-bd58-fc6094394e06\n    `-- loggie\n        `-- 0.log\n

    \u6240\u4ee5\uff0c\u5bf9\u4e8eAgent\u91c7\u96c6\u6807\u51c6\u8f93\u51fa\u65e5\u5fd7\u6765\u8bf4\uff0c\u4e5f\u5c31\u662f\u91c7\u96c6\u8282\u70b9\u4e0a\u7684\u8fd9\u4e9b\u65e5\u5fd7\u6587\u4ef6\u3002

    \u4e00\u79cd\u7b80\u5355\u7c97\u66b4\u7684\u91c7\u96c6\u65b9\u5f0f\u662f\uff0c\u4f7f\u7528DaemonSet\u90e8\u7f72\u65e5\u5fd7Agent\uff0c\u6302\u8f7d/var/log/pods\u76ee\u5f55\uff0cAgent\u7684\u914d\u7f6e\u6587\u4ef6\u4f7f\u7528\u7c7b\u4f3c/var/log/pod/*/*.log\u53bb\u901a\u914d\u65e5\u5fd7\u6587\u4ef6\uff0c\u91c7\u96c6\u8282\u70b9\u4e0a\u6240\u6709\u7684\u5bb9\u5668\u6807\u51c6\u8f93\u51fa\u3002

    \u4f46\u662f\u8fd9\u6837\u7684\u5c40\u9650\u5728\u4e8e\uff1a

    \u5f53\u7136\u73b0\u5728\u7684\u4e00\u4e9b\u65e5\u5fd7Agent\u6bd4\u5982Filebeat/Fluentd\u90fd\u9488\u5bf9\u6027\u7684\u505a\u4e86\u652f\u6301\uff0c\u6bd4\u5982\u53ef\u4ee5\u5c06namespace/pod\u7b49\u4fe1\u606f\u6ce8\u5165\u65e5\u5fd7\u4e2d\uff0c\u4f46\u4ecd\u7136\u6ca1\u6709\u89e3\u51b3\u5927\u90e8\u5206\u7684\u95ee\u9898\u3002

    \u6240\u4ee5\uff0c\u8fd9\u79cd\u65b9\u5f0f\u53ea\u9002\u5408\u7b80\u5355\u7684\u4e1a\u52a1\u573a\u666f\uff0c\u540e\u7eed\u4e5f\u96be\u4ee5\u6ee1\u8db3\u5176\u4ed6\u66f4\u591a\u7684\u65e5\u5fd7\u9700\u6c42\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#daemonset","title":"DaemonSet + \u65e5\u5fd7\u6587\u4ef6","text":"

    \u5982\u679cPod\u91cc\u4e0d\u4ec5\u4ec5\u662f\u8f93\u51fastdout\uff0c\u8fd8\u5305\u62ec\u65e5\u5fd7\u6587\u4ef6\uff0c\u5c31\u9700\u8981\u8003\u8651\u5230\u6302\u8f7d\u65e5\u5fd7\u6587\u4ef6\u5230\u8282\u70b9\u4e0a\uff0c\u540c\u65f6\u91c7\u7528DaemonSet\u90e8\u7f72\u7684Agent\u4e5f\u9700\u8981\u6302\u8f7d\u76f8\u540c\u7684\u76ee\u5f55\uff0c\u5426\u5219\u91c7\u7528\u5bb9\u5668\u5316\u90e8\u7f72\u7684Agent\u65e0\u6cd5\u67e5\u770b\u5230\u76f8\u5e94\u7684\u6587\u4ef6\uff0c\u66f4\u65e0\u6cd5\u91c7\u96c6\u3002

    \u4e1a\u52a1Pod\u6302\u8f7d\u65e5\u5fd7\u8def\u5f84\u7684\u65b9\u5f0f\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a

    (1) emtpyDir

    emtpyDir\u7684\u751f\u547d\u5468\u671f\u8ddf\u968fPod\uff0cPod\u9500\u6bc1\u540e\u5176\u4e2d\u5b58\u50a8\u7684\u65e5\u5fd7\u4e5f\u4f1a\u6d88\u5931\u3002

    \u4f7f\u7528emptyDir\u6302\u8f7d\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u4e00\u822c\u5728\u8282\u70b9\u7684\u8def\u5f84\u5982\u4e0b\uff1a

    /var/lib/kubelet/pods/${pod.UID}/volumes/kubernetes.io~empty-dir/${volumeName}\n

    (2) hostPath

    \u751f\u547d\u5468\u671f\u548cPod\u65e0\u5173\uff0cPod\u8fc1\u79fb\u6216\u8005\u9500\u6bc1\uff0c\u65e5\u5fd7\u6587\u4ef6\u8fd8\u4fdd\u7559\u5728\u73b0\u6709\u78c1\u76d8\u4e0a\u3002

    \u4e3a\u4e86\u89e3\u51b3\u9694\u79bb\u6027\uff0c\u907f\u514d\u591a\u4e2aPod\u6253\u5370\u65e5\u5fd7\u5230\u76f8\u540c\u7684\u8def\u5f84\u548c\u6587\u4ef6\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528 subPathExpr \u5b57\u6bb5\u4ece Downward API \u73af\u5883\u53d8\u91cf\u6784\u9020 subPath \u76ee\u5f55\u540d\u3002 \u8be5 VolumeSubpathEnvExpansion \u529f\u80fd\u4ece Kubernetes1.15 \u5f00\u59cb\u9ed8\u8ba4\u5f00\u542f\uff0c\u57281.17 GA\u3002\u53ef\u53c2\u8003 feature-gates \u548c using-subpath-expanded-environment\u3002

    \u4f7f\u7528subPathExpr\u7684\u793a\u4f8b\u5982\u4e0b\u6240\u793a\uff1a

    apiVersion: apps/v1\nkind: Deployment\nmetadata:\nlabels:\napp: nginx\nname: nginx\nnamespace: default\nspec:\nselector:\nmatchLabels:\napp: nginx\ntemplate:\nmetadata:\nlabels:\napp: nginx\nspec:\ncontainers:\n- env:\n- name: POD_NAME\nvalueFrom:\nfieldRef:\napiVersion: v1\nfieldPath: metadata.name\n- name: NAMESPACE\nvalueFrom:\nfieldRef:\napiVersion: v1\nfieldPath: metadata.namespace\nimage: nginx\nname: nginx\nresources: {}\nvolumeMounts:\n- mountPath: /data/log\nname: datalog\nsubPathExpr: $(NAMESPACE)/$(POD_NAME)\nvolumes:\n- hostPath:\npath: /data/log\ntype: \"\"\nname: datalog\n

    \u5728\u521b\u5efa\u5b8c\u4e4b\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u6240\u5728\u8282\u70b9\u7684/data/log\u4e0b\u53d1\u73b0\u7c7b\u4f3c\u7684\u76ee\u5f55\u7ed3\u6784\uff1a

    .\n`-- default\n    |-- nginx-888dc6778-krfqr\n    `-- nginx-888dc6778-sw8vd\n
    \u6bcf\u4e2aPod\u7684\u5b58\u653e\u7684\u65e5\u5fd7\u6587\u4ef6\u5373\u5728\u8282\u70b9\u7684/data/log/$(NAMESPACE)/$(POD_NAME)\u8def\u5f84\u4e0b\u3002

    (3) Pv Pv\u7684\u8bbf\u95ee\u6a21\u5f0f\u5305\u62ec\uff1a

    \u5bf9\u4e8e\u5927\u90e8\u5206\u7684\u4e1a\u52a1\u6765\u8bf4\uff0c\u90fd\u662fDeployment\u65e0\u72b6\u6001\u90e8\u7f72\uff0c\u9700\u8981\u6302\u8f7d\u540c\u4e00\u4e2aPv\u5171\u4eab\uff1b\u5bf9\u4e8e\u4e00\u4e9b\u4e2d\u95f4\u4ef6\u7b49\u6709\u72b6\u6001\u670d\u52a1\uff0c\u4e00\u822c\u4f1a\u4f7f\u7528StatefulSet\u90e8\u7f72\uff0c\u6bcf\u4e2aPod\u4f1a\u4f7f\u7528\u72ec\u7acb\u7684Pv\u3002

    \u867d\u7136\u540c\u6837\u53ef\u4ee5\u5728Node\u4e0a\u627e\u5230\u4f7f\u7528Pv\u6302\u8f7d\u7684\u5bf9\u5e94\u65e5\u5fd7\u6587\u4ef6\uff0c\u4f46\u662fPv\u6839\u636e\u4e0d\u540c\u7684\u5e95\u5c42\u5b9e\u73b0\uff0c\u5728Node\u4e0a\u7684\u8def\u5f84\u4f1a\u6709\u4e00\u5b9a\u7684\u533a\u522b\u3002

    \u76ee\u524d\u5e02\u9762\u4e0a\u5927\u90e8\u5206\u65e5\u5fd7Agent\u5747\u5bf9\u8fd9\u4e9b\u6302\u8f7d\u65b9\u5f0f\u6ca1\u6709\u611f\u77e5\uff0c\u6240\u4ee5\u4f60\u80fd\u505a\u7684\u548c\u4e0a\u9762\u4f7f\u7528stdout\u7684\u65b9\u5f0f\u7c7b\u4f3c\uff0c\u4e5f\u5c31\u662f\u7b80\u5355\u7c97\u66b4\u7684\u8ba9Agent\u5c06\u8def\u5f84\u90fd\u6302\u8f7d\uff0c\u4f7f\u7528\u901a\u914d\u7684\u65b9\u5f0f\u91c7\u96c6\u6240\u6709\u7684\u65e5\u5fd7\uff0c\u4f7f\u7528\u4e0a\u7684\u5c40\u9650\u548cstdout\u7684\u65b9\u5f0f\u540c\u6837\u4e00\u81f4\u3002

    \u53e6\u5916\uff0c\u9274\u4e8e\u4e00\u4e9bAgent\u5bf9\u91c7\u96c6docker stdout\u6709\u4e00\u5b9a\u7684\u652f\u6301\uff0c\u6240\u4ee5\u8fd8\u5b58\u5728\u4e00\u4e9b\u4f7f\u7528\u4e0a\u53d8\u79cd\uff0c\u6bd4\u5982\u5229\u7528webhook\u6ce8\u5165\u4e00\u4e2asidecar\uff0c\u8bfb\u53d6Pod\u91cc\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u8f6c\u6362\u6210sidecar\u7684stdout\uff0c\u7136\u540e\u91c7\u96c6sidecar\u7684stdout\u65e5\u5fd7\uff0c\u8fd9\u91cc\u4e0d\u518d\u8be6\u8ff0\u3002

    \uff084\uff09\u4e0d\u6302\u8f7d

    \u5f88\u591a\u60c5\u51b5\u4e0b\uff0c\u7528\u6237\u90fd\u758f\u4e8e\u6302\u8f7d\u65e5\u5fd7\u8def\u5f84volume\uff0c\u6216\u8005\u5bf9\u63a5\u4e00\u4e2a\u5df2\u7ecf\u5b58\u5728\u7684\u7cfb\u7edf\uff0c\u5f80\u5f80\u4e1a\u52a1\u65b9\u4e0d\u613f\u610f\u66f4\u6539\uff0c\u8fd9\u4e2a\u65f6\u5019\u80fd\u91c7\u96c6\u5bb9\u5668\u91cc\u7684\u65e5\u5fd7\u6587\u4ef6\u5417\uff1f

    Loggie\u5c1d\u8bd5\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u5f00\u542f\uff0c\u4e0d\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u4ecd\u7136\u9700\u8981\u66f4\u591a\u957f\u671f\u751f\u4ea7\u5b9e\u8df5\u7684\u68c0\u9a8c\u3002\u6b22\u8fce\u8bd5\u7528\uff0c\u5177\u4f53\u5f00\u5173\u8bf7\u53c2\u8003\u4e0b\u4e00\u8282\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#sidecar-stdout","title":"Sidecar + Stdout/\u65e5\u5fd7\u6587\u4ef6","text":"

    \u5982\u679c\u9700\u8981\u91c7\u7528sidecar\u7684\u65b9\u5f0f\uff0c\u9700\u8981\u5c06\u65e5\u5fd7Agent\u540c\u65f6\u6302\u8f7d\u76f8\u540c\u7684\u65e5\u5fd7\u8def\u5f84\uff0cAgent\u7684\u914d\u7f6e\u6587\u4ef6\u4e5f\u4e00\u822c\u4f7f\u7528ConfigMap\u6302\u8f7d\u51fa\u6765\u3002

    \u4f7f\u7528Sidecar\u7684\u90e8\u7f72\u65b9\u5f0f\u548cDaemonSet\u7684\u65b9\u5f0f\u4f18\u52a3\u5bf9\u6bd4\u8bf7\u53c2\u8003\u4e0a\u6587\u3002

    \u603b\u7ed3\uff1a \u5927\u90e8\u5206\u4e3b\u6d41\u7684\u5f00\u6e90Agent\uff0c\u53ea\u5bf9\u5bb9\u5668Stdout\u6709\u90e8\u5206\u652f\u6301\uff0c\u6bd4\u5982\u652f\u6301\u91c7\u96c6\u7684\u65f6\u5019\u7edf\u4e00\u52a0\u4e0a\u4e00\u4e9bK8s\u76f8\u5173\u5143\u4fe1\u606f\uff0c\u4f46\u4e0d\u652f\u6301\u5355\u72ec\u9488\u5bf9\u67d0\u4e9bPod\u8fdb\u884c\u914d\u7f6e\uff0c\u800c\u4e14\u5747\u6ca1\u6709\u5bf9\u5bb9\u5668\u4e2d\u7684\u65e5\u5fd7\u6587\u4ef6\u91c7\u96c6\u6709\u5f88\u597d\u7684\u652f\u6301\u3002 \u8fd9\u6837\u5bfc\u81f4\u5728\u5b9e\u9645\u590d\u6742\u7684\u5404\u7c7b\u4e1a\u52a1\u573a\u666f\u4e2d\uff0c\u6ca1\u529e\u6cd5\u6ee1\u8db3\u9700\u6c42\u3002

    "},{"location":"user-guide/use-in-kubernetes/general-usage/#loggie","title":"Loggie\u5982\u4f55\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff1f","text":"

    \u76f8\u4fe1\u4ee5\u4e0a\u5217\u51fa\u7684\u95ee\u9898\u5927\u5bb6\u90fd\u9047\u5230\u6216\u8005\u601d\u8003\u8fc7\uff0c\u90a3Loggie\u662f\u5982\u4f55\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u7684\u5462\uff1f \u8bf7\u770b\u4e0b\u4e00\u8282\u5982\u4f55 \u4f7f\u7528Loggie\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff1f

    "},{"location":"user-guide/use-in-kubernetes/kube-event-source/","title":"\u91c7\u96c6Kubernetes Events","text":"

    \u9664\u4e86\u4f7f\u7528Logconfig\u91c7\u96c6\u65e5\u5fd7\u5916\uff0cLoggie\u540c\u6837\u53ef\u4ee5\u901a\u8fc7CRD\u914d\u7f6e\u4efb\u610f\u7684source/sink/interceptor\uff0c\u672c\u8d28\u4e0aLoggie\u5c31\u662f\u4e00\u4e2a\u652f\u6301\u591aPipeline\u7684\u6570\u636e\u6d41\uff0c\u96c6\u6210\u4e86\u901a\u7528\u7684\u8bf8\u5982\u961f\u5217\u91cd\u8bd5\u3001\u6570\u636e\u5904\u7406\u3001\u914d\u7f6e\u4e0b\u53d1\u3001\u76d1\u63a7\u62a5\u8b66\u7b49\u7b49\u529f\u80fd\uff0c\u51cf\u5c11\u4e86\u7c7b\u4f3c\u9700\u6c42\u7684\u7814\u53d1\u6210\u672c\u3002\u91c7\u96c6Kubernetes\u7684Events\u5c31\u662f\u5176\u4e2d\u4e00\u4e2a\u5f88\u597d\u7684\u4f8b\u5b50\u3002

    Kubernetes Events\u662f\u7531Kubernetes\u672c\u8eab\u7ec4\u4ef6\u548c\u4e00\u4e9b\u63a7\u5236\u5668\u4ea7\u751f\u7684\u4e8b\u4ef6\uff0c\u6211\u4eec\u5e38\u7528\u7684kubectl describe\u547d\u4ee4\u5c31\u53ef\u4ee5\u67e5\u770b\u5173\u8054\u8d44\u6e90\u7684\u4e8b\u4ef6\u4fe1\u606f\uff0c\u91c7\u96c6\u8bb0\u5f55\u8fd9\u4e9b\u4e8b\u4ef6\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u56de\u6eaf\u3001\u6392\u67e5\u3001\u5ba1\u8ba1\u3001\u603b\u7ed3\u95ee\u9898\uff0c\u66f4\u597d\u7684\u4e86\u89e3Kubernetes\u96c6\u7fa4\u5185\u90e8\u72b6\u6001\u3002

    "},{"location":"user-guide/use-in-kubernetes/kube-event-source/#_1","title":"\u51c6\u5907","text":"

    \u548cLoggie\u4e2d\u8f6c\u673a\u7c7b\u4f3c\uff0c\u6211\u4eec\u53ef\u4ee5\u5355\u72ec\u90e8\u7f72Aggregator\u96c6\u7fa4\u6216\u8005\u590d\u7528\u73b0\u6709\u7684\u4e2d\u8f6c\u673a\u96c6\u7fa4\u3002

    "},{"location":"user-guide/use-in-kubernetes/kube-event-source/#_2","title":"\u914d\u7f6e\u793a\u4f8b","text":"

    \u914d\u7f6ekubeEvents source\uff0c\u5e76\u4e14\u4f7f\u7528type: cluster\u4e0b\u53d1\u914d\u7f6e\u5230Aggregator\u96c6\u7fa4\u5373\u53ef\u3002

    Config

    apiVersion: loggie.io/v1beta1\nkind: ClusterLogConfig\nmetadata:\nname: kubeevent\nspec:\nselector:\ntype: cluster\ncluster: aggregator\npipeline:\nsources: |\n- type: kubeEvent\nname: event\nsinkRef: dev\n

    \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4e0d\u7ba1\u662f\u53d1\u9001\u7ed9Elasticsearch\u8fd8\u662f\u5176\u4ed6\u7684sink\uff0c\u8f93\u51fa\u7684\u662f\u7c7b\u4f3c\u5982\u4e0b\u683c\u5f0f\u7684\u6570\u636e:

    event

    {\n\"body\": \"{\\\"metadata\\\":{\\\"name\\\":\\\"loggie-aggregator.16c277f8fc4ff0d0\\\",\\\"namespace\\\":\\\"loggie-aggregator\\\",\\\"uid\\\":\\\"084cea27-cd4a-4ce4-97ef-12e70f37880e\\\",\\\"resourceVersion\\\":\\\"2975193\\\",\\\"creationTimestamp\\\":\\\"2021-12-20T12:58:45Z\\\",\\\"managedFields\\\":[{\\\"manager\\\":\\\"kube-controller-manager\\\",\\\"operation\\\":\\\"Update\\\",\\\"apiVersion\\\":\\\"v1\\\",\\\"time\\\":\\\"2021-12-20T12:58:45Z\\\",\\\"fieldsType\\\":\\\"FieldsV1\\\",\\\"fieldsV1\\\":{\\\"f:count\\\":{},\\\"f:firstTimestamp\\\":{},\\\"f:involvedObject\\\":{\\\"f:apiVersion\\\":{},\\\"f:kind\\\":{},\\\"f:name\\\":{},\\\"f:namespace\\\":{},\\\"f:resourceVersion\\\":{},\\\"f:uid\\\":{}},\\\"f:lastTimestamp\\\":{},\\\"f:message\\\":{},\\\"f:reason\\\":{},\\\"f:source\\\":{\\\"f:component\\\":{}},\\\"f:type\\\":{}}}]},\\\"involvedObject\\\":{\\\"kind\\\":\\\"DaemonSet\\\",\\\"namespace\\\":\\\"loggie-aggregator\\\",\\\"name\\\":\\\"loggie-aggregator\\\",\\\"uid\\\":\\\"7cdf4792-815d-4eba-8a81-d60131ad1fc4\\\",\\\"apiVersion\\\":\\\"apps/v1\\\",\\\"resourceVersion\\\":\\\"2975170\\\"},\\\"reason\\\":\\\"SuccessfulCreate\\\",\\\"message\\\":\\\"Created pod: loggie-aggregator-pbkjk\\\",\\\"source\\\":{\\\"component\\\":\\\"daemonset-controller\\\"},\\\"firstTimestamp\\\":\\\"2021-12-20T12:58:45Z\\\",\\\"lastTimestamp\\\":\\\"2021-12-20T12:58:45Z\\\",\\\"count\\\":1,\\\"type\\\":\\\"Normal\\\",\\\"eventTime\\\":null,\\\"reportingComponent\\\":\\\"\\\",\\\"reportingInstance\\\":\\\"\\\"}\",\n\"systemPipelineName\": \"default/kubeevent/\",\n\"systemSourceName\": \"event\"\n}\n

    \u4e3a\u4e86\u65b9\u4fbf\u5206\u6790\u5c55\u793a\uff0c\u6211\u4eec\u53ef\u4ee5\u6dfb\u52a0\u4e00\u4e9binterceptor\u5c06\u91c7\u96c6\u5230\u7684events\u6570\u636ejson decode\u3002

    \u914d\u7f6e\u793a\u4f8b\u5982\u4e0b\uff0c\u5177\u4f53\u8bf7\u53c2\u8003\u65e5\u5fd7\u5207\u5206\u4e0e\u5904\u7406\u3002

    Config

    interceptorclusterLogConfig
    apiVersion: loggie.io/v1beta1\nkind: Interceptor\nmetadata:\nname: jsondecode\nspec:\ninterceptors: |\n- type: normalize\nname: json\nprocessors:\n- jsonDecode: ~\n- drop:\ntargets: [\"body\"]\n
    apiVersion: loggie.io/v1beta1\nkind: ClusterLogConfig\nmetadata:\nname: kubeevent\nspec:\nselector:\ntype: cluster\ncluster: aggregator\npipeline:\nsources: |\n- type: kubeEvent\nname: event\ninterceptorRef: jsondecode\nsinkRef: dev\n

    \u7ecf\u8fc7normalize interceptor\u91ccjsonDecode\u540e\u7684\u6570\u636e\u5982\u4e0b\u6240\u793a\uff1a

    event

    {\n\"metadata\": {\n\"name\": \"loggie-aggregator.16c277f8fc4ff0d0\",\n\"namespace\": \"loggie-aggregator\",\n\"uid\": \"084cea27-cd4a-4ce4-97ef-12e70f37880e\",\n\"resourceVersion\": \"2975193\",\n\"creationTimestamp\": \"2021-12-20T12:58:45Z\",\n\"managedFields\": [\n{\n\"fieldsType\": \"FieldsV1\",\n\"fieldsV1\": {\n\"f:type\": {\n\n},\n\"f:count\": {\n\n},\n\"f:firstTimestamp\": {\n\n},\n\"f:involvedObject\": {\n\"f:apiVersion\": {\n\n},\n\"f:kind\": {\n\n},\n\"f:name\": {\n\n},\n\"f:namespace\": {\n\n},\n\"f:resourceVersion\": {\n\n},\n\"f:uid\": {\n\n}\n},\n\"f:lastTimestamp\": {\n\n},\n\"f:message\": {\n\n},\n\"f:reason\": {\n\n},\n\"f:source\": {\n\"f:component\": {\n\n}\n}\n},\n\"manager\": \"kube-controller-manager\",\n\"operation\": \"Update\",\n\"apiVersion\": \"v1\",\n\"time\": \"2021-12-20T12:58:45Z\"\n}\n]\n},\n\"reportingComponent\": \"\",\n\"type\": \"Normal\",\n\"message\": \"Created pod: loggie-aggregator-pbkjk\",\n\"reason\": \"SuccessfulCreate\",\n\"reportingInstance\": \"\",\n\"source\": {\n\"component\": \"daemonset-controller\"\n},\n\"count\": 1,\n\"lastTimestamp\": \"2021-12-20T12:58:45Z\",\n\"firstTimestamp\": \"2021-12-20T12:58:45Z\",\n\"eventTime\": null,\n\"involvedObject\": {\n\"kind\": \"DaemonSet\",\n\"namespace\": \"loggie-aggregator\",\n\"name\": \"loggie-aggregator\",\n\"uid\": \"7cdf4792-815d-4eba-8a81-d60131ad1fc4\",\n\"apiVersion\": \"apps/v1\",\n\"resourceVersion\": \"2975170\"\n},\n}\n

    \u5982\u679c\u89c9\u5f97\u6570\u636e\u5b57\u6bb5\u592a\u591a\u6216\u8005\u683c\u5f0f\u4e0d\u7b26\u5408\u9700\u6c42\uff0c\u8fd8\u53ef\u4ee5\u914d\u7f6enormalize interceptor\u8fdb\u884c\u4fee\u6539\u3002

    "},{"location":"user-guide/use-in-kubernetes/sidecar/","title":"Loggie Sidecar\u65b9\u5f0f\u91c7\u96c6\u65e5\u5fd7","text":"

    \u867d\u7136\u9ed8\u8ba4\u4e0d\u63a8\u8350\u4f7f\u7528Sidecar\u65b9\u5f0f\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff0c\u4f46\u662f\u5728\u67d0\u4e9b\u53d7\u9650\u573a\u666f\u4e0b\u53ea\u80fd\u9009\u62e9\u4f7f\u7528Sidecar\u7684\u65b9\u5f0f\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\uff0c\u8fd9\u91cc\u6211\u4eec\u7ed9\u51fa\u4e00\u4e2a\u53c2\u8003\u7684\u793a\u4f8b\u3002

    "},{"location":"user-guide/use-in-kubernetes/sidecar/#_1","title":"\u603b\u4f53\u601d\u8def","text":"

    \u5982\u4e0b\u56fe\u6240\u793a\uff1a

    Loggie\u548c\u4e1a\u52a1container\u90e8\u7f72\u5728\u540c\u4e00\u4e2aPod\u91cc\uff0c\u540c\u65f6\u9700\u8981\u6302\u8f7d\u76f8\u540c\u7684\u65e5\u5fd7\u6587\u4ef6volume\uff0c\u53e6\u5916Loggie\u7684\u914d\u7f6e\u53ef\u901a\u8fc7configMap\u7684\u65b9\u5f0f\u6302\u8f7d\u5230\u5bb9\u5668\u4e2d\uff0cLoggie\u6839\u636e\u63d0\u4f9b\u7684configMap\u914d\u7f6e\u6587\u4ef6\uff0c\u91c7\u96c6\u5bb9\u5668\u7684\u65e5\u5fd7\uff0c\u5e76\u53d1\u9001\u5230\u540e\u7aef\u3002

    "},{"location":"user-guide/use-in-kubernetes/sidecar/#1-loggie-sidecar","title":"\u65b9\u5f0f1: \u624b\u52a8\u6216\u8005\u901a\u8fc7\u90e8\u7f72\u4fa7\u6ce8\u5165Loggie sidecar","text":"
    apiVersion: apps/v1\nkind: Deployment\nmetadata:\nlabels:\napp: tomcat\nname: tomcat\nnamespace: default\nspec:\nreplicas: 1\nselector:\nmatchLabels:\napp: tomcat\ntemplate:\nmetadata:\nlabels:\napp: tomcat\nspec:\ncontainers:\n- name: tomcat\nimage: tomcat\nvolumeMounts:\n- mountPath: /usr/local/tomcat/logs\nname: log\n\n- name: loggie\nargs:\n- -config.system=/opt/loggie/loggie.yml\n- -config.pipeline=/opt/loggie/pipeline.yml\nimage: loggieio/loggie:main\nvolumeMounts:\n# loggie\u548c\u4e1a\u52a1container\u6302\u8f7d\u76f8\u540c\u7684log volume\n- mountPath: /usr/local/tomcat/logs\nname: log\n# \u6302\u8f7d\u65e5\u5fd7\u914d\u7f6econfigMap\n- mountPath: /opt/loggie\nname: loggie-config\n# \u6302\u8f7dloggie\u81ea\u8eab\u6301\u4e45\u5316\u7684\u6570\u636e\n- mountPath: /data\nname: registry\n\nvolumes:\n- emptyDir: {}\nname: log\n- emptyDir: {}\nname: registry\n- name: loggie-config\nconfigMap:\nname: tomcat-loggie-config\n\n---\napiVersion: v1\nkind: ConfigMap\nmetadata:\nname: tomcat-loggie-config\nnamespace: default\ndata:\nloggie.yml: |\nloggie:\nreload:\nenabled: true\nperiod: 10s\nmonitor:\nlogger:\nperiod: 30s\nenabled: true\nlisteners:\nfilesource: ~\nfilewatcher: ~\nreload: ~\nsink: ~\nhttp:\nenabled: true\nport: 9196\npipeline.yml: |\npipelines:\n- name: \"tomcat\"\nsources:\n- type: \"file\"\nname: \"tomcatlog\"\npaths:\n- \"/usr/local/tomcat/logs/*.log\"\nfields:\nnamespace: default\ndeployment: tomcat\nfieldsFromEnv:\npodname: HOSTNAME\nsink:\ntype: \"dev\"\nprintEvents: true\ncodec:\npretty: true\n

    \u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0a\u7684\u90e8\u7f72\u65b9\u5f0f\u901a\u8fc7loggie sidecar\u91c7\u96c6\u5bb9\u5668\u65e5\u5fd7\u3002 \u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a

    Tips

    Info

    Loggie\u540e\u7eed\u4f1a\u652f\u6301\u81ea\u52a8Sidecar\u6ce8\u5165\u548c\u901a\u8fc7LogConfig\u81ea\u52a8\u751f\u6210ConfigMap\u6302\u8f7d\u7684\u65b9\u5f0f\uff0c\u4ece\u800c\u8fbe\u5230\u548c\u4f7f\u7528DaemonSet\u4e00\u81f4\u7684\u4f53\u9a8c\u3002

    "},{"location":"user-guide/use-in-kubernetes/sidecar/#2-sidecar","title":"\u65b9\u5f0f2: \u81ea\u52a8\u6ce8\u5165sidecar","text":"

    \u8bf7\u53c2\u8003\uff1ahttps://github.com/loggie-io/loggie-operator

    "}]} \ No newline at end of file diff --git a/main/sitemap.xml.gz b/main/sitemap.xml.gz index 5dcc02ed..7cc4fa99 100644 Binary files a/main/sitemap.xml.gz and b/main/sitemap.xml.gz differ diff --git a/main/user-guide/architecture/advantages/index.html b/main/user-guide/architecture/advantages/index.html index 2a2ff57b..e635f945 100644 --- a/main/user-guide/architecture/advantages/index.html +++ b/main/user-guide/architecture/advantages/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/architecture/background/index.html b/main/user-guide/architecture/background/index.html index 3faf3b65..97ac9a46 100644 --- a/main/user-guide/architecture/background/index.html +++ b/main/user-guide/architecture/background/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/architecture/compare/index.html b/main/user-guide/architecture/compare/index.html index cb1a4168..f866fee0 100644 --- a/main/user-guide/architecture/compare/index.html +++ b/main/user-guide/architecture/compare/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/architecture/core-arch/index.html b/main/user-guide/architecture/core-arch/index.html index f04b7688..656c6ca4 100644 --- a/main/user-guide/architecture/core-arch/index.html +++ b/main/user-guide/architecture/core-arch/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/architecture/schema/index.html b/main/user-guide/architecture/schema/index.html index dd804e3d..b5bb4577 100644 --- a/main/user-guide/architecture/schema/index.html +++ b/main/user-guide/architecture/schema/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/best-practice/aggregator/index.html b/main/user-guide/best-practice/aggregator/index.html index 97da2b32..2b459579 100644 --- a/main/user-guide/best-practice/aggregator/index.html +++ b/main/user-guide/best-practice/aggregator/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/best-practice/concurrency/index.html b/main/user-guide/best-practice/concurrency/index.html index 3a2757ab..02e21155 100644 --- a/main/user-guide/best-practice/concurrency/index.html +++ b/main/user-guide/best-practice/concurrency/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/best-practice/log-collect-rotate/index.html b/main/user-guide/best-practice/log-collect-rotate/index.html index 6ab0274c..a7636f8c 100644 --- a/main/user-guide/best-practice/log-collect-rotate/index.html +++ b/main/user-guide/best-practice/log-collect-rotate/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/best-practice/log-enrich/index.html b/main/user-guide/best-practice/log-enrich/index.html index dd228da4..5b44b6f2 100644 --- a/main/user-guide/best-practice/log-enrich/index.html +++ b/main/user-guide/best-practice/log-enrich/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/best-practice/log-process/index.html b/main/user-guide/best-practice/log-process/index.html index fc1c4c6e..3e61d0e4 100644 --- a/main/user-guide/best-practice/log-process/index.html +++ b/main/user-guide/best-practice/log-process/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/enterprise-practice/architecture-and-evolution/index.html b/main/user-guide/enterprise-practice/architecture-and-evolution/index.html index dd1b6182..b2b468a6 100644 --- a/main/user-guide/enterprise-practice/architecture-and-evolution/index.html +++ b/main/user-guide/enterprise-practice/architecture-and-evolution/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/enterprise-practice/sls/index.html b/main/user-guide/enterprise-practice/sls/index.html index 1e02a4c6..f644ba77 100644 --- a/main/user-guide/enterprise-practice/sls/index.html +++ b/main/user-guide/enterprise-practice/sls/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/index.html b/main/user-guide/index.html index 9936deac..aac4ac38 100644 --- a/main/user-guide/index.html +++ b/main/user-guide/index.html @@ -11,7 +11,7 @@ - + @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/monitor/loggie-monitor/index.html b/main/user-guide/monitor/loggie-monitor/index.html index 2bdd2f53..5c3ac413 100644 --- a/main/user-guide/monitor/loggie-monitor/index.html +++ b/main/user-guide/monitor/loggie-monitor/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/monitor/service-log-alarm/index.html b/main/user-guide/monitor/service-log-alarm/index.html index 91da8efc..55412e88 100644 --- a/main/user-guide/monitor/service-log-alarm/index.html +++ b/main/user-guide/monitor/service-log-alarm/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/troubleshot/log-collection/index.html b/main/user-guide/troubleshot/log-collection/index.html index a82399ae..b4a2342b 100644 --- a/main/user-guide/troubleshot/log-collection/index.html +++ b/main/user-guide/troubleshot/log-collection/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/troubleshot/problems/index.html b/main/user-guide/troubleshot/problems/index.html index eae7a85d..1522b73a 100644 --- a/main/user-guide/troubleshot/problems/index.html +++ b/main/user-guide/troubleshot/problems/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/use-in-kubernetes/collect-container-logs/index.html b/main/user-guide/use-in-kubernetes/collect-container-logs/index.html index 5d8ad560..fd6cdb6c 100644 --- a/main/user-guide/use-in-kubernetes/collect-container-logs/index.html +++ b/main/user-guide/use-in-kubernetes/collect-container-logs/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/use-in-kubernetes/collect-node-logs/index.html b/main/user-guide/use-in-kubernetes/collect-node-logs/index.html index 169b75a8..b5c1216c 100644 --- a/main/user-guide/use-in-kubernetes/collect-node-logs/index.html +++ b/main/user-guide/use-in-kubernetes/collect-node-logs/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/use-in-kubernetes/general-usage/index.html b/main/user-guide/use-in-kubernetes/general-usage/index.html index 66eb8ff3..ddcc0aa2 100644 --- a/main/user-guide/use-in-kubernetes/general-usage/index.html +++ b/main/user-guide/use-in-kubernetes/general-usage/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/use-in-kubernetes/kube-event-source/index.html b/main/user-guide/use-in-kubernetes/kube-event-source/index.html index 3d526c24..2f4a55ad 100644 --- a/main/user-guide/use-in-kubernetes/kube-event-source/index.html +++ b/main/user-guide/use-in-kubernetes/kube-event-source/index.html @@ -584,7 +584,7 @@
  • - + 2023
  • diff --git a/main/user-guide/use-in-kubernetes/sidecar/index.html b/main/user-guide/use-in-kubernetes/sidecar/index.html index fb732633..32378fe2 100644 --- a/main/user-guide/use-in-kubernetes/sidecar/index.html +++ b/main/user-guide/use-in-kubernetes/sidecar/index.html @@ -584,7 +584,7 @@
  • - + 2023