<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: add plus minutes to a date time value with the jolt transform json processor in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/add-plus-minutes-to-a-date-time-value-with-the-jolt/m-p/352613#M236560</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I dont think the following formula is correct:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      "end": "=${end:toDate('yyyy-MM-dd HH:mm:ss'):toNumber():plus(900000):format('yyyy-MM-dd HH:mm:ss')}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are trying to use Expression Language in the Jolt Expression and that is not going to work. Also the expression ${end...} assumes that you have an attribute called "end" which I don think its the case. I think what you need to do is the following (assuming you will need to split each json record into its own flowfile):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1- SplitJson&lt;/P&gt;&lt;P&gt;2- Use EvaluateJsonPath to extract the "end" date as an attribute&lt;/P&gt;&lt;P&gt;3- Use JoltTransformationJson&amp;nbsp; where you utilize the attribute from above to do the addition as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "modify-overwrite-beta",
    "spec": {
     
           "end": "${end_attribute:toDate('yyyy-MM-dd HH:mm:ss'):toNumber():plus(900000):format('yyyy-MM-dd HH:mm:ss')}"
     
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps, if it does please accept solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Sep 2022 14:23:37 GMT</pubDate>
    <dc:creator>SAMSAL</dc:creator>
    <dc:date>2022-09-19T14:23:37Z</dc:date>
    <item>
      <title>add plus minutes to a date time value with the jolt transform json processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/add-plus-minutes-to-a-date-time-value-with-the-jolt/m-p/352611#M236558</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I want to add 15 minutes to a date-time value using the transform json processor, but with my configuration I get the same value as before. I expect for the end field to have 15 minutes more than the start field. Does anyone have any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[ {
  "store_id" : 1001,
  "date" : 20220918,
  "start" : "2022-09-18 00:15:00",
  "end" : "2022-09-18 00:15:00",
  "out" : 0
}, {
  "store_id" : 1001,
  "date" : 20220918,
  "start" : "2022-09-18 00:30:00",
  "end" : "2022-09-18 00:30:00",
  "out" : 0
}]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My jolt Specification&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "modify-overwrite-beta",
    "spec": {
     "*":{
           "end": "=${end:toDate('yyyy-MM-dd HH:mm:ss'):toNumber():plus(900000):format('yyyy-MM-dd HH:mm:ss')}"
      }
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result is the same&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[ {
  "store_id" : 1001,
  "date" : 20220918,
  "start" : "2022-09-18 00:15:00",
  "end" : "2022-09-18 00:15:00",
  "out" : 0
}, {
  "store_id" : 1001,
  "date" : 20220918,
  "start" : "2022-09-18 00:30:00",
  "end" : "2022-09-18 00:30:00",
  "out" : 0
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 13:56:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/add-plus-minutes-to-a-date-time-value-with-the-jolt/m-p/352611#M236558</guid>
      <dc:creator>MarioFRS</dc:creator>
      <dc:date>2022-09-19T13:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: add plus minutes to a date time value with the jolt transform json processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/add-plus-minutes-to-a-date-time-value-with-the-jolt/m-p/352613#M236560</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I dont think the following formula is correct:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      "end": "=${end:toDate('yyyy-MM-dd HH:mm:ss'):toNumber():plus(900000):format('yyyy-MM-dd HH:mm:ss')}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are trying to use Expression Language in the Jolt Expression and that is not going to work. Also the expression ${end...} assumes that you have an attribute called "end" which I don think its the case. I think what you need to do is the following (assuming you will need to split each json record into its own flowfile):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1- SplitJson&lt;/P&gt;&lt;P&gt;2- Use EvaluateJsonPath to extract the "end" date as an attribute&lt;/P&gt;&lt;P&gt;3- Use JoltTransformationJson&amp;nbsp; where you utilize the attribute from above to do the addition as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "modify-overwrite-beta",
    "spec": {
     
           "end": "${end_attribute:toDate('yyyy-MM-dd HH:mm:ss'):toNumber():plus(900000):format('yyyy-MM-dd HH:mm:ss')}"
     
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps, if it does please accept solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 14:23:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/add-plus-minutes-to-a-date-time-value-with-the-jolt/m-p/352613#M236560</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2022-09-19T14:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: add plus minutes to a date time value with the jolt transform json processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/add-plus-minutes-to-a-date-time-value-with-the-jolt/m-p/352618#M236563</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;thanks, i have try this out and it works.&amp;nbsp;I thought you can directly edit the value of the JSON file. Now I have to merge all split JSON files into one again&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 15:05:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/add-plus-minutes-to-a-date-time-value-with-the-jolt/m-p/352618#M236563</guid>
      <dc:creator>MarioFRS</dc:creator>
      <dc:date>2022-09-19T15:05:31Z</dc:date>
    </item>
  </channel>
</rss>

