55
66package org .opensearch .sql .ppl .dashboard ;
77
8- import static org .junit .jupiter .api .Assertions .assertEquals ;
98import static org .opensearch .sql .util .MatcherUtils .rows ;
109import static org .opensearch .sql .util .MatcherUtils .schema ;
1110import static org .opensearch .sql .util .MatcherUtils .verifyDataRows ;
@@ -167,7 +166,8 @@ public void testTopTalkersByBytes() throws IOException {
167166 public void testTopTalkersByPackets () throws IOException {
168167 String query =
169168 String .format (
170- "source=%s | stats sum(packets) as Packets by srcaddr | sort - Packets | head 10" ,
169+ "source=%s | stats sum(packets) as Packets by srcaddr | sort - Packets, srcaddr | head"
170+ + " 10" ,
171171 VPC_FLOW_LOGS_INDEX );
172172 JSONObject response = executeQuery (query );
173173 verifySchema (response , schema ("Packets" , null , "bigint" ), schema ("srcaddr" , null , "string" ));
@@ -189,7 +189,8 @@ public void testTopTalkersByPackets() throws IOException {
189189 public void testTopDestinationsByPackets () throws IOException {
190190 String query =
191191 String .format (
192- "source=%s | stats sum(packets) as Packets by dstaddr | sort - Packets | head 10" ,
192+ "source=%s | stats sum(packets) as Packets by dstaddr | sort - Packets, dstaddr | head"
193+ + " 10" ,
193194 VPC_FLOW_LOGS_INDEX );
194195 JSONObject response = executeQuery (query );
195196 verifySchema (response , schema ("Packets" , null , "bigint" ), schema ("dstaddr" , null , "string" ));
@@ -211,7 +212,7 @@ public void testTopDestinationsByPackets() throws IOException {
211212 public void testTopTalkersByIPs () throws IOException {
212213 String query =
213214 String .format (
214- "source=%s | STATS count() as Count by srcaddr | SORT - Count | HEAD 10" ,
215+ "source=%s | STATS count() as Count by srcaddr | SORT - Count, srcaddr | HEAD 10" ,
215216 VPC_FLOW_LOGS_INDEX );
216217 JSONObject response = executeQuery (query );
217218 verifySchema (response , schema ("Count" , null , "bigint" ), schema ("srcaddr" , null , "string" ));
@@ -233,7 +234,7 @@ public void testTopTalkersByIPs() throws IOException {
233234 public void testTopDestinationsByIPs () throws IOException {
234235 String query =
235236 String .format (
236- "source=%s | stats count() as Requests by dstaddr | sort - Requests | head 10" ,
237+ "source=%s | stats count() as Requests by dstaddr | sort - Requests, dstaddr | head 10" ,
237238 VPC_FLOW_LOGS_INDEX );
238239 JSONObject response = executeQuery (query );
239240 verifySchema (response , schema ("Requests" , null , "bigint" ), schema ("dstaddr" , null , "string" ));
0 commit comments