У меня есть поток журнала, который выглядит следующим образом:
[**] [1:10000001:1] ICMP test [**]
[Priority: 0]
12/12-05:35:39.933931 172.31.12.xxx -> 172.31.2.xxx
ICMP TTL:64 TOS:0x0 ID:375 IpLen:20 DgmLen:84 DF
Type:8 Code:0 ID:14832 Seq:3927 ECHO
[**] [1:10000001:1] ICMP test [**]
[Priority: 0]
12/12-05:35:40.933854 172.31.12.106 -> 172.31.2.207
ICMP TTL:64 TOS:0x0 ID:417 IpLen:20 DgmLen:84 DF
Type:8 Code:0 ID:14832 Seq:3928 ECHO
Я хочу использовать агент cloudwatch для создания одного события из многострочного события.
Согласно документам:
multi_line_start_pattern – Specifies the pattern for identifying the start of a log message. A log message is made of a line that matches the pattern and any following lines that don't match the pattern.
If you omit this field, multi-line mode is disabled, and any line that begins with a non-whitespace character closes the previous log message and starts a new log message.
Как создать регулярное выражение, которое будет найдено, если существует [**].Например,
"multi_line_start_pattern": "\\[\\*\\*\\]\\"
Для шаблона:
[**] ANYTHING [**]
Из того, что я понял, достаточно найти существование [**], чтобы найти начало многострочного события.
Так что же такое шаблон регулярного выражения, чтобы найти [] или лучше [] НИЧЕГО [**]?Я не знаю, regex
Спасибо