curl --proto '=https' --tlsv1.2 -sSf https://sh.vector.dev | bash
ln -s /root/.vector/bin/vector /usr/bin/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# Random Syslog-formatted logs [sources.dummy_logs] type = "file" include = [ "/root/test.log" ] read_from = "beginning" host_key = "_host" file_key = "_source" data_dir = "/opt/vector_data/" # 转换 [transforms.parse_logs] type = "remap" inputs = ["dummy_logs"] source = ''' . |= parse_regex!(.message, r'^(?P<timestamp>\d+:\d+:\d+\.\d+) \[(?P<thread>.+)\] (?P<level>\w+) (?P<logger>.+) - \[(?P<method>.+)\] - (?P<message>.*)) ._target_table = "test_shit" ._datatype = "json" ''' # Print parsed logs to stdout [sinks.honghu] type = "vector" inputs = [ "parse_logs" ] address = "192.168.140.129:20000" version = "2" [sinks.print] type = "console" inputs = ["parse_logs"] encoding.codec = "json" |
vector --config /root/.vector/config/test.toml
Posted in: java基础
Comments are closed.