title: Elastic Search mapping of logstash @timestamp to strongly typed in .NET
body: <p>I use Serilog and the ElasticSearch Sink with AutoRegisterTemplate = true</p>
  
  <p>That stores the following in ElasticSearch</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
  "@timestamp": "2016-08-17T08:57:37.3487446+02:00",
  "level": "Information",
  "messageTemplate": "User login {UserId}",
  "message": "User login ...,
  "fields": {
    "UserId": "...",
    "ProcessId": 15568,
    "ThreadId": 14,
    "MachineName": "...",
    "EnvironmentUserName": "...",
    "HttpRequestId": "...",
    "HttpRequestClientHostIP": "::1",
    "HttpRequestType": "POST",
    "Version": "1.0.0.0"
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I can query the index with DynamicResponse</p>
  
  <pre><code>            var searchResponse = client.Search&lt;DynamicResponse&gt;(s =&gt; s
              .Index("logstash-*")
              .AllTypes()
              .Size(50)
              .Query(q =&gt; q.Bool(b =&gt; b.Must(bs =&gt; bs.Term(p =&gt; p.Field("fields.UserId.raw").Value("..."))))
              )
          );
  </code></pre>
  
  <p>But I would like to use a strongly typed class for the result.</p>
  
  <p>I have tried with the following class.</p>
  
  <pre><code>        public class LogResponse
      {
          public string Message { get; set; }
          [Date(Name = "@timestamp")]
          public DateTime Timestamp { get; set; }
          public LogResponseFields Fields { get; set; }
  
          public class LogResponseFields
          {
              public Guid UserId { get; set; }
          }
      }
  </code></pre>
  
  <p>But the timestamp is not set, it defaults to DateTime.Min, both Message and UserId are mapped correctly.</p>
  
  <p>How to I map the @timestamp field?</p>