If I understand what you're looking for correctly, I just responded to a user with something similar.
  
  
    It's possible to do this with the Time Series Visual Builder 
I have used the following data to test against: 
POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 1,
  "somme": 1
}
POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 1,
  "somme": 1
}
POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 1,
  "somme": 1
}
POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 0,
 …
   
 
With the Time Series Visual Builder, you can use the Filter Ratio to create a visualization to show the percentage or count of online/offline devices.