iLogtail
processor_cloud_meta插件可以添加为日志增加云平台元数据信息。
processor_cloud_meta
Alpha
a: {"b":{}}
a
a.b
__cloud_instance_id__
__cloud_instance_name__
__cloud_zone__
__cloud_region__
__cloud_instance_type__
__cloud_vswitch_id__
__cloud_vpc_id__
__cloud_image_id__
__cloud_max_ingress__
__cloud_max_egress__
__cloud_instance_tags__
cloud_instance_tags:custom_tag
a:b
custom_tag_a:b
A:{}
A:{},"__cloud_zone__":"xxxx"
B:{}
B:{},A:{"zone":"xxxx"}
A:""
A:{"a":{"b":{}}}
A:{"a":{"b":{"zone":"xxxx"}}}
A:{"a":{"b":{c:{"zone":"xxxx"}}}}
enable: trueinputs: - Type: service_mock LogsPerSecond: 10 MaxLogCount: 100 Fields: content: "abc"processors: - Type: processor_cloud_meta Platform: mock Mode: add_fields Metadata: - "__cloud_instance_id__" - "__cloud_instance_tags__" RenameMetadata: __cloud_instance_id__: instance_id_name __cloud_instance_tags__: instance_tag_prefixflushers: - Type: flusher_stdout OnlyStdout: true
2023-03-13 20:42:04 {"content":"{\"a\":{\"b\":{}}}","Index":"1","instance_id_name":"id_xxx","instance_tag_prefix_tag_key":"tag_val","__time__":"1678711324"}2023-03-13 20:42:04 {"content":"{\"a\":{\"b\":{}}}","Index":"2","instance_id_name":"id_xxx","instance_tag_prefix_tag_key":"tag_val","__time__":"1678711324"}2023-03-13 20:42:04 {"content":"{\"a\":{\"b\":{}}}","Index":"3","instance_id_name":"id_xxx","instance_tag_prefix_tag_key":"tag_val","__time__":"1678711324"}2023-03-13 20:42:04 {"content":"{\"a\":{\"b\":{}}}","Index":"4","instance_id_name":"id_xxx","instance_tag_prefix_tag_key":"tag_val","__time__":"1678711324"}2023-03-13 20:42:04 {"content":"{\"a\":{\"b\":{}}}","Index":"5","instance_id_name":"id_xxx","instance_tag_prefix_tag_key":"tag_val","__time__":"1678711324"}2023-03-13 20:42:04 {"content":"{\"a\":{\"b\":{}}}","Index":"6","instance_id_name":"id_xxx","instance_tag_prefix_tag_key":"tag_val","__time__":"1678711324"}}
enable: trueinputs: - Type: service_mock LogsPerSecond: 10 MaxLogCount: 100 Fields: content: "{\"a\":{\"b\":{}}}"processors: - Type: processor_cloud_meta Platform: mock JSONPath: "content.a.b" Metadata: - "__cloud_instance_id__" - "__cloud_instance_tags__" RenameMetadata: __cloud_instance_id__: instance_id_name __cloud_instance_tags__: instance_tag_prefixflushers: - Type: flusher_stdout OnlyStdout: true
2023-03-13 20:39:02 {"content":"{\"a\":{\"b\":{\"instance_id_name\":\"id_xxx\",\"instance_tag_prefix_tag_key\":\"tag_val\"}}}","Index":"1","__time__":"1678711142"}2023-03-13 20:39:02 {"content":"{\"a\":{\"b\":{\"instance_id_name\":\"id_xxx\",\"instance_tag_prefix_tag_key\":\"tag_val\"}}}","Index":"2","__time__":"1678711142"}2023-03-13 20:39:02 {"content":"{\"a\":{\"b\":{\"instance_id_name\":\"id_xxx\",\"instance_tag_prefix_tag_key\":\"tag_val\"}}}","Index":"3","__time__":"1678711142"}2023-03-13 20:39:02 {"content":"{\"a\":{\"b\":{\"instance_id_name\":\"id_xxx\",\"instance_tag_prefix_tag_key\":\"tag_val\"}}}","Index":"4","__time__":"1678711142"}2023-03-13 20:39:02 {"content":"{\"a\":{\"b\":{\"instance_id_name\":\"id_xxx\",\"instance_tag_prefix_tag_key\":\"tag_val\"}}}","Index":"5","__time__":"1678711142"}