# Replace my @timestamp

**URL:** <https://discuss.elastic.co/t/replace-my-timestamp/40739>\
**Category:** Logstash\
**Created:** [February 2, 2016, 2:12pm UTC](https://discuss.elastic.co/t/replace-my-timestamp/40739 "2016-02-02T14:12:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.francia](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@m.francia](https://discuss.elastic.co/u/m.francia)\
**Post date:** [February 2, 2016, 2:12pm UTC](https://discuss.elastic.co/t/replace-my-timestamp/40739/1 "2016-02-02T14:12:09Z")

</div>

Hi!  
I have a log that looks like this "2016-02-02 14:52:18" , and I want to replace my @timestamp, I tried different ways but none works. I have read many entries but I didn´t find a solution.  
Actually im trying with this filter

mutate{  
add\_field =\>{"data" =\> "%{year}-%{month}-%{day} %{time}"}  
}  
date{  
match =\> ["data", "YYYY-MM-dd HH:mm:ss"]  
target =\> "@timestamp"  
}

My logstash console shows this "@timestamp" =\> "2016-02-02T14:05:30.000Z",

thanks in advance.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 2, 2016, 6:56pm UTC](https://discuss.elastic.co/t/replace-my-timestamp/40739/2 "2016-02-02T18:56:56Z")

</div>

Please show a complete example message from a `stdout { codec => rubydebug }` output.

---

<div class="post-metadata">

**Author:** ![m.francia](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@m.francia](https://discuss.elastic.co/u/m.francia)\
**Post date:** [February 3, 2016, 10:18am UTC](https://discuss.elastic.co/t/replace-my-timestamp/40739/3 "2016-02-03T10:18:11Z")

</div>

```
     "@version" => "1",
   **"@timestamp" => "2016-02-03T10:02:40.000Z",**
         "type" => "adobelog",
         "host" => " *******",
  "clientstate" => "connect-continue",
       "status" => "connect",
       "stream" => "continue",
     "category" => "session",
    **"timestamp" => "2016-02-03 11:02:40",**
         "year" => "2016",
        "month" => "02",
          "day" => "03",
         "time" => "11:02:40",
     "timezone" => "CET",
       "ipHost" => " ********",
         "spid" => 16012,
      "cpuload" => 0,
  "memoryusage" => "2",
          "app" => "vod",
  "appinstance" => "_definst_",
"eventduration" => 0,
     "clientip" => " ********",
         "port" => [
    [0] "1935",
    [1] "1935"
],
     "referrer" => " *****"
    "useragent" => "WIN 20,0,0,286",
           "os" => "WIN",
      "scBytes" => 3646

```

I want to replace my @timestamp with the value of timestamp and I´m generating the timestamp value with the logstash filter

```
 mutate{
      add_field =>{"timestamp" => "%{year}-%{month}-%{day} %{time} +0100"}
    }

```

And I tried

```
date{
      match => ["timestamp", "YYYY-MM-dd HH:mm:ss Z"]
      target => "@timestamp"
    }

```

And in other case with ` **"timestamp" => "2016-02-03 11:02:40",** ` I tried

```
date{
      match => ["timestamp", "YYYY-MM-dd HH:mm:ss"]
      timezone => "Europe/Madrid" 
      target => "@timestamp"
    }

```

thanks in advance.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 3, 2016, 12:37pm UTC](https://discuss.elastic.co/t/replace-my-timestamp/40739/4 "2016-02-03T12:37:44Z")

</div>

`@timestamp` is UTC and `timestamp` is CET. That's why there's a one-hour difference. Everything looks fine.

---

<div class="post-metadata">

**Author:** ![m.francia](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@m.francia](https://discuss.elastic.co/u/m.francia)\
**Post date:** [February 3, 2016, 1:07pm UTC](https://discuss.elastic.co/t/replace-my-timestamp/40739/5 "2016-02-03T13:07:25Z")

</div>

Hi,

Oh god!, I wanted to do that because I wanted to load historical logs, and I forgot to check this loading new data from a old log. I checked it, and works! =)

Thanks for everything.

---

<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:** [July 6, 2017, 5:13am UTC](https://discuss.elastic.co/t/replace-my-timestamp/40739/6 "2017-07-06T05:13:12Z")

</div>


