Skip to content

Commit a6525ea

Browse files
fix: ASN compilation error - convert numeric filter to string comparison
The ASN number field is stored as a string in Coralogix but the extraFilter compared it to integer 0 (!=0), causing a compilation error. Now translates to != '' for the Coralogix path. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Signed-off-by: Lars Trieloff <lars@trieloff.net>
1 parent 33c9649 commit a6525ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

js/coralogix/adapter.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ function translateExtraFilter(extraFilter) {
284284
(_, fp) => `${fp} != null`,
285285
);
286286
filter = filter.replace(/([^=!<>])\s*=\s*([^=])/g, '$1 == $2');
287+
// ASN number is a string in Coralogix, convert numeric comparison to string
288+
filter = filter.replace(
289+
/(\$d\.cdn\.originating_ip_geoip\.asn\.number)\s*!=\s*0/g,
290+
"$1 != ''",
291+
);
287292
return filter;
288293
}
289294

@@ -472,6 +477,7 @@ export async function executeDataPrimeQuery(dataPrimeQuery, { signal, tier } = {
472477
syntax: 'QUERY_SYNTAX_DATAPRIME',
473478
},
474479
});
480+
475481
const fetchStart = performance.now();
476482
const teamId = getTeamId();
477483
const headers = {

0 commit comments

Comments
 (0)