How do you get Hit counts from elasticsearch

i need hit count of every 15 minutes interval for last 7 days. I do know there is curl api to get hit counts and you have to specify start and end time but using that methods i will have to make one request per 15 min interval hit count and it is not efficient at all. is there any other way which i get hit count for every 15 minutes interval for last 7 days in one or two curl requests? I need to do that repeatedly every day.

below is the image of what i mean by hit count. i need that value for every 15 minutes for last 7 days.
36%20PM

Below is the code which I am using to get hit count but i have to one request for every 15 minutes of data using sdate and edate. is there any elegant way to doing things? like making single request to get all the data?

{
'size': 0,
'query': {
'bool': {
'must': [
{ 'match_all': {} },
{ 'match_all': {} },
{ 'range': {
'@timestamp': {
'gte': sdate,
'lte': edate,
'format':
'epoch_second'
}
}
} ]
}
}
}

I would look at date histogram aggregation.

Hi VietCong,
Thank you very much for your response. I will surely look into date histogram aggregation.

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