<div dir="ltr"><div>In such cases, you need to use the "Dynamic pollsters operations" to process the sample, and retrieve the key as "rgw.main.size". By default, this value ("rgw.main.size") is interpreted as a nested dictionary. I mean, an object with a key "rgw", and then, another one that has a key "main", where there is a dict, with a key "size".</div><div><br></div><div>To handle such cases, you would need something similar to: `value_attribute: "usage || value['rgw.main'] | value['size']"`. However, that might not address all use cases. You will also need to handle situations when there is no key "rgw.main" in the response samples.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 12, 2022 at 12:17 PM Taltavull Jean-François <<a href="mailto:jean-francois.taltavull@elca.ch">jean-francois.taltavull@elca.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Rafael,<br>
<br>
To get the the size, in GB, occupied by buckets I need to manipulate a JSON key which contains a dot in its name:<br>
<br>
````<br>
- name: "radosgw.containers.objects.size"<br>
  sample_type: "gauge"<br>
  unit: "B"<br>
  value_attribute: "rgw.main.size"  <------------------------------------"rgw.main" is a JSON key, with a dot in its name, which belongs to "bucket.usage" JSON container <br>
  url_path: "<a href="http://FQDN/admin/bucket?stats=True" rel="noreferrer" target="_blank">http://FQDN/admin/bucket?stats=True</a>"<br>
  module: "awsauth"<br>
  authentication_object: "S3Auth"<br>
  authentication_parameters: my_access_key,my_secret_key,FQDN<br>
  user_id_attribute: "owner"<br>
  project_id_attribute: "tenant"<br>
  resource_id_attribute: "id"<br>
  response_entries_key: "usage"<br>
````<br>
<br>
But with this dynamic pollster definition, I get the python error "KeyError: 'rgw' ".<br>
<br>
In this case, is there a specific syntax to define "value_attribute" or am I doing something the wrong way ?<br>
<br>
<br>
Jean-Francois<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Rafael Weingärtner</div></div>