@@ -94,51 +94,6 @@ auto LogParser::add_rules(std::unique_ptr<SchemaAST> schema_ast) -> void {
94
94
// check if regex contains a delimiter
95
95
std::array<bool , cSizeOfUnicode> is_possible_input{};
96
96
rule->m_regex_ptr ->set_possible_inputs_to_true (is_possible_input);
97
- bool contains_delimiter = false ;
98
- uint32_t delimiter_name = 0 ;
99
- for (uint32_t delimiter : delimiters) {
100
- if (is_possible_input[delimiter]) {
101
- contains_delimiter = true ;
102
- delimiter_name = delimiter;
103
- break ;
104
- }
105
- }
106
-
107
- // Error out if non-timestamp pattern contains a delimiter
108
- if (contains_delimiter) {
109
- FileReader schema_reader;
110
- ErrorCode error_code = schema_reader.try_open (schema_ast->m_file_path );
111
- if (ErrorCode::Success != error_code) {
112
- throw std::runtime_error (
113
- schema_ast->m_file_path + " :" + to_string (rule->m_line_num + 1 )
114
- + " : error: '" + rule->m_name
115
- + " ' has regex pattern which contains delimiter '" + char (delimiter_name)
116
- + " '.\n "
117
- );
118
- }
119
- // more detailed debugging based on looking at the file
120
- string line;
121
- for (uint32_t i = 0 ; i <= rule->m_line_num ; i++) {
122
- schema_reader.try_read_to_delimiter (' \n ' , false , false , line);
123
- }
124
- uint32_t colon_pos = 0 ;
125
- for (char i : line) {
126
- colon_pos++;
127
- if (i == ' :' ) {
128
- break ;
129
- }
130
- }
131
- string indent (10 , ' ' );
132
- string spaces (colon_pos, ' ' );
133
- string arrows (line.size () - colon_pos, ' ^' );
134
-
135
- throw std::runtime_error (
136
- schema_ast->m_file_path + " :" + to_string (rule->m_line_num + 1 ) + " : error: '"
137
- + rule->m_name + " ' has regex pattern which contains delimiter '"
138
- + char (delimiter_name) + " '.\n " + indent + line + " \n " + indent + spaces
139
- + arrows + " \n "
140
- );
141
- }
142
97
143
98
// For log-specific lexing: modify variable regex to contain a delimiter at the start.
144
99
unique_ptr<RegexASTGroup<ByteNfaState>> delimiter_group
0 commit comments