# Set custom Transform schedule time in kibana

**URL:** https://discuss.elastic.co/t/set-custom-transform-schedule-time-in-kibana/298794
**Category:** Kibana
**Created:** [March 3, 2022, 11:18pm UTC](https://discuss.elastic.co/t/set-custom-transform-schedule-time-in-kibana/298794 "2022-03-03T23:18:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dash5000](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@dash5000](https://discuss.elastic.co/u/dash5000)
#### Post date: [March 3, 2022, 11:18pm UTC](https://discuss.elastic.co/t/set-custom-transform-schedule-time-in-kibana/298794/1 "2022-03-03T23:18:33Z")

</div>

Hello Everyone,

I just started using transform in kibana UI to aggregate data and also to have a longer retention period for visualization. The data collections work fine, my transform basically collectors two fields which are aggregated on max.

My transform json is

```auto
{
  "id": "testu",
  "version": "7.16.1",
  "create_time": 1646254133114,
  "source": {
    "index": [
      "test12-*"
    ],
    "query": {
      "match_all": {}
    }
  },
  "dest": {
    "index": "test123"
  },
  "frequency": "1h",
  "sync": {
    "time": {
      "field": "@timestamp",
      "delay": "60s"
    }
  },
  "pivot": {
    "group_by": {
      "@timestamp": {
        "date_histogram": {
          "field": "@timestamp",
          "calendar_interval": "1d"
        }
      },
      "device": {
        "terms": {
          "field": "devndevice"
        }
      },
      "name": {
        "terms": {
          "field": "devname"
        }
      }
    },
    "aggregations": {
      "in-use.max": {
        "max": {
          "field": "in-use"
        }
      },
      "out-use.max": {
        "max": {
          "field": "out-use"
        }
      }
    }
  },
  "settings": {
    "max_page_search_size": 500
  },
  "retention_policy": {
    "time": {
      "field": "@timestamp",
      "max_age": "180d"
    }
  }
}

```

The issue is that the my data collections happens at 7 in the evening but i want that to happen at midnight. Also since i am having a timestamp for 24h because i want to know the max for both fields each day till the previous day.

For example: March 3 12:05 AM should show run the transform and update till the march March 2 day .

How could i configure the transform to perform on a schedule time everyday to get the daily peaks of the two fields till the previous day. Currently my transform run every day at evening 7 and it generates till the previous day till the same time.  
Just want to schedule the time to early morning at 12:10 from 7PM.

Regards,  
Darshan

---

<div class="post-metadata">

### Author: ![Hendrik\_Muhs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hendrik_muhs/32/25802_2.png) [@Hendrik\_Muhs](https://discuss.elastic.co/u/Hendrik_Muhs)
#### Post date: [March 4, 2022, 8:51am UTC](https://discuss.elastic.co/t/set-custom-transform-schedule-time-in-kibana/298794/2 "2022-03-04T08:51:45Z")

</div>

Your transform runs every hour, because `frequency` is set to `1h`. What you are experiencing is not a problem of scheduling, but a timezone issue. Elasticsearch uses the UTC time, to have a consistent time allover the world. All dates are stored in UTC and the date\_histogram will produce buckets according to UTC. Transform now runs shortly after midnight, but it is midnight according to UTC, not midnight according to your timezone.

You can [change the timezone of your `date_histogram`](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html#datehistogram-aggregation-time-zone). This will tell the aggregation to create buckets according to the specified timezone.

Transform will still check every hour, but now start shortly after midnight according to the configured timezone.

FWIW: The behavior is by design, if a `date_histogram` is configured transform executes - at default - when it retrieved all data for a bucket. You can change the default in `settings` by setting `align_checkpoints` to `false`. This will produce intermediate results, so you can see the data of the current day while the day isn't over yet. However that is obviously more expensive as it re-calculates the buckets more often. That's why `align_checkpoints` has the default setting `true`.

---

<div class="post-metadata">

### Author: ![dash5000](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@dash5000](https://discuss.elastic.co/u/dash5000)
#### Post date: [March 4, 2022, 2:29pm UTC](https://discuss.elastic.co/t/set-custom-transform-schedule-time-in-kibana/298794/3 "2022-03-04T14:29:42Z")

</div>

Thanks @Hendrik_Muhs for the answer. One more thing, i wanted to ask is when i am visualizing the data of the transform in a line lens. I have two fields in group\_by block devndevice and devname, I need to display two lines for same aggregation but from different devname in same visualization using kibana. Currently its calculating the max of all the the same field across all devname and visualizing a single line. Is there any way that i can get multiple line with the same field with different devname.

FOr example: we have devname=test1 devndevice=test, and devname=test2 devndevice=test, I should be able to visualize both the metrics for different devndevice not just the single one that is combining both devndeivce.

Regards,  
Darshan

---

<div class="post-metadata">

### Author: ![Hendrik\_Muhs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hendrik_muhs/32/25802_2.png) [@Hendrik\_Muhs](https://discuss.elastic.co/u/Hendrik_Muhs)
#### Post date: [March 4, 2022, 3:01pm UTC](https://discuss.elastic.co/t/set-custom-transform-schedule-time-in-kibana/298794/4 "2022-03-04T15:01:12Z")

</div>

I am sorry, I can't answer the last question. From a data perspective it should work, because you group by `devname` in addition to `date_histogram`.

I hope someone else can answer. If you should not get an answer after some waiting, please open a new thread.

---

<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: [April 1, 2022, 3:02pm UTC](https://discuss.elastic.co/t/set-custom-transform-schedule-time-in-kibana/298794/5 "2022-04-01T15:02:01Z")

</div>

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