惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Schneier on Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
NISL@THU
NISL@THU
T
Threat Research - Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Latest news
Latest news
H
Help Net Security
雷峰网
雷峰网
Spread Privacy
Spread Privacy
Cyberwarzone
Cyberwarzone
Project Zero
Project Zero
Security Latest
Security Latest
Know Your Adversary
Know Your Adversary
人人都是产品经理
人人都是产品经理
P
Privacy & Cybersecurity Law Blog
M
MIT News - Artificial intelligence
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed
U
Unit 42
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
博客园 - 三生石上(FineUI控件)
Stack Overflow Blog
Stack Overflow Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
量子位
C
Cyber Attacks, Cyber Crime and Cyber Security
S
Securelist
S
Security @ Cisco Blogs
T
Threatpost
P
Palo Alto Networks Blog
C
Check Point Blog
V
Vulnerabilities – Threatpost
T
Tailwind CSS Blog
B
Blog RSS Feed
Recorded Future
Recorded Future
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
P
Proofpoint News Feed
P
Privacy International News Feed
AWS News Blog
AWS News Blog
博客园 - 叶小钗
WordPress大学
WordPress大学

日志处理

生产环境怎么打日志才能满足国家法规要求 - V2EX elk 这套日志 最近报错 无效索引要小写,求指导 - V2EX 日志等级体系里是不是应该新增一个开发级? - V2EX 运行很久的 springboot 项目 info 日志文件不更新了 warn 日志文件 error 日志文件一直在更新==。 日志文件都在一个文件夹,求大神给个思路! - V2EX 想把多台机器的日志统一管理,用 ELK 还是 EFK? - V2EX 性能调优——小小的 log 大大的坑 - V2EX 有没有大佬用过 Loki 做日志收集呢? - V2EX log4j2 官网上有没有 xml 配置文件如何编写的介绍呢? - V2EX 请教一下服务端日志存放和处理方向的问题,希望有了解的给些建议哈,谢谢了 - V2EX 关于日志处理的一个实例问题请教 - V2EX 日志集中管理工具(类似 Loggly 和 Splunk 这样的)目前国内有哪家做得比较好的吗? - V2EX 目前有哪些支持 syslog 接口的云上的日志集中管理工具? - V2EX
Loki 的 filename 标签为什么过了 24 小时就丢失了 - V2EX
Ritter · 2023-03-03 · via 日志处理

应用内日志做了按天的轮转,存储时间是 7 天,通过边车容器 promtail 挂载共享卷 push 到 Loki
Loki 的话也挂载了持久卷,并且设置了 15 天存储和最大回看周期,刚部署完第一天 push 了所有的日志包括轮转日志,在 grafana 也能看到 filename 标签包含了所有文件,但是第二天查看的时候 filename 标签只有轮转日志了,举个简单的例子就是:
day1:
filename => app.log app.log.2023-03-01 app.log.2023-03-02
day2:
filename => app.log
app.log 为轮转文件,日志轮转模式为 rename-create 模式,看 Loki 文档也是推荐使用这种模式
以下为 Loki 的配置文件

auth_enabled: false
server:
  http_listen_port: 3100
common:
  path_prefix: /data/loki
chunk_store_config:
  max_look_back_period: 360h
compactor:
  shared_store: filesystem
  working_directory: /data/loki/boltdb-shipper-compactor
ingester:
  chunk_block_size: 262144
  chunk_idle_period: 3m
  chunk_retain_period: 1m
  lifecycler:
    ring:
      kvstore:
        store: inmemory
      replication_factor: 1
  max_transfer_retries: 0
limits_config:
  enforce_metric_name: false
  reject_old_samples: true
  reject_old_samples_max_age: 168h
schema_config:
  configs:
  - from: "2023-01-01"
    index:
      period: 24h
      prefix: index_
    chunks:
      period: 24h
      prefix: chunk_
    object_store: filesystem
    schema: v11
    store: boltdb-shipper
storage_config:
  boltdb_shipper:
    active_index_directory: /data/loki/boltdb-shipper-active
    cache_location: /data/loki/boltdb-shipper-cache
    cache_ttl: 24h
    shared_store: filesystem
  filesystem:
    directory: /data/loki/chunks
table_manager:
  retention_deletes_enabled: true
  retention_period: 360h

我估计是 schema_config 内 index 的 period 设置出的问题,我理解这个设置的意思是在 24h 后重建索引,但是不明白 Loki 重建索引的规则是什么,为什么只有 filename 的 label 丢失了,有大佬解答一下吗