Warunika Ranaweera
Warunika Ranaweera

Reputation: 11

ElasticSearch Date Math Relative to Yesterday

I'm looking for a way to get the data for 7 weeks before yesterday. This is what I'm using to get data for 7 weeks from today.

"range" : {
       "gt" : "now-7w/w",
       "lt" : "now"
    }
}

I tried something along the lines of:

"range" : {
       "gt" : "now-7w/w-1d",
       "lt" : "now"
    }
}

but it doesn't seem to output the correct results.

Anyone knows the correct syntax? The Elastic documentation is not very helpful in this case.

Upvotes: 1

Views: 730

Answers (1)

jclyons52
jclyons52

Reputation: 316

For anyone looking at this you probably want the date math documentation

Upvotes: 1

Related Questions