# Remove date from syslog message

**URL:** <https://discuss.elastic.co/t/remove-date-from-syslog-message/170650>\
**Category:** Logstash\
**Created:** [March 3, 2019, 6:53pm UTC](https://discuss.elastic.co/t/remove-date-from-syslog-message/170650 "2019-03-03T18:53:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulohperes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paulohperes/32/107556_2.png) [@paulohperes](https://discuss.elastic.co/u/paulohperes)\
**Post date:** [March 3, 2019, 6:53pm UTC](https://discuss.elastic.co/t/remove-date-from-syslog-message/170650/1 "2019-03-03T18:53:40Z")

</div>

Hello,

I'm building a server logs, the server receive logs from network equipments (Juniper, Ericsson, Cisco, Huawei and Nokia). The server does forward the logs to logstash server on port 55514.

Analyzing the logs, logs from Juniper, on message filed, the date is removed, but logs from Ericsson the date does keeping.

My configuration:

input {  
syslog {  
port =\> 55514  
}  
}

filter {  
syslog\_pri{}  
}

output {  
stdout { codec =\> rubydebug }  
}

Log from Juniper:

{  
"@version" =\> "1",  
"@timestamp" =\> 2019-03-03T18:37:07.000Z,  
"logsource" =\> "RAGGFSA01-re0",  
"host" =\> "10.171.32.14",  
"message" =\> "fpc4 MQCHIP(0) MALLOC DPage Free-bits Memory parity error ",  
"facility" =\> 21,  
"priority" =\> 171,  
"severity" =\> 3,  
"facility\_label" =\> "local5",  
"severity\_label" =\> "Error",  
"syslog\_facility\_code" =\> 1,  
"syslog\_facility" =\> "user-level",  
"syslog\_severity" =\> "notice",  
"syslog\_severity\_code" =\> 5,  
"timestamp" =\> "Mar 3 15:37:07"  
}

Log from Ericsson:

{  
"@version" =\> "1",  
"@timestamp" =\> 2019-03-03T16:36:57.000Z,  
"logsource" =\> "se-cge1b",  
"host" =\> "10.200.35.220",  
"message" =\> "Mar 3 15:37:06: %AAA-5-NOTICE: [local] administrator: (bln3\_script) logged in via tty: /dev/ttyp0, host: 10.200.1.135 59705\n",  
"facility" =\> 23,  
"priority" =\> 189,  
"severity" =\> 5,  
"facility\_label" =\> "local7",  
"severity\_label" =\> "Notice",  
"syslog\_facility\_code" =\> 1,  
"syslog\_facility" =\> "user-level",  
"syslog\_severity" =\> "notice",  
"syslog\_severity\_code" =\> 5,  
"timestamp" =\> "Mar 3 13:36:57"  
}

I would like remode the date from Ercisson's log, how can I to do that?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 3, 2019, 8:09pm UTC](https://discuss.elastic.co/t/remove-date-from-syslog-message/170650/2 "2019-03-03T20:09:53Z")

</div>

You could do it with something like

```
    grok { match => { "message" => "^%{MONTH} %{MONTHDAY} %{TIME}: %{GREEDYDATA:[@metadata][restOfLine]}" } }
    if "_grokparsefailure" not in [tags] {
        mutate { copy => { "[@metadata][restOfLine]" => "message" } }
    } else {
        mutate { remove_tag => ["_grokparsefailure"] }
    }
```

---

<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:** [March 31, 2019, 8:09pm UTC](https://discuss.elastic.co/t/remove-date-from-syslog-message/170650/3 "2019-03-31T20:09:54Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
