title: Writing to @timestamp in LogStash
body: <p>I need to write the value of a UNIX timestamp field to <code>@timestamp</code> so that I can correctly index data flowing through logstash, I have this part working. However I also have the requirement that <code>@timestamp</code>'s value should be the insertion time. To this end I have made a temporary field that holds <code>@timestamp</code>s original value.</p>
  
  <p>Here is what I am working with:</p>
  
  <pre><code>filter {
      csv {
          separator =&gt; "  " # &lt;- this white space is actually a tab, don't change it, it's already perfect
          skip_empty_columns =&gt; true
          columns =&gt; ["timestamp", ...]
      }
      # works just fine
      mutate {
          add_field =&gt; {
              "tmp" =&gt; "%{@timestamp}"
          }
      }
      # works just fine
      date {
         match =&gt; ["timestamp", "UNIX"]
         target =&gt; "@timestamp"
      }
      # this works too
      mutate {
          add_field =&gt; {
              "[@metadata][indexDate]" =&gt; "%{+YYYY-MM-dd}"
          }
      }   
      # @timestamp is not being set back to its original value
      date {
          match =&gt; ["tmp", "UNIX"]
          target =&gt; "@timestamp"
      }
      # works just fine
      mutate {
          remove_field =&gt; ["tmp"]
      }
  }
  
  output {
      elasticsearch {
          hosts =&gt; "elasticsearch:9200"
          # this works
          index =&gt; "indexname-%{[@metadata][indexDate]}"
      }
  }
  </code></pre>
  
  <p>The Problem is here:</p>
  
  <pre><code>date {
      match =&gt; ["tmp", "UNIX"]
      target =&gt; "@timestamp"
  }
  </code></pre>
  
  <p><code>@timestamp</code> is not being set back to its original value. When I check the data it has the same value as the <code>timestamp</code> field.</p>