|
134 | 134 |
|
135 | 135 | end |
136 | 136 |
|
137 | | -describe_pattern "REDISMONLOG" do |
| 137 | +describe_pattern "REDISMONLOG", [ 'legacy', 'ecs-v1' ] do |
138 | 138 |
|
139 | 139 | context 'two param command' do |
140 | 140 |
|
|
149 | 149 | end |
150 | 150 |
|
151 | 151 | it "generates the database field" do |
152 | | - expect(grok).to include("database" => "0") |
| 152 | + if ecs_compatibility? |
| 153 | + expect(grok).to include("redis" => hash_including('database' => hash_including('id' => '0'))) |
| 154 | + else |
| 155 | + expect(grok).to include("database" => "0") |
| 156 | + end |
153 | 157 | end |
154 | 158 |
|
155 | 159 | it "generates the client field" do |
156 | | - expect(grok).to include("client" => "127.0.0.1") |
| 160 | + if ecs_compatibility? |
| 161 | + expect(grok).to include("client" => hash_including('ip' => '127.0.0.1')) |
| 162 | + else |
| 163 | + expect(grok).to include("client" => "127.0.0.1") |
| 164 | + end |
157 | 165 | end |
158 | 166 |
|
159 | 167 | it "generates the port field" do |
160 | | - expect(grok).to include("port" => "39404") |
| 168 | + if ecs_compatibility? |
| 169 | + expect(grok).to include("client" => hash_including('port' => 39404)) |
| 170 | + else |
| 171 | + expect(grok).to include("port" => "39404") |
| 172 | + end |
161 | 173 | end |
162 | 174 |
|
163 | 175 | it "generates the command field" do |
164 | | - expect(grok).to include("command" => "rpush") |
| 176 | + if ecs_compatibility? |
| 177 | + expect(grok).to include("redis" => hash_including('command' => hash_including('name' => 'rpush'))) |
| 178 | + else |
| 179 | + expect(grok).to include("command" => "rpush") |
| 180 | + end |
165 | 181 | end |
166 | 182 |
|
167 | 183 | it "generates the params field" do |
168 | | - expect(grok).to include("params" => "\"my:special:key\" \"{\\\"data\\\":\"cdr\\\",\\\"payload\\\":\\\"json\\\"}\"") |
| 184 | + if ecs_compatibility? |
| 185 | + expect(grok).to include("redis" => hash_including('command' => hash_including('args' => "\"my:special:key\" \"{\\\"data\\\":\"cdr\\\",\\\"payload\\\":\\\"json\\\"}\""))) |
| 186 | + else |
| 187 | + expect(grok).to include("params" => "\"my:special:key\" \"{\\\"data\\\":\"cdr\\\",\\\"payload\\\":\\\"json\\\"}\"") |
| 188 | + end |
169 | 189 | end |
170 | 190 |
|
171 | 191 | end |
|
183 | 203 | end |
184 | 204 |
|
185 | 205 | it "generates the database field" do |
186 | | - expect(grok).to include("database" => "15") |
| 206 | + if ecs_compatibility? |
| 207 | + expect(grok).to include("redis" => hash_including('database' => hash_including('id' => '15'))) |
| 208 | + else |
| 209 | + expect(grok).to include("database" => "15") |
| 210 | + end |
187 | 211 | end |
188 | 212 |
|
189 | 213 | it "generates the client field" do |
190 | | - expect(grok).to include("client" => "195.168.1.1") |
| 214 | + if ecs_compatibility? |
| 215 | + expect(grok).to include("client" => hash_including('ip' => '195.168.1.1')) |
| 216 | + else |
| 217 | + expect(grok).to include("client" => "195.168.1.1") |
| 218 | + end |
191 | 219 | end |
192 | 220 |
|
193 | 221 | it "generates the port field" do |
194 | | - expect(grok).to include("port" => "52500") |
| 222 | + if ecs_compatibility? |
| 223 | + expect(grok).to include("client" => hash_including('port' => 52500)) |
| 224 | + else |
| 225 | + expect(grok).to include("port" => "52500") |
| 226 | + end |
195 | 227 | end |
196 | 228 |
|
197 | 229 | it "generates the command field" do |
198 | | - expect(grok).to include("command" => "intentionally") |
| 230 | + if ecs_compatibility? |
| 231 | + expect(grok).to include("redis" => hash_including('command' => hash_including('name' => 'intentionally'))) |
| 232 | + else |
| 233 | + expect(grok).to include("command" => "intentionally") |
| 234 | + end |
199 | 235 | end |
200 | 236 |
|
201 | 237 | it "generates the params field" do |
202 | | - expect(grok).to include("params" => "\"broken\" \"variadic\" \"log\" \"entry\"") |
| 238 | + if ecs_compatibility? |
| 239 | + expect(grok).to include("redis" => hash_including('command' => hash_including('args' => "\"broken\" \"variadic\" \"log\" \"entry\""))) |
| 240 | + else |
| 241 | + expect(grok).to include("params" => "\"broken\" \"variadic\" \"log\" \"entry\"") |
| 242 | + end |
203 | 243 | end |
204 | 244 |
|
205 | 245 | end |
|
0 commit comments