Traffic Queries Syntax

Traffic queries can be used in several contexts:

A traffic query is composed of terms and operators.
Multiple terms can be combined together with Boolean operators and parenthesis ( ) to form a more complex query

Term

All fields are listed below.
Fields and values are case sensitive.

field:value

Boolean Operator

Three boolean operators are available: AND OR NOT

Wildcard Searches

Multi-character wildcard

Wildcard searches * look for 0 or more characters.
For example, to include test, tests or tester in the same search, you can type the following:

useragent:test*

The wildcard character * cannot be used inside a double quote. Therefore you should avoid special characters.

Single-character wildcard

The Wildcard searches ?can be used to search for an unknown single character. For example, if you want to search for text or testyou can use the following

useragent:te?t

Range Searches

Range queries allow to match documents with field(s) values that are between lower and upper bounds specified by the range query.
Range queries are inclusive of the lower and upper bounds.

📘

CIDR format is supported

Please note that IP addresses can be written following the CIDR format: ip:1.2.3.0/24

ip:[1.2.3.4 TO 1.2.3.9]

ip:[2001\:0db8\:85a3\:0000\:0000\:8a2e\:0000\:0000 TO 2001\:0db8\:85a3\:0000\:0000\:8a2e\:ffff\:ffff]

Range queries can also have numeric ranges, such as:

asn:[1234 TO 4567]

Grouping

Grouping is using parentheses to group clauses to form sub-queries. This can be very useful if you want to control the boolean logic for a query.

The query example below allows/blocks requests incoming from "www.example.com" and are using one of these criteria:

  • useragent:test
  • ip:1.2.3.4
(useragent:"test" OR ip:1.2.3.4) AND domain:"www.example.com"

The query example below allows/blocks requests incoming from "www.example.com" and are using one of these criteria:

  • useragent:test
  • useragent:mywork
useragent:("test" OR "mywork") AND domain:"www.example.com"

Special Characters

The following characters need to be avoided by using a backslash:
+ - & | ! ( ) { } [ ] ^ " ~ * ? : \

useragent:*Windows\\\ NT* AND url:*\+*

Available fields

The fields available to search traffic in the Explore section, define Custom Rules or define Endpoints are listed in the following table.

Field NameTypeValidityExampleDescription
asnNumberExplore, Custom rules, Endpointsasn:(14618 OR 16509 OR 38895)Identify requests using an (Autonomous System Number) ASN:

- 14618
- 16509
- 38895
cityStringExplore, Custom rulescity:"Paris"Identify requests incoming from:

- Paris
countrycodeStringExplore, Custom rulesNOT countrycode:(BE OR BG OR CZ OR DK OR DE OR

EE OR IE OR EL OR ES OR FR OR HR OR IT OR CY OR

LV OR LT OR LU OR HU OR MT OR NL OR AT OR PL OR

PT OR RO OR SI OR SK OR FI OR SE OR UK OR IS OR

LI OR NO OR CH)
Identify requests that are not incoming from:

- A European country
- When there is a link to all country codes
domainStringExplore, Custom rules, Endpointsdomain:*.back.example.comIdentify all requests going to:

- dashboard.back.example.com
- bo.back.example.com
fileextensionStringExplore, Custom rules, Endpointsfileextension:"php"Identify all php requests
graphqlopnameStringExplore, Custom rules, Endpointsgraphqlopname:LoginIdentifies requests sent on a GraphQL endpoint with the Operation Name:

- Login
graphqloptypeStringExplore, Custom rules, Endpointsgraphqloptype:mutationIdentifies requests sent on a GraphQL endpoint the operation type:

- mutation
ipIPExplore, Custom rules, Endpointsip:[1.2.3.4 TO 1.2.3.6]
ip:1.2.3.4
ip:"2001:0db8:85a3:0000:0000:8a2e:0370:7334"
Identify all requests with IP :

- Range: 1.2.3.4 , 1.2.3.5 , 1.2.3.4.6
- Single IPv4: 1.2.3.4
- Single IPv6: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
methodStringExplore, Custom rules, Endpointsmethod:"POST"Identify all requests with:

- POST Method
protocolStringExplore, Custom rules, Endpointsprotocol:"http"Identify all requests with:

- HTTP protocol
refererStringExplore, Custom rules, Endpointsreferer:www.example.com/exampleIdentify all requests incoming from:

- "www.example.com/example"
refererdomainStringExplore, Custom rules, Endpointsrefererdomain:"www.google.fr"Identify all requests incoming from:

- "www.google.fr"
requestidStringExplorerequestid:"48d84144-b7a3-4fce-b2f8-eecf372e8128"Search a request with its unique DataDome request ID:

- "48d84144-b7a3-4fce-b2f8-eecf372e8128"
reversednsStringExplore, Custom rules, Endpointsreversedns:*.example.comIdentify all requests with a Reverse DNS:

- mail.example.com
- IP-34-45-56-23-box.example.com
sessionidStringExplore, Custom rulessessionid:AHrlqAAAAAMA2mpXOOaaUKMA0Y0tvQ==Identify a specific session ID:

- AHrlqAAAAAMA2mpXOOaaUKMA0Y0tvQ==
torBooleanExplore, Custom rulestor:trueIdentify all requests using tor network
urlStringExplore, Custom rules, Endpointsurl:(\_\\?utm_source=myUtm OR \_utm_source=myUtm)Identify all requests including the URL parameter:

- utm_source=myUtm
useragentStringExplore, Custom rules, Endpointsuseragent:"AdsBot-Google (+http://www.google.com/adsbot.html)"Identify all requests with the user agent:

- AdsBot-Google (+http://www.google.com/adsbot.html)