I don’t know how to use Regex to process log messages in JSON format. I would like to find some examples. Can I provide some trouble? thank you very much.
What are you trying to accomplish?
Please provide some examples.
I want to parse some JSON formatted logs. E.g:
{"url": "POST /PutData?Category=YunOsAccountOpLog&AccessKeyId=U0UjpekFQOVJW45A&Date=Fri%2C%2028%20Jun%202013%2006%3A53%3A30%20GMT&Topic=raw&Signature=pD12XYLmGxKQ%2Bmkd6x7hAgQ7b1c%3D HTTP/1.1", "ip": "10.200.98.220", "user-agent": "aliyun-sdk-java", "request": {"status": "200", "latency": "18204"}, "time": "05/May/2016:13:30:28"}
The following is the parsing method I use, but it’s always wrong:
Rule "json"
When
True
Then
Let json = parse_json(to_string($message.message));
Set_fields(json);
End
What does that mean exactly?
What do you expect as a result and what is the actual result?
Expect to show in this way:
Ip
10.200.98.220
User-agent
Aliyun-sdk-java
Status
200
Latency
18204
And what is the actual result with your pipeline rule?
No processing log message.
Is the rule assigned to a processing pipeline?
Is the processing pipeline connected to a stream?
Does the rule work in the pipeline simulator?
Oh, it was my fault. I did not find change in the name of the rule. Thank you for your suggestion. It helps me very much.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.