# ES Nest won't insert @timestamp

**URL:** <https://discuss.elastic.co/t/es-nest-wont-insert-timestamp/87808>\
**Category:** Elasticsearch\
**Created:** [May 31, 2017, 9:06pm UTC](https://discuss.elastic.co/t/es-nest-wont-insert-timestamp/87808 "2017-05-31T21:06:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian\_Cross](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ian_cross/32/15581_2.png) [@Ian\_Cross](https://discuss.elastic.co/u/Ian_Cross)\
**Post date:** [May 31, 2017, 9:06pm UTC](https://discuss.elastic.co/t/es-nest-wont-insert-timestamp/87808/1 "2017-05-31T21:06:15Z")

</div>

Hi,

I am trying to insert a record into Elasticsearch using NEST. I need the timestamp to be indexed as "@timestamp" not "timestamp".

```
class Program
{

   /// <summary>
   /// 
   /// </summary>
   /// <param name="args"></param>
    static void Main(string[] args)
    {

        var settings = new ConnectionSettings(new Uri("http://opselastic.elk.apps-ops.boitop.dev.cloud. ******.com:9200")).DefaultIndex("apparea_apps");
        var client = new ElasticClient(settings);

        var typeUpdate = new health
        {
            @timestamp = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss"),
            apparea = "icross",
            appname = "Test",
            status = "green"
        };

        var IndexResponse = client.Index(typeUpdate)
            ;

    }
}

/// <summary>
/// 
/// </summary>
class health
{
    public string @timestamp { get; set; }
    public string apparea { get; set; }
    public string appname { get; set; }
    public string status { get; set; }
}

```

}

What I expect:  
{  
"\_index": "apparea\_apps",  
"\_type": "health",  
"\_id": "AVxgGpY8yhns588mvFP4",  
"\_score": 1,  
"\_source": {  
"@timestamp": "2017-05-31T15:00:00",  
"apparea": "icross",  
"appname": "Test",  
"status": "green"  
}  
}

What I get

{  
"\_index": "apparea\_apps",  
"\_type": "health",  
"\_id": "AVxgGpY8yhns588mvFP4",  
"\_score": 1,  
"\_source": {  
"timestamp": "2017-05-31T15:00:00",  
"apparea": "icross",  
"appname": "Test",  
"status": "green"  
}  
}

Notice the difference in the timestamp? How do I correct this?

---

<div class="post-metadata">

**Author:** ![Mike.Barretta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike.barretta/32/16688_2.png) [@Mike.Barretta](https://discuss.elastic.co/u/Mike.Barretta)\
**Post date:** [May 31, 2017, 9:32pm UTC](https://discuss.elastic.co/t/es-nest-wont-insert-timestamp/87808/2 "2017-05-31T21:32:25Z")

</div>

I believe the `@timestamp` field is a special field created by data flowing through date processors on ingest nodes ([https://www.elastic.co/guide/en/elasticsearch/reference/5.4/date-processor.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/date-processor.html)) or logstash ([https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html#plugins-filters-date-target](https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html#plugins-filters-date-target)).

Is there a reason the field name `timestamp` won't work?

If you're looking to ingest data into an index that has data coming through a date processor, you might be better off configuring the processor to use `timestamp` instead by setting the appropriate config option (`target` for logstash, `target_field` for ingest node ...why different? who knows), though you'd have to reindex existing data.

---

<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:** [June 28, 2017, 9:32pm UTC](https://discuss.elastic.co/t/es-nest-wont-insert-timestamp/87808/3 "2017-06-28T21:32:48Z")

</div>

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