title: How to create a new field from existing fields during indexing in ElasticSearch?
body: <p>I have a Lambda that receives events from Kinesis and writes the event to ElasticSearch cluster.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>doc id</th>
  <th>FirstTimestamp</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>d1</td>
  <td>15974343498</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Now when we receive another event, I want to update the document in the ElasticSearch to</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>doc id</th>
  <th>FirstTimestamp</th>
  <th>SecondTimestamp</th>
  <th>TimeTag</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>d1</td>
  <td>15974343498</td>
  <td>15974344498</td>
  <td>1000</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>How can I do this without having to first GET the existing doc from ElasticSearch and then doing a PUT?</p>
  <p>I found the update option <a href="https://stackoverflow.com/questions/18466773/add-additional-attributes-to-an-existing-document-elasticsearch">here</a> using which I can add the field SecondTimestamp, but how can I add the TimeTag field; it requires us to do an operation using the FirstTimestamp.</p>