Ask Your Question

How to use filtering queries in Ceilometer via CLI?

asked 2014-05-01 04:00:19 -0500

anonymous user


updated 2014-05-02 15:44:30 -0500

smaffulli gravatar image

Hi, all. I'm testing Icehouse Ceilometer on Ubuntu 12.04.

And I've noticed that ceilometer has fancy capability "filtering queries".
I tried "ceilometer query-samples" , but I couldn't find how to use it. All the documentation I found was API, and CLI's help was rather difficult for me :(

  -f <FILTER>, --filter <FILTER>
                        {complex_op: [{simple_op: {field_name: value}}]} The
                        complex_op is one of: ['and', 'or'], simple_op is one
                        of: ['=', '!=', '<', '<=', '>', '>='].
  -o <ORDERBY>, --orderby <ORDERBY>
                        [{field_name: direction}, {field_name: direction}] The
                        direction is one of: ['asc', 'desc'].
  -l <LIMIT>, --limit <LIMIT>
                        Maximum number of samples to return.

I tried following command blindly but no luck.

ceilometer query-samples -f {"=": {"resource_id": "fad14a5e-3533-4e62-819b-9ba8228290e5"}} 
ceilometer query-samples -f {'AND': [{'=': {"counter_name": "cpu_util"}}, {"<", {"counter_volume": "40"} }] }
ceilometer query-samples -f "cpu_util < 40%"

Does anybody successfully used filtered query from ceilometer CLI and kindly show me how to use it?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-09-23 17:03:22 -0500

magesh-gv gravatar image

updated 2014-09-23 17:03:48 -0500

To get all the samples for CPU utilization: ceilometer query-samples -f '{"=": {"counter_name":"cpu_util"}}'

To filter it out: ceilometer -d query-samples -f '{"and": [{"=": {"counter_name":"cpu_util"}}, {">": {"counter_volume": 2.00}}, {"<": {"counter_volume": 8.00}}] }'

Source: Ceilometer Wiki

edit flag offensive delete link more


Thanks for an answer!
And I'm sorry for my late action.

t.goto gravatar imaget.goto ( 2014-10-22 03:11:03 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-05-01 04:00:19 -0500

Seen: 1,369 times

Last updated: Sep 23 '14