Visualize 2 values evolution (sum) with a Pie chart

Hello !

I'm kind of a beginner in creating Kibana visualizations, and I'm actually facing this issue :

  • I have a lot of logs, and some are containing the following fields "inSuccess" (eg. 2), "inError" (eg. 1), which are numbers, corresponding to a specific calculation result return. Previously, I have a message with a field "totalExpected" which gave me the total amount of expected calculations (eg. 5, in this example we are still waiting 2 calculations).

  • I want to display a Pie Chart using these metrics for something that I believe might be quite easy. First of all, I want it blue and corresponding to the cumulative value of every "totalExpected". Then, I want to have this blue to be "overprinted" by green then red, according to the cumulatives calculation successes, then fails.
    So it should be three-colored (or two-colored, if every calculations results have been sent, in this case all blue should be overprinted by green and / or red).

Do you know if it is possible ? I'm trying to configure my Pie chart for days, but I just cannot succeed to get what I want (not even close ...), so maybe it's impossible ... If so, can you please tell me how should I design my messages to display this ?

Thank you very much for your time ! :slight_smile:

Hi, welcome to the forums! If I understand your description, you have logs that are structured like this:

{ timestamp: 2021-01-01, totalExpected: 5, jobId: 1 }
{ timestamp: 2021-01-02, inSuccess: 2, inError: 1, jobId: 1 }
{ timestamp: 2021-01-02, inSuccess: 3, inError: 2, jobId: 1 }

Where you are tracking the change in status over time. There are two major reasons that your problem is hard in Kibana:

  1. You are trying to correlate something from one document to a later document. You can't do this in a single query, and Kibana is fundamentally a single-query system. To fix this, you need to change the way your data is stored so that all the related info is stored together.

  2. The pie chart visualization in Kibana is one of the least powerful tools we offer, and does not support any kind of dynamic coloring.

The first problem is your most critical. You do need to change your data so that you can store all the related data in one document. Most likely, you should do this as a separate index that contains the output data. For the documents I listed above, here is the only output I think you need:

{
  latestTimestamp: 2021-01-02
  totalExpected: 5
  completed: 3
  errorCount: 2
  jobId: 1
}

This is called an entity-centric index, and is a very common pattern. We offer a tool to set up background jobs that do this automatically:

1 Like

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