From 7ce2dc23f6884485b0b988a9d6f9c6e0639b6f14 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 21 Jan 2021 22:44:28 -0800 Subject: [PATCH] Updated Filer Change Data Capture (markdown) --- Filer-Change-Data-Capture.md | 38 +++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/Filer-Change-Data-Capture.md b/Filer-Change-Data-Capture.md index b209807..9e269b1 100644 --- a/Filer-Change-Data-Capture.md +++ b/Filer-Change-Data-Capture.md @@ -4,7 +4,41 @@ Actually SeaweedFS can give you more! # Experience it first -You can watch the SeaweedFS meta data changes. +You can watch the SeaweedFS meta data changes. Let's also filer with `jq` and see only the new files created: +``` +$ weed filer.meta.tail -timeAgo=3h | jq .eventNotification.newEntry +{ + "name": "abc.png", + "chunks": [ + { + "size": "941248", + "mtime": "1611297248363702000", + "eTag": "2848d811982973ffda34cf8c8599e3f6", + "fid": { + "volumeId": 23, + "fileKey": "155320", + "cookie": 2256694723 + } + } + ], + "attributes": { + "fileSize": "941248", + "mtime": "1611297248", + "fileMode": 432, + "uid": 502, + "gid": 20, + "crtime": "1611297248", + "mime": "image/png", + "replication": "000", + "md5": "KEjYEZgpc//aNM+MhZnj9g==" + } +} + +... + +``` + +See the help: ``` $ weed filer.meta.tail -h @@ -25,8 +59,6 @@ Default Usage: Description: See recent changes on a filer. -$ weed filer.meta.tail -dir:/home new_entry:{name:"3190.pdf" chunks:{size:1130805 mtime:1608763500740201000 e_tag:"5c745d0a109bde58e0baaa6515c3694a" fid:{volume_id:1 file_key:35 cookie:4265699614}} attributes:{file_size:1130805 mtime:1608763500 file_mode:432 uid:502 gid:20 crtime:1608763500 mime:"application/pdf" replication:"000" md5:"\\t]\n\x10\x9b\xdeXສe\x15\xc3iJ"}} delete_chunks:true new_parent_path:"/home" signatures:1622972984 ``` If configured Elastic Search server names, the meta data will be sent to Elastic Search