Query filters
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
استخدِم مواصفات فلاتر طلبات البحث أدناه في طلبات واجهة برمجة التطبيقات التي توفّر إمكانيات الفلترة.
يجب تحديد سلسلة الفلتر كتعبير أو قائمة من التعبيرات.
تعبيرات بسيطة
يجب تحديد الفلاتر باستخدام القواعد النحوية التالية:
ويكون التعبير بالشكل العام:
<expr> |
::= |
<field> <operator> <value> |
<field>
string
. عندما يحتوي <field>
على مسافة أو علامة نقطتين، يجب وضعهما بين علامتي اقتباس.
- يمكن أن تكون الدالة
<operator>
عوامل تساوي المساواة أو العلاقة، وتتّبع المواصفات على النحو التالي:
يتم تحديد عامل المساواة "="
لحقول السلسلة فقط.
يتم تحديد عامل مطابقة البادئة ":"
لحقول السلسلة فقط.
يتم تحديد عوامل التشغيل الارتباطية "<" | ">" | "<=" | ">="
لحقول الطابع الزمني فقط.
- يجب أن يكون تنسيق
<value>
المقدَّم string
وقد يكون بتنسيق Timestamp
استنادًا إلى <field>
. عندما تحتوي السمة <value>
على مسافة أو نقطتين، يجب وضعها بين علامتَي اقتباس.
قوائم التعبيرات
يمكن ضم التعبيرات لإنشاء استعلام أكثر تعقيدًا. في ما يلي مواصفات BNF:
<exprList> |
::= |
<expr> |
<exprList> <conjunction> <expr> |
<negation> <expr>
|
<conjunction> |
::= |
"AND" | "OR" | "" |
<negation> |
::= |
"NOT" |
يعمل استخدام السلسلة الفارغة كحرف عطف كـ "و" ضمنيًا.
تكون أولوية عمليات الدمج، من الأعلى إلى الأدنى، هي NOT وAND وOR.
أمثلة
في ما يلي بعض الأمثلة على الفلاتر. يُرجى العِلم أنّ الحقول الفعلية المتوافقة قد تختلف بين الإصدارات المختلفة لواجهة برمجة التطبيقات. للاطّلاع على أعمدة الفلاتر المتوفّرة في v1beta1
، اطّلِع هنا.
لطلب البحث عن جميع التنبيهات التي تم إنشاؤها في 5 نيسان (أبريل) 2018 أو بعد هذا التاريخ:
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"
لطلب البحث عن جميع تنبيهات التصيّد الاحتيالي التي أبلغ عنها المستخدم: من المصدر "
Gmail":type="User reported phishing" source="Gmail phishing"
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-03-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-03-25 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Query filters\n\nUse the query filter specs below in API requests that provide filtering capabilities.\nThe filter string must be specified as an expression or list of expressions.\n\nSimple expressions\n------------------\n\nFilters must be specified using the following grammar:\n\nAn expression has the general form:\n\n|----------|---------|------------------------------|\n| `\u003cexpr\u003e` | ` ::= ` | `\u003cfield\u003e \u003coperator\u003e \u003cvalue\u003e` |\n\n- `\u003cfield\u003e` is a `string`. When `\u003cfield\u003e` contains a space or a colon must be enclosed by double quotes.\n- `\u003coperator\u003e` could be equality or relational operators, and follows specification as below: \n The equality operator `\"=\"` is defined only for string fields. \n The prefix match operator `\":\"` is defined only for string fields. \n The relational operators `\"\u003c\" | \"\u003e\" | \"\u003c=\" | \"\u003e=\"` are defined only for timestamp fields. \n- The `\u003cvalue\u003e` supplied should be `string` that may be in [Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp) format depending on the `\u003cfield\u003e`. When `\u003cvalue\u003e` contains a space or a colon it must be enclosed in double quotes.\n\n\u003cbr /\u003e\n\nExpression lists\n----------------\n\nExpressions may be joined to form a more complex query. The BNF specification is: \n\n|-----------------|---------|----------------------------------------------------------------------|\n| `\u003cexprList\u003e` | ` ::= ` | `\u003cexpr\u003e |` ` \u003cexprList\u003e \u003cconjunction\u003e \u003cexpr\u003e |` ` \u003cnegation\u003e \u003cexpr\u003e` |\n| `\u003cconjunction\u003e` | ` ::= ` | `\"AND\" | \"OR\" | \"\"` |\n| `\u003cnegation\u003e` | ` ::= ` | `\"NOT\"` |\n\nUsing the empty string as a conjunction acts as an implicit AND. \nThe precedence of joining operations, from highest to lowest, is NOT, AND, OR.\n\n\u003cbr /\u003e\n\nExamples\n--------\n\nGiven below are some example filters. Note that the actual fields supported may vary between\nthe different versions of the API. For filter columns available in `v1beta1` see [here](/workspace/admin/alertcenter/reference/filter-fields).\n\nTo query for all alerts created on or after April 5, 2018: \n\n`createTime \u003e= \"2018-04-05T00:00:00Z\"` \n\n\nTo query for all alerts from the source \"Gmail phishing\": \n\n`source=\"Gmail phishing\"` \n\n\nTo query for all alerts from a source which starts with \"Gmail\": \n\n`source:\"Gmail\"` \n\n\nTo query for all alerts which started in 2017: \n\n`startTime \u003e= \"2017-01-01T00:00:00Z\" AND startTime \u003c\n\"2018-01-01T00:00:00Z\"` \n\n\nTo query for all user reported phishing alerts from the source \"Gmail phishing\": \n\n`type=\"User reported phishing\" source=\"Gmail phishing\"`"]]