Kibana - Average Count per Unique Field
<p>I have a field, CRAB_Workflow, and I want to split the records over this field and count how many have a given value.</p>

<p>For example, CRAB_Workflow may have the following counts and values (I made up the counts so life is easy!),</p>

<pre><code>CNT  STR
1    160325_174007:jalimena_crab_HLTPhysics_HaloStudy
2    160325_185554:afiqaize_crab_qcd15
3    160325_190029:afiqaize_crab_qcd80-0
4    160325_190434:afiqaize_crab_z1ll-1
1    160325_190806:afiqaize_crab_qcd50-0
2    160325_214052:alebihan_crab_TTplusJets_madgraph_signal
3    160326_105703:rdewanje_crab_ggH160_NTupleOnly
4    160327_144729:lecriste_crab_official_MC_noPtEtaCuts_nMCB0
1    160327_153516:cgalloni_crab_Trigger_HLTPhysics4_v3_Prescale
2    160328_161746:afiqaize_crab_qcd15
3    160328_161932:afiqaize_crab_qcd30-1
4    160328_162639:afiqaize_crab_z1ll-1
</code></pre>

<p>I want to count all the records that have one of those given value. Then average that count over all CRAB_Workflow values.</p>

<p>The numbers I would be looking for is (average and variance)</p>

<p>avg = 3*(1 + 2 + 3 + 4)/12 = 2.5</p>

<p>var = ...</p>