{"id":37214394,"url":"https://github.com/farseernet/log-pilot","last_synced_at":"2026-01-15T00:48:57.565Z","repository":{"id":202083995,"uuid":"365450981","full_name":"FarseerNet/log-pilot","owner":"FarseerNet","description":"支持elasticsearch7.x（改自阿里官方的log-pilot工具）","archived":false,"fork":false,"pushed_at":"2021-06-02T15:57:17.000Z","size":6259,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-21T15:43:29.896Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FarseerNet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-05-08T07:39:10.000Z","updated_at":"2024-03-15T07:54:42.000Z","dependencies_parsed_at":"2024-03-28T17:15:23.248Z","dependency_job_id":null,"html_url":"https://github.com/FarseerNet/log-pilot","commit_stats":null,"previous_names":["farseernet/log-pilot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FarseerNet/log-pilot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarseerNet%2Flog-pilot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarseerNet%2Flog-pilot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarseerNet%2Flog-pilot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarseerNet%2Flog-pilot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FarseerNet","download_url":"https://codeload.github.com/FarseerNet/log-pilot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarseerNet%2Flog-pilot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28440486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:34:46.850Z","status":"ssl_error","status_checked_at":"2026-01-15T00:34:46.551Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-15T00:48:57.090Z","updated_at":"2026-01-15T00:48:57.557Z","avatar_url":"https://github.com/FarseerNet.png","language":"Go","readme":"## 说明\n这是来自阿里云的容器日志采集工具。https://github.com/AliyunContainerService/log-pilot\n\n由于官方不再维护这个版本，只支持到es 6.x。\n本镜像经修改后，支持es 7x的版本。\n\n# 源码、镜像\nhttps://hub.docker.com/r/farseernet/log-pilot\n\nhttps://github.com/FarseerNet/log-pilot\n\n## 使用\n首先：在应用容器中，需要定义env\n```\naliyun_logs_$Name=stdout  # $Name=elasticsearch index\naliyun_logs_$Name_format=json # 如果是使用.net程序的朋友，建议使用json方式输出日志格式，借助Farseer.net组件的日志模块：IocManager.Instance.Logger 日志，则默认使用json方式\n\n#示例：\naliyun_logs_farseer=stdout\naliyun_logs_farseer_format=json\n```\n## K8S部署yaml文件\n\n```yaml\napiVersion: apps/v1\nkind: DaemonSet\nmetadata:\n  name: log-pilot\n  labels:\n    app: log-pilot\n    k8s.kuboard.cn/layer: cloud\nspec:\n  revisionHistoryLimit: 3\n  selector:\n    matchLabels:\n      app: log-pilot\n  template:\n    metadata:\n      name: log-pilot\n      labels:\n        app: log-pilot\n    spec:\n      # 是否允许部署到Master节点上\n      tolerations:\n        - key: node-role.kubernetes.io/master\n          effect: NoSchedule\n      containers:\n        - name: log-pilot\n          image: farseernet/log-pilot:7.x\n          imagePullPolicy: IfNotPresent\n          resources:\n            limits:\n              memory: 200Mi\n            requests:\n              cpu: 200m\n              memory: 200Mi\n          securityContext:\n            capabilities:\n              add:\n                - SYS_ADMIN\n          envFrom: #以密文的方式，把配置项写到env\n            - secretRef:\n                name: log-pilot\n          env:\n            - name: \"NODE_NAME\"\n              valueFrom:\n                fieldRef:\n                  fieldPath: spec.nodeName\n          volumeMounts:\n            - name: sock\n              mountPath: /var/run/docker.sock\n            - name: root\n              mountPath: /host\n              readOnly: true\n            - name: varlib\n              mountPath: /var/lib/filebeat\n            - name: varlog\n              mountPath: /var/log/filebeat\n            - name: localtime\n              mountPath: /etc/localtime\n              readOnly: true\n      volumes:\n        - name: sock\n          hostPath:\n            path: /var/run/docker.sock\n        - name: root\n          hostPath:\n            path: /\n        - name: varlib\n          hostPath:\n            path: /var/lib/filebeat\n            type: DirectoryOrCreate\n        - name: varlog\n          hostPath:\n            path: /var/log/filebeat\n            type: DirectoryOrCreate\n        - name: localtime\n          hostPath:\n            path: /etc/localtime\n---\napiVersion: v1\ndata:\n  LOGGING_OUTPUT: ZWxhc3RpY3NlYXJjaA== #elasticsearch\n  ELASTICSEARCH_HOSTS: aHR0cDovL2VzOjgw #es (必填) http://es:80\n  ELASTICSEARCH_USER: \"\" #es (选填) username\n  ELASTICSEARCH_PASSWORD: \"\" #es (选填) pwd\n  ELASTICSEARCH_PATH: \"\" #es (选填) http path prefix\n  ELASTICSEARCH_SCHEME: \"\" #es (选填) scheme, default is http\nkind: Secret\nmetadata:\n  name: log-pilot\n  namespace: default\ntype: Opaque\n```\n\u003e ES的配置在密文log-pilot配置中，请自行修改ES HOST\n \n## 最后\n只要成功在K8S中部署好log-pilot，配置好ES HOST，并在您的POD中，定义好env标签。那么log-pilot就开始工具了，可以利用kibana去查看这些信息。\n\n如果使用.net core的朋友，默认使用ILogger组件打印的日志消息并不太友好的显示在ES中（日志内容格式化问题），在这里推荐使用我的另一个开源框架：Farseer.Net。并使用IocManager.Instance.Logger模块进行打印日志（默认配置好适合log-pilot采集所需的格式体）IocManager.Instance.Logger仅是修改了微软日志组件的输出格式，并不依赖第三方组件。\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarseernet%2Flog-pilot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarseernet%2Flog-pilot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarseernet%2Flog-pilot/lists"}