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

推荐订阅源

W
WeLiveSecurity
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
S
SegmentFault 最新的问题
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
U
Unit 42
腾讯CDC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Cloudflare Blog
H
Help Net Security
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
H
Heimdal Security Blog
博客园 - 聂微东
S
Securelist
大猫的无限游戏
大猫的无限游戏
Cloudbric
Cloudbric
Cisco Talos Blog
Cisco Talos Blog

日志处理

生产环境怎么打日志才能满足国家法规要求 - 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 丢失了,有大佬解答一下吗