Static Pie Chart

Hi,
I am using KIBANA 7.8.0 :

  • Index type : app-YYYY-MM-DD which means an index is created every day
  • Visualization : Pie Chart
  • Data from a CSV files with logstash example :
    TIMESTAMP;APP1;PASSED;5.6
    TIMESTAMP;APP2;PASSED;3.8
    TIMESTAMP;APP3;FAILED;0
    I created a pie chart that has query DSL between : 7h00 and 07h10
{
  "range": {
    "@timestamp": {
      "gte": "now/d+7h",
      "lt": "now/d+7h+10m"
    }
  }
}

in dashboard section, i used default query of : TODAY to make this works fine
Unfortunately, by adding a new pie chart which display YESTERDAY same range of time, this is not working!

{
  "range": {
    "@timestamp": {
      "gte": "now/d-1d+7h",
      "lt": "now/d-1d+7h+10m"
    }
  }
}

Any idea please .....why this is working for the first TODAY chart and not for YESTERDAY chart !!!

Hello @Hannah_J_Swystun , welcome to the community!!

Could you please execute the query via Dev Tools & confirm if you are able to see records for below query :

{
"range": {
"@timestamp": {
"gte": "now/d-1d+7h",
"lt": "now/d-1d+7h+10m"
}
}
}

Thanks!!

Hello,

I changed it a little bit by adding :
query {
}

Yes it works in dev tools, but in dashboard, it does not works for last 24h == yesterday, however, same query of today is working...
Today : now/d+7h -> now/d+7h10m + default query : TODAY in dashboard is working

Problem is with LAST 24h, it is very weird ....do you have any idea please ?

This is a screen of TODAY which works fine, i think may be the problem is from index naming such as : index-YYYYMMDD ?

Thank you for sharing the details.

But while creating the PieChart are you selecting an specific index name or it is an index pattern?

if it is an index name then you need to select index pattern as in the DevTools also the Indexpattern used is /app-selenium-*/

Thanks!!

I am selecting index-pattern which means my-index-*
I would like to display only DATA of yesterday from 7h00 to 7h10 so i used this query dsl :
now/d-1d+7h to now/d-1d+7h+10m
this range works in dev_tools but not in query dsl ?
that's why i though about index-YYYYMMDD which is different every day...
please help to make my pie chart static in dashboard and not changed by date range....

May be i should separate static dashboard and dynamic dashboard ?

1 Like

Hello,

I was able to create a static lens.

Found below solution :

  1. Created a index pattern from current index source & did not select timestamp as the field. So in discover you will only see raw data.

  1. Once this is done , i go ahead a created a lens from this Index pattern

  2. Now when adding this lens on dashboard the data remains statics irrespective of the global date picker

Please check.

Thanks

1 Like

I don't know how to thank you,
Thank youuuuuuuuuuuuuuuuuuuuuu so much, it saved my life.
did not know we can hack index-pattern with names such as :
my-index-*
my-index-**
my-index-*** (may be a third alias is : NO use ^^ ) ! who knows ?

Thank you so much <3

1 Like

Good to know that the hack worked :slight_smile:

my-index-* (Dynamique Date Range)
my-index-** (Static Date Range)
my-index-*** (what kind of third option could it be ) ?

*** might be for more custom use but anyhow that will not be needed as already we have an index created with & without timestamp.

1 Like