Query data from C# program the result not equal to the data filter from kibana

I am new to C#, and I want to write a program to query data from elasticsearch.
First of all, I load kibana sample log and want to query from my C# program, and below is my C# program. I want to filter clientip is logs.

class Program
        static void Main(string[] args)
            var settings = new ConnectionSettings(new Uri(""))
            var client = new ElasticClient(settings);

            var searchResponse = client.Search<SampleLog>(s => s
            .Query(q => q
                 .Match(m => m
                    .Field(f => f.clientip)
            var logs = searchResponse.Documents;
            foreach(SampleLog p in logs)


I am confused that if my log has 40 fields, and do I need initialize 40 var such as below?
Does it affect the result data?

public class SampleLog
        public string extension { get; set; }
        public string clientip { get; set; }
        public string message { get; set; }
        public string url { get; set; }
        public int bytes { get; set; }

when I run my code, the result has 10 logs:

However, I can't find so many logs from kibana, and there are only two logs:

thanks a lot !

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