title: Reformate sources from elastic search
body: <p>Through the dev tools in Elastic with this command :</p>
  <p>GET &quot;my_index&quot;/_search/?filter_path=hits.hits._source&amp;size=1</p>
  <p>I have :</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;hits&quot; : {
      &quot;hits&quot; : [
        {
          &quot;_source&quot; : {
            &quot;@timestamp&quot; : &quot;2020-10-10T14:00:00.000Z&quot;,
            &quot;Date&quot; : &quot;2020-10-10T14:00:00Z&quot;,
            &quot;MeanValue&quot; : 58.23516987
          }
        }
      ]
    }
  }
  </code></pre>
  <p>It is an exemple of 1 hit</p>
  <p>I wanted to know if it is possible with maybe a Painless Code or any other solution in Elastic to change the name of the source key and get :</p>
  <pre><code>{
    &quot;timestamp&quot;: &quot;2020-10-10T14:00:00Z&quot;
    &quot;value&quot; : 58.23516987
  }
  </code></pre>
  <p>I did it with Python by getting the data with REST API but I wonder if there is a solution to have that output directly from Elastic search</p>