Extracting @timestamp from Source within Hits

I am trying to extract @timestamp from .Source but whenever I type a dot after the word Source I do not get any options that Source can contain where I can grab @timestamp. Is there a specific way I can grab @timestamp from Source? I am using this in my application using elasticsearch NEST. Once I grab the @timestamp I am planning on sending it to my database.

Is there a way I can extract @timestamp so I can set var time to it?

enter image description here

So when you are debugging you can see the key value pair that holds @timestamp:

enter image description here

The only options I get when I do Source. are .ToString, .GetType, GetHashCode, Equals, Suffix

This is my attempt:

public async Task<int> InsertLogData()

            SqlConnection connection = null;
            SqlCommand command = null;
            int numrows = 0;

                var response = await _elasticClient.SearchAsync<Object>(s => s
                    .Query(q => +q
                        .DateRange(dr => dr

                connection = new SqlConnection("Data Source=.\\SQLExpress;Database=ElasticSearchService;Trusted_Connection=True;");

                foreach (var item in response.Hits)
                    var id = item.Id;
                 //   var time = item.Source here is where i want to grab @timestamp
                    var sourceItem = item.Source;

                    var json = _elasticClient.RequestResponseSerializer.SerializeToString(sourceItem);

                    command = new SqlCommand("INSERT INTO EsLogs (ELKLogID, LogMessage, DateCreated) VALUES ('" + id + "','" + json + "', '" + /*time*/ + "')", connection);

                numrows = command.ExecuteNonQuery();

            catch (Exception ex)

enter image description here

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