@@ -46,46 +46,46 @@ public void testExecute() {
4646 document = new IngestDocument ("index" , "id" , 1L , null , null , source );
4747 CefProcessor processor = new CefProcessor ("tag" , "description" , "message" , "cef" , false , true , null );
4848 processor .execute (document );
49-
50- Map <String , Object > expectedMap = Map .ofEntries (
51- entry (
52- "cef" ,
53- Map .ofEntries (
54- entry ("version" , "0" ),
55- entry ("device.vendor" , "Elastic" ),
56- entry ("device.product" , "Vaporware" ),
57- entry ("device.version" , "1.0.0-alpha" ),
58- entry ("device.event_class_id" , "18" ),
59- entry ("name" , "Web request" ),
60- entry ("severity" , "low" )
61- )
62- ),
63- entry ("observer" , Map .ofEntries (entry ("product" , "Vaporware" ), entry ("vendor" , "Elastic" ), entry ("version" , "1.0.0-alpha" ))),
64- entry ("event" , Map .ofEntries (entry ("id" , "3457" ), entry ("code" , "18" ))),
65- entry (
66- "source" ,
49+ assertThat (
50+ document .getSource (),
51+ equalTo (
6752 Map .ofEntries (
68- entry ("ip" , "89.160.20.156" ),
69- entry ("port" , 33876 ),
70- entry ("geo" , Map .ofEntries (entry ("location" , Map .ofEntries (entry ("lon" , -77.511 ), entry ("lat" , 38.915 ))))),
71- entry ("service" , Map .ofEntries (entry ("name" , "httpd" )))
53+ entry (
54+ "cef" ,
55+ Map .ofEntries (
56+ entry ("version" , "0" ),
57+ entry ("device.vendor" , "Elastic" ),
58+ entry ("device.product" , "Vaporware" ),
59+ entry ("device.version" , "1.0.0-alpha" ),
60+ entry ("device.event_class_id" , "18" ),
61+ entry ("name" , "Web request" ),
62+ entry ("severity" , "low" )
63+ )
64+ ),
65+ entry ("observer" , Map .of ("product" , "Vaporware" , "vendor" , "Elastic" , "version" , "1.0.0-alpha" )),
66+ entry ("event" , Map .of ("id" , "3457" , "code" , "18" )),
67+ entry (
68+ "source" ,
69+ Map .ofEntries (
70+ entry ("ip" , "89.160.20.156" ),
71+ entry ("port" , 33876 ),
72+ entry ("geo" , Map .of ("location" , Map .of ("lon" , -77.511 , "lat" , 38.915 ))),
73+ entry ("service" , Map .of ("name" , "httpd" ))
74+ )
75+ ),
76+ entry ("destination" , Map .of ("ip" , "192.168.10.1" , "port" , 443 )),
77+ entry ("http" , Map .of ("request" , Map .of ("method" , "POST" , "referrer" , "https://www.google.com" ))),
78+ entry ("network" , Map .of ("transport" , "TCP" )),
79+ entry ("url" , Map .of ("original" , "https://www.example.com/cart" )),
80+ entry (
81+ "message" ,
82+ "CEF:0|Elastic|Vaporware|1.0.0-alpha|18|Web request|low|eventId=3457 requestMethod=POST "
83+ + "slat=38.915 slong=-77.511 proto=TCP sourceServiceName=httpd requestContext=https://www.google.com "
84+ + "src=89.160.20.156 spt=33876 dst=192.168.10.1 dpt=443 request=https://www.example.com/cart"
85+ )
7286 )
73- ),
74- entry ("destination" , Map .ofEntries (entry ("ip" , "192.168.10.1" ), entry ("port" , 443 ))),
75- entry (
76- "http" ,
77- Map .ofEntries (entry ("request" , Map .ofEntries (entry ("method" , "POST" ), entry ("referrer" , "https://www.google.com" ))))
78- ),
79- entry ("network" , Map .ofEntries (entry ("transport" , "TCP" ))),
80- entry ("url" , Map .ofEntries (entry ("original" , "https://www.example.com/cart" ))),
81- entry (
82- "message" ,
83- "CEF:0|Elastic|Vaporware|1.0.0-alpha|18|Web request|low|eventId=3457 requestMethod=POST "
84- + "slat=38.915 slong=-77.511 proto=TCP sourceServiceName=httpd requestContext=https://www.google.com "
85- + "src=89.160.20.156 spt=33876 dst=192.168.10.1 dpt=443 request=https://www.example.com/cart"
8687 )
8788 );
88- assertThat (document .getSource (), equalTo (expectedMap ));
8989 }
9090
9191 public void testInvalidCefFormat () {
0 commit comments