Skip to content

Commit 303952d

Browse files
committed
Stabilize the dashboard IT
Signed-off-by: Lantao Jin <ltjin@amazon.com>
1 parent 7c90fc3 commit 303952d

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

integ-test/src/test/java/org/opensearch/sql/ppl/dashboard/NfwPplDashboardIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,8 @@ public void testTopTCPFlowsByBytes() throws IOException {
436436
public void testTopTCPFlags() throws IOException {
437437
String query =
438438
String.format(
439-
"source=%s | STATS count() as Count by `event.tcp.tcp_flags` | SORT - Count | HEAD 10",
439+
"source=%s | STATS count() as Count by `event.tcp.tcp_flags` | SORT - Count,"
440+
+ " `event.tcp.tcp_flags` | HEAD 10",
440441
NFW_LOGS_INDEX);
441442
JSONObject response = executeQuery(query);
442443
verifySchema(response, schema("Count", "bigint"), schema("event.tcp.tcp_flags", "string"));

integ-test/src/test/java/org/opensearch/sql/ppl/dashboard/VpcFlowLogsPplDashboardIT.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package org.opensearch.sql.ppl.dashboard;
77

8-
import static org.junit.jupiter.api.Assertions.assertEquals;
98
import static org.opensearch.sql.util.MatcherUtils.rows;
109
import static org.opensearch.sql.util.MatcherUtils.schema;
1110
import 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"));

integ-test/src/test/java/org/opensearch/sql/ppl/dashboard/WafPplDashboardIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ public void testTopCountries() throws IOException {
144144
public void testTopTerminatingRules() throws IOException {
145145
String query =
146146
String.format(
147-
"source=%s | stats count() as Count by `terminatingRuleId` | sort - Count | head 10",
147+
"source=%s | stats count() as Count by `terminatingRuleId` | sort - Count,"
148+
+ " `terminatingRuleId` | head 10",
148149
WAF_LOGS_INDEX);
149150

150151
JSONObject response = executeQuery(query);

0 commit comments

Comments
 (0)