# Unable to search with timestamp

**URL:** <https://discuss.elastic.co/t/unable-to-search-with-timestamp/143139>\
**Category:** Logstash\
**Created:** [August 6, 2018, 10:28am UTC](https://discuss.elastic.co/t/unable-to-search-with-timestamp/143139 "2018-08-06T10:28:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vijay\_Chander](https://avatars.discourse-cdn.com/v4/letter/v/edb3f5/32.png) [@Vijay\_Chander](https://discuss.elastic.co/u/Vijay_Chander)\
**Post date:** [August 6, 2018, 10:28am UTC](https://discuss.elastic.co/t/unable-to-search-with-timestamp/143139/1 "2018-08-06T10:28:37Z")

</div>

I've created an index with two doc types(sas\_logs & pid\_logs) of different formats.

The logstash config file is

> input {  
> file {  
> path =\> "E:/ElasticSearchWork/pid\_logs/_.log"  
> type =\> "pid\_logs"  
> start\_position =\> "beginning"  
> sincedb\_path =\> "/dev/null"  
> }  
> file {  
> path =\> "E:/ElasticSearchWork/sas\_logs/_.log"  
> type =\> "sas\_logs"  
> start\_position =\> "beginning"  
> sincedb\_path =\> "/dev/null"  
> }  
> }
> 
> filter {
> 
> if [type] == "pid\_logs" {   
> grok {  
> match =\> { "message" =\> "pid: (?\d+) mem: (?\d+) cpu: (?\d+)" }   
> }  
> }
> 
> if [type] == "sas\_logs" {  
> grok {  
> match =\> { "message" =\> "%{LOGLEVEL:loglevel}\s+[%{NUMBER:num}]\s+:%{USERNAME:user}\s+-\s+%{GREEDYDATA:msg}" }  
> }  
> }  
> }
> 
> output {  
> elasticsearch {  
> hosts =\> "[http://localhost:9200](http://localhost:9200)"  
> index =\> "com\_index"  
> }  
> stdout {  
> codec =\> rubydebug  
> }  
> }

The log formats are

sas\_logs: **INFO [00000006] :sasdemo - NOTE: Copyright (c) 2016 by SAS Institute Inc., Cary, NC, USA.**

pid\_logs: **pid: 2178 cpu: 0.2 mem: 0.3**

I'm trying to search in the kibana with the timestamp as I need to map/get the data from both the logs at particular timestamp.

In Kibana

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/3/b3bf72fa5f3428ca978810955a79bf8ef84265c9.png)

Can anyone please help me in this.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 6, 2018, 12:17pm UTC](https://discuss.elastic.co/t/unable-to-search-with-timestamp/143139/2 "2018-08-06T12:17:21Z")

</div>

Have you tried removing the space after `@timestamp:`?

---

<div class="post-metadata">

**Author:** ![Vijay\_Chander](https://avatars.discourse-cdn.com/v4/letter/v/edb3f5/32.png) [@Vijay\_Chander](https://discuss.elastic.co/u/Vijay_Chander)\
**Post date:** [August 6, 2018, 12:19pm UTC](https://discuss.elastic.co/t/unable-to-search-with-timestamp/143139/3 "2018-08-06T12:19:52Z")

</div>

Yes, Even I've tried to search one exact timestamp value, still its returns empty.

I'm working on this from last two days but no luck.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 6, 2018, 1:23pm UTC](https://discuss.elastic.co/t/unable-to-search-with-timestamp/143139/4 "2018-08-06T13:23:18Z")

</div>

Maybe it's the colons that's throwing the query parser off. Trying double-quoting the value, i.e. `@timestamp:"2018-08-03T...."`.

(I've never had the need to search for documents matching an exact timestamp.)

---

<div class="post-metadata">

**Author:** ![Vijay\_Chander](https://avatars.discourse-cdn.com/v4/letter/v/edb3f5/32.png) [@Vijay\_Chander](https://discuss.elastic.co/u/Vijay_Chander)\
**Post date:** [August 6, 2018, 2:01pm UTC](https://discuss.elastic.co/t/unable-to-search-with-timestamp/143139/5 "2018-08-06T14:01:44Z")

</div>

Magnus you're an angel It worked. I've tried the same before but forgot the '@' before timestamp variable as the logs also have a timestamp(custom) variable.

---

<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:** [September 3, 2018, 2:01pm UTC](https://discuss.elastic.co/t/unable-to-search-with-timestamp/143139/6 "2018-09-03T14:01:45Z")

</div>

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