# Passing variables form changes to operations

**URL:** <https://discuss.elastic.co/t/passing-variables-form-changes-to-operations/297353>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [February 16, 2022, 10:32am UTC](https://discuss.elastic.co/t/passing-variables-form-changes-to-operations/297353 "2022-02-16T10:32:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marek\_duciuc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marek_duciuc/32/100189_2.png) [@marek\_duciuc](https://discuss.elastic.co/u/marek_duciuc)\
**Post date:** [February 16, 2022, 10:32am UTC](https://discuss.elastic.co/t/passing-variables-form-changes-to-operations/297353/1 "2022-02-16T10:32:08Z")

</div>

My operation file looks like:

```auto
{
    "name": "match-all-query_id",
    "operation-type": "search",
    "body": {
      "query": {
        "match_all": {}
      },
 "_source": false
    }
},

{
    "name": "match-all-query_name_surname",
    "operation-type": "search",
    "body": {
      "query": {
        "match_all": {}
      }.
 "_source": ["name","surname"]
    }
},

```

and my challenge looks like:

```auto
 {
  "name": "Search only",
  "description": "just search",
  "schedule": 
  [

  
     {
      "operation": "match-all-query_id",
      "clients": 4,
      "warmup-iterations": 1000,
      "iterations": 1000,
      "target-throughput": 100
    },

     {
      "operation": "match-all-query_name_surname",
      "clients": 4,
      "warmup-iterations": 1000,
      "iterations": 1000,
      "target-throughput": 100
    }  
  ]
}

```

It works but I how I can get rid of these duplicate operations  
I would love to have something like:

```auto

{
    "name": "match-all-query",
    "operation-type": "search",
    "body": {
      "query": {
        "match_all": {}
      },
 "_source": $MYVARIABALE
}

```

Then I want to use some parameters as below, syntax might be the wrong bot I think ide is clear.

```auto
 {
  "name": "Search only",
  "description": "just search",
  "schedule": 
  [
 
     {
      "operation": "match-all-query",
"name":"id_only"
      "clients": 4,
      "warmup-iterations": 1000,
      "iterations": 1000,
      "target-throughput": 100
      "$MYVARIABALE": false
    },

     {
      "operation": "match-all-query",
"name":"multiple fields"
      "clients": 4,
      "warmup-iterations": 1000,
      "iterations": 1000,
      "target-throughput": 100
      "$MYVARIABALE": "["name","sutname"]"
    }  
  ]
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 16, 2022, 10:33am UTC](https://discuss.elastic.co/t/passing-variables-form-changes-to-operations/297353/2 "2022-03-16T10:33:06Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
