How to identify timefield of the index?











up vote
0
down vote

favorite












Is there a es query or some way to ask Elasticsearch that which field is being used as time field for a specific index?










share|improve this question


























    up vote
    0
    down vote

    favorite












    Is there a es query or some way to ask Elasticsearch that which field is being used as time field for a specific index?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Is there a es query or some way to ask Elasticsearch that which field is being used as time field for a specific index?










      share|improve this question













      Is there a es query or some way to ask Elasticsearch that which field is being used as time field for a specific index?







      elasticsearch kibana






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 16:36









      Talal

      63




      63
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          You can use Kibana to choose the right time field (Step 5):




          1. In Kibana, open Management, and then click Index Patterns.

          2. If this is your first index pattern, the Create index pattern page opens automatically. Otherwise, click Create index pattern in the upper left.

          3. Enter "your_index_name*" in the Index pattern field.

          4. Click Next step

          5. In Configure settings, select "@your_timestamp_field" in the Time Filter field name dropdown menu.

          6. Click Create index pattern.


          Kibana User Guide: Defining your index patterns



          Or search in your index mapping for an field with "type: date"



          curl 'http://localhost:9200/your_index/_mapping?pretty'
          {
          "your_index" : {
          "mappings" : {
          "your_index" : {
          "properties" : {
          "@**timestamp**" : {
          "type" : "date"
          },
          "@version" : {
          "type" : "text"
          },
          "clock" : {
          "type" : "long"
          },
          "host" : {
          "type" : "text"
          },
          "type" : {
          "type" : "text"
          }
          }
          }
          }
          }
          }


          Get Mapping



          Or look into your indexed documents:



          curl 'http://localhost:9200/your_index/_search?pretty'
          {
          "took" : 2,
          "timed_out" : false,
          "_shards" : {
          "total" : 5,
          "successful" : 5,
          "failed" : 0
          },
          "hits" : {
          "total" : 1,
          "max_score" : 1.0,
          "hits" : [
          {
          "_index" : "your_index",
          "_type" : "your_index",
          "_id" : "logstash-01.kvm.local",
          "_score" : 1.0,
          "_source" : {
          "@timestamp" : "2018-11-10T18:03:22.822Z",
          "host" : "logstash-01.kvm.local",
          "@version" : "1",
          "clock" : 558753,
          "type" : "your_index"
          }
          }
          ]
          }
          }


          Search API






          share|improve this answer























          • Hey Thanks for your thorough answer. Regarding the first section about manual checking through Kibana, I actually need a way to check through code. The latter suggestions through curl, what if there is more than one date field but I am using only one of them for index time field as only one is allowed?
            – Talal
            Nov 11 at 13:34











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241055%2fhow-to-identify-timefield-of-the-index%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          You can use Kibana to choose the right time field (Step 5):




          1. In Kibana, open Management, and then click Index Patterns.

          2. If this is your first index pattern, the Create index pattern page opens automatically. Otherwise, click Create index pattern in the upper left.

          3. Enter "your_index_name*" in the Index pattern field.

          4. Click Next step

          5. In Configure settings, select "@your_timestamp_field" in the Time Filter field name dropdown menu.

          6. Click Create index pattern.


          Kibana User Guide: Defining your index patterns



          Or search in your index mapping for an field with "type: date"



          curl 'http://localhost:9200/your_index/_mapping?pretty'
          {
          "your_index" : {
          "mappings" : {
          "your_index" : {
          "properties" : {
          "@**timestamp**" : {
          "type" : "date"
          },
          "@version" : {
          "type" : "text"
          },
          "clock" : {
          "type" : "long"
          },
          "host" : {
          "type" : "text"
          },
          "type" : {
          "type" : "text"
          }
          }
          }
          }
          }
          }


          Get Mapping



          Or look into your indexed documents:



          curl 'http://localhost:9200/your_index/_search?pretty'
          {
          "took" : 2,
          "timed_out" : false,
          "_shards" : {
          "total" : 5,
          "successful" : 5,
          "failed" : 0
          },
          "hits" : {
          "total" : 1,
          "max_score" : 1.0,
          "hits" : [
          {
          "_index" : "your_index",
          "_type" : "your_index",
          "_id" : "logstash-01.kvm.local",
          "_score" : 1.0,
          "_source" : {
          "@timestamp" : "2018-11-10T18:03:22.822Z",
          "host" : "logstash-01.kvm.local",
          "@version" : "1",
          "clock" : 558753,
          "type" : "your_index"
          }
          }
          ]
          }
          }


          Search API






          share|improve this answer























          • Hey Thanks for your thorough answer. Regarding the first section about manual checking through Kibana, I actually need a way to check through code. The latter suggestions through curl, what if there is more than one date field but I am using only one of them for index time field as only one is allowed?
            – Talal
            Nov 11 at 13:34















          up vote
          0
          down vote













          You can use Kibana to choose the right time field (Step 5):




          1. In Kibana, open Management, and then click Index Patterns.

          2. If this is your first index pattern, the Create index pattern page opens automatically. Otherwise, click Create index pattern in the upper left.

          3. Enter "your_index_name*" in the Index pattern field.

          4. Click Next step

          5. In Configure settings, select "@your_timestamp_field" in the Time Filter field name dropdown menu.

          6. Click Create index pattern.


          Kibana User Guide: Defining your index patterns



          Or search in your index mapping for an field with "type: date"



          curl 'http://localhost:9200/your_index/_mapping?pretty'
          {
          "your_index" : {
          "mappings" : {
          "your_index" : {
          "properties" : {
          "@**timestamp**" : {
          "type" : "date"
          },
          "@version" : {
          "type" : "text"
          },
          "clock" : {
          "type" : "long"
          },
          "host" : {
          "type" : "text"
          },
          "type" : {
          "type" : "text"
          }
          }
          }
          }
          }
          }


          Get Mapping



          Or look into your indexed documents:



          curl 'http://localhost:9200/your_index/_search?pretty'
          {
          "took" : 2,
          "timed_out" : false,
          "_shards" : {
          "total" : 5,
          "successful" : 5,
          "failed" : 0
          },
          "hits" : {
          "total" : 1,
          "max_score" : 1.0,
          "hits" : [
          {
          "_index" : "your_index",
          "_type" : "your_index",
          "_id" : "logstash-01.kvm.local",
          "_score" : 1.0,
          "_source" : {
          "@timestamp" : "2018-11-10T18:03:22.822Z",
          "host" : "logstash-01.kvm.local",
          "@version" : "1",
          "clock" : 558753,
          "type" : "your_index"
          }
          }
          ]
          }
          }


          Search API






          share|improve this answer























          • Hey Thanks for your thorough answer. Regarding the first section about manual checking through Kibana, I actually need a way to check through code. The latter suggestions through curl, what if there is more than one date field but I am using only one of them for index time field as only one is allowed?
            – Talal
            Nov 11 at 13:34













          up vote
          0
          down vote










          up vote
          0
          down vote









          You can use Kibana to choose the right time field (Step 5):




          1. In Kibana, open Management, and then click Index Patterns.

          2. If this is your first index pattern, the Create index pattern page opens automatically. Otherwise, click Create index pattern in the upper left.

          3. Enter "your_index_name*" in the Index pattern field.

          4. Click Next step

          5. In Configure settings, select "@your_timestamp_field" in the Time Filter field name dropdown menu.

          6. Click Create index pattern.


          Kibana User Guide: Defining your index patterns



          Or search in your index mapping for an field with "type: date"



          curl 'http://localhost:9200/your_index/_mapping?pretty'
          {
          "your_index" : {
          "mappings" : {
          "your_index" : {
          "properties" : {
          "@**timestamp**" : {
          "type" : "date"
          },
          "@version" : {
          "type" : "text"
          },
          "clock" : {
          "type" : "long"
          },
          "host" : {
          "type" : "text"
          },
          "type" : {
          "type" : "text"
          }
          }
          }
          }
          }
          }


          Get Mapping



          Or look into your indexed documents:



          curl 'http://localhost:9200/your_index/_search?pretty'
          {
          "took" : 2,
          "timed_out" : false,
          "_shards" : {
          "total" : 5,
          "successful" : 5,
          "failed" : 0
          },
          "hits" : {
          "total" : 1,
          "max_score" : 1.0,
          "hits" : [
          {
          "_index" : "your_index",
          "_type" : "your_index",
          "_id" : "logstash-01.kvm.local",
          "_score" : 1.0,
          "_source" : {
          "@timestamp" : "2018-11-10T18:03:22.822Z",
          "host" : "logstash-01.kvm.local",
          "@version" : "1",
          "clock" : 558753,
          "type" : "your_index"
          }
          }
          ]
          }
          }


          Search API






          share|improve this answer














          You can use Kibana to choose the right time field (Step 5):




          1. In Kibana, open Management, and then click Index Patterns.

          2. If this is your first index pattern, the Create index pattern page opens automatically. Otherwise, click Create index pattern in the upper left.

          3. Enter "your_index_name*" in the Index pattern field.

          4. Click Next step

          5. In Configure settings, select "@your_timestamp_field" in the Time Filter field name dropdown menu.

          6. Click Create index pattern.


          Kibana User Guide: Defining your index patterns



          Or search in your index mapping for an field with "type: date"



          curl 'http://localhost:9200/your_index/_mapping?pretty'
          {
          "your_index" : {
          "mappings" : {
          "your_index" : {
          "properties" : {
          "@**timestamp**" : {
          "type" : "date"
          },
          "@version" : {
          "type" : "text"
          },
          "clock" : {
          "type" : "long"
          },
          "host" : {
          "type" : "text"
          },
          "type" : {
          "type" : "text"
          }
          }
          }
          }
          }
          }


          Get Mapping



          Or look into your indexed documents:



          curl 'http://localhost:9200/your_index/_search?pretty'
          {
          "took" : 2,
          "timed_out" : false,
          "_shards" : {
          "total" : 5,
          "successful" : 5,
          "failed" : 0
          },
          "hits" : {
          "total" : 1,
          "max_score" : 1.0,
          "hits" : [
          {
          "_index" : "your_index",
          "_type" : "your_index",
          "_id" : "logstash-01.kvm.local",
          "_score" : 1.0,
          "_source" : {
          "@timestamp" : "2018-11-10T18:03:22.822Z",
          "host" : "logstash-01.kvm.local",
          "@version" : "1",
          "clock" : 558753,
          "type" : "your_index"
          }
          }
          ]
          }
          }


          Search API







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 10 at 19:23

























          answered Nov 10 at 17:43









          jabla

          12




          12












          • Hey Thanks for your thorough answer. Regarding the first section about manual checking through Kibana, I actually need a way to check through code. The latter suggestions through curl, what if there is more than one date field but I am using only one of them for index time field as only one is allowed?
            – Talal
            Nov 11 at 13:34


















          • Hey Thanks for your thorough answer. Regarding the first section about manual checking through Kibana, I actually need a way to check through code. The latter suggestions through curl, what if there is more than one date field but I am using only one of them for index time field as only one is allowed?
            – Talal
            Nov 11 at 13:34
















          Hey Thanks for your thorough answer. Regarding the first section about manual checking through Kibana, I actually need a way to check through code. The latter suggestions through curl, what if there is more than one date field but I am using only one of them for index time field as only one is allowed?
          – Talal
          Nov 11 at 13:34




          Hey Thanks for your thorough answer. Regarding the first section about manual checking through Kibana, I actually need a way to check through code. The latter suggestions through curl, what if there is more than one date field but I am using only one of them for index time field as only one is allowed?
          – Talal
          Nov 11 at 13:34


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241055%2fhow-to-identify-timefield-of-the-index%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Florida Star v. B. J. F.

          Error while running script in elastic search , gateway timeout

          Adding quotations to stringified JSON object values