# Create Monitor Condition for per document monitor if query having field which contains value \`greater than\` or \`less than\` particular value

**URL:** <https://forum.opensearch.org/t/create-monitor-condition-for-per-document-monitor-if-query-having-field-which-contains-value-greater-than-or-less-than-particular-value/11769>\
**Category:** Alerting\
**Tags:** discuss\
**Created:** [December 12, 2022, 11:35am UTC](https://forum.opensearch.org/t/create-monitor-condition-for-per-document-monitor-if-query-having-field-which-contains-value-greater-than-or-less-than-particular-value/11769 "2022-12-12T11:35:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![divyank\_1](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@divyank\_1](https://forum.opensearch.org/u/divyank_1)\
**Post date:** [December 12, 2022, 11:35am UTC](https://forum.opensearch.org/t/create-monitor-condition-for-per-document-monitor-if-query-having-field-which-contains-value-greater-than-or-less-than-particular-value/11769/1 "2022-12-12T11:35:08Z")

</div>

OS Dashboards Version: 2.0.0

My Document in Index:

```auto
{
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 4,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "test2",
        "_id" : "YNXDBYUBGeobV8lKm0LR",
        "_score" : 1.0,
        "_source" : {
          "name" : "ABC",
          "function" : "UVW",
          "tag_name" : "abc",
          "tag_value" : 197
        }
      }

```

I want to create monitor condition based on condition when particular document has value \> 197.

In Visual Editor of Per document Monitor, the query has only two only option, `is`, `is not`.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/9/9dab248f316e039f03f0db79b1b1f3d82f529739.png)

My Extraction Query:

```auto
{
    "description": "",
    "queries": [
        {
            "id": "value",
            "name": "value",
            "query": "tag_value:\"197\"",
            "tags": []
        }
    ]
}

```

pls let me know how to implement monitor condition in per document monitor to get documents based on field if it’s value is `greater than` or `less than` particular value.
