Query filters
필터링 기능을 제공하는 API 요청에서 아래의 쿼리 필터 사양을 사용합니다.
필터 문자열은 표현식 또는 표현식 목록으로 지정되어야 합니다.
간단한 표현식
필터는 다음 문법을 사용하여 지정해야 합니다.
표현식은 일반적인 형식을 취합니다.
<expr> |
::= |
<field> <operator> <value> |
<field>
의 등급은 string
입니다. <field>
에 공백이나 콜론이 포함된 경우 큰따옴표로 묶어야 합니다.
<operator>
은 등호 또는 관계 연산자일 수 있으며 아래의 사양을 따릅니다.
등호 연산자 "="
은(는) 문자열 필드에만 정의됩니다.
접두사 일치 연산자 ":"
는 문자열 필드에만 정의됩니다.
관계 연산자 "<" | ">" | "<=" | ">="
는 타임스탬프 필드에만 정의됩니다.
- 제공된
<value>
는 string
여야 하며 <field>
에 따라 Timestamp
형식일 수 있습니다. <value>
에 공백이나 콜론이 포함된 경우 큰따옴표로 묶어야 합니다.
표현식 목록
표현식을 조인하여 더 복잡한 쿼리를 형성할 수 있습니다. BNF 사양은 다음과 같습니다.
<exprList> |
::= |
<expr> |
<exprList> <conjunction> <expr> |
<negation> <expr>
|
<conjunction> |
::= |
"AND" | "OR" | "" |
<negation> |
::= |
"NOT" |
빈 문자열을 접속사로 사용하면 암시적 AND 역할을 합니다.
조인 연산의 우선순위는 가장 높은 순에서 낮은 순으로 NOT, AND, OR입니다.
예
다음은 몇 가지 필터 예입니다. 지원되는 실제 필드는 API 버전마다 다를 수 있습니다. v1beta1
에서 사용할 수 있는 필터 열은 여기를 참고하세요.
2018년 4월 5일 이후에 생성된 모든 알림을 쿼리하려면 다음 안내를 따르세요.
createTime >= "2018-04-05T00:00:00Z"
'Gmail 피싱' 소스의 모든 알림을 쿼리하려면 다음 안내를 따르세요.
source="Gmail phishing"
'Gmail'로 시작하는 소스의 모든 알림을 쿼리하려면 다음 안내를 따르세요.
source:"Gmail"
2017년에 시작된 모든 알림을 쿼리하려면 다음을 실행합니다.
startTime >= "2017-01-01T00:00:00Z" AND startTime <
"2018-01-01T00:00:00Z"
type="User reported phishing" source="Gmail phishing"
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-07-10(UTC)
[null,null,["최종 업데이트: 2024-07-10(UTC)"],[[["Filter strings are constructed using expressions or lists of expressions, applying operators to specified fields and values."],["Operators include equality (`=`), prefix match (`:`), and relational operators (`\u003c`, `\u003e`, `\u003c=`, `\u003e=`) with specific usage depending on the field type."],["Expression lists combine expressions using conjunctions (`AND`, `OR`, implicit `AND`) and negation (`NOT`) with precedence order: `NOT`, `AND`, `OR`."],["Values and fields containing spaces or colons must be enclosed in double quotes."],["Refer to the provided documentation for specific filter columns available in different API versions and examples of constructing filter strings."]]],["API requests with filtering use filter strings as expressions or lists. Expressions follow the format: `\u003cfield\u003e \u003coperator\u003e \u003cvalue\u003e`. Fields can be strings, enclosed in double quotes if containing spaces or colons. Operators include `=` (equality), `:` (prefix match) for strings, and `\u003c`, `\u003e`, `\u003c=`, `\u003e=` (relational) for timestamps. Values are strings, potentially in Timestamp format, also quoted if necessary. Expression lists are joined by `AND`, `OR`, or implicit `AND` and can be negated with `NOT`, with precedence of NOT, AND, and then OR.\n"]]