# Logstash Fingerprint Plugin: How to Exclude @timestamp

**URL:** https://discuss.elastic.co/t/logstash-fingerprint-plugin-how-to-exclude-timestamp/112498
**Category:** Logstash
**Created:** [December 19, 2017, 7:35pm UTC](https://discuss.elastic.co/t/logstash-fingerprint-plugin-how-to-exclude-timestamp/112498 "2017-12-19T19:35:19Z")
**Posts on this page:** 1
**Showing post:** 9

<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: [December 20, 2017, 1:33pm UTC](https://discuss.elastic.co/t/logstash-fingerprint-plugin-how-to-exclude-timestamp/112498/9 "2017-12-20T13:33:38Z")

</div>

@shreyask I wanted to know the answer, so I experimented till I got this working. My apologies if my ruby coding style makes your eyeballs bleed. Not sure if you will also want to filter out host and @version.

```
filter {
  ruby {
    code => "
      s = ''
      h = event.to_hash
      h.each { |k, v|
        if k != '@timestamp'
          s += ',' + k.to_s + ':' + v.to_s
        end
      }
      event.set('some-field-name', s)
    "
  }
  fingerprint {
    key => "abc123"
    source => "some-field-name"
    method => "SHA256"
  }
}
```
```
{
                "bar" => 1234,
         "@timestamp" => 2017-12-20T13:29:37.110Z,
                "foo" => "0f4c2678",
           "@version" => "1",
               "host" => "[...]",
        "fingerprint" => "732e31008aa3d3fdfda1d1160994c561ef5022e6e5183598c90b4e69f76c2db9",
    "some-field-name" => ",@version:1,host:[...],bar:1234,foo:0f4c2678"
}
{
                "bar" => 1234,
         "@timestamp" => 2017-12-20T13:29:37.150Z,
                "foo" => "0f4c2678",
           "@version" => "1",
               "host" => "[...]",
        "fingerprint" => "732e31008aa3d3fdfda1d1160994c561ef5022e6e5183598c90b4e69f76c2db9",
    "some-field-name" => ",@version:1,host:[...],bar:1234,foo:0f4c2678"
}
```
```
```

---

_[View the full topic](https://discuss.elastic.co/t/logstash-fingerprint-plugin-how-to-exclude-timestamp/112498)._
