{"action":"created","issue":{"url":"https://api.github.com/repos/jmxtrans/jmxtrans/issues/408","labels_url":"https://api.github.com/repos/jmxtrans/jmxtrans/issues/408/labels{/name}","comments_url":"https://api.github.com/repos/jmxtrans/jmxtrans/issues/408/comments","events_url":"https://api.github.com/repos/jmxtrans/jmxtrans/issues/408/events","html_url":"https://github.com/jmxtrans/jmxtrans/issues/408","id":127550499,"number":408,"title":"Question about KeyOutWriter","user":{"login":"Wildpipe","id":16786312,"avatar_url":"https://avatars.githubusercontent.com/u/16786312?v=3","gravatar_id":"","url":"https://api.github.com/users/Wildpipe","html_url":"https://github.com/Wildpipe","followers_url":"https://api.github.com/users/Wildpipe/followers","following_url":"https://api.github.com/users/Wildpipe/following{/other_user}","gists_url":"https://api.github.com/users/Wildpipe/gists{/gist_id}","starred_url":"https://api.github.com/users/Wildpipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wildpipe/subscriptions","organizations_url":"https://api.github.com/users/Wildpipe/orgs","repos_url":"https://api.github.com/users/Wildpipe/repos","events_url":"https://api.github.com/users/Wildpipe/events{/privacy}","received_events_url":"https://api.github.com/users/Wildpipe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-19T22:08:54Z","updated_at":"2016-01-20T07:47:42Z","closed_at":null,"body":"Hi,\r\n\r\nI am using jmxtrans to collect information about Queues and other things from Jboss A-MQ. I am currently using the KeyOutWriter to write information gathered to a csv file on disk. It is working great except for not being able to query the A-MQ application about the name of a Queue. I can query the application about almost anything as long as the answer to a query is not a string.\r\n\r\nNow I am no expert in Java but I think I might have spotted why this is and am wondering if you could help me figure out a solution to this. In the file KeyOutWriter.java on line 139 to 143 I found the following code:\r\n\r\nif (NumberUtils.isNumeric(values.getValue())) {\r\n\r\nlogger.info(KeyUtils.getKeyString(server, query, result, values, typeNames, null) + delimiter\r\n+ values.getValue().toString() + delimiter + result.getEpoch());\r\n}\r\n\r\nTo my understanding this code will make sure that the value I recieve is a numeric and not a string. Would removing this numeric check break anything in the keyoutwriter? Please correct me if I am wrong about this theory.\r\n\r\nWhat I want to achieve is to use the keyoutwriter and query my application for the name of a specific queue and write it to a file."},"comment":{"url":"https://api.github.com/repos/jmxtrans/jmxtrans/issues/comments/173120828","html_url":"https://github.com/jmxtrans/jmxtrans/issues/408#issuecomment-173120828","issue_url":"https://api.github.com/repos/jmxtrans/jmxtrans/issues/408","id":173120828,"user":{"login":"Wildpipe","id":16786312,"avatar_url":"https://avatars.githubusercontent.com/u/16786312?v=3","gravatar_id":"","url":"https://api.github.com/users/Wildpipe","html_url":"https://github.com/Wildpipe","followers_url":"https://api.github.com/users/Wildpipe/followers","following_url":"https://api.github.com/users/Wildpipe/following{/other_user}","gists_url":"https://api.github.com/users/Wildpipe/gists{/gist_id}","starred_url":"https://api.github.com/users/Wildpipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wildpipe/subscriptions","organizations_url":"https://api.github.com/users/Wildpipe/orgs","repos_url":"https://api.github.com/users/Wildpipe/repos","events_url":"https://api.github.com/users/Wildpipe/events{/privacy}","received_events_url":"https://api.github.com/users/Wildpipe/received_events","type":"User","site_admin":false},"created_at":"2016-01-20T07:47:42Z","updated_at":"2016-01-20T07:47:42Z","body":"I have a few hundred queues in A-MQ and query the application with these attributes:\r\n\r\n\"obj\" : \"org.apache.activemq:type=Broker,brokerName=*,*\",\r\n\"attr\" : [ \"ProducerCount\", \"ConsumerCount\", \"QueueSize\", \"DequeueCount\", \"EnqueueCount\", \"Name\" ]\r\n\r\nThis data is not very useful if I am not able to retrieve the name to which the metric belong. I will just end up with a file containing thousands of useless datapoints. \r\n\r\nI have tried to solve this by trying different writers and using the stdoutwriter I am able to use the exact same query and recieve the name of the queue. I also tried the jmxtrans-agent which gave me the possiblity of using resultAlias and rewrite the result based on object names:\r\n\r\nresultAlias=\"activemq.%brokerName%.queue.%destinationName%.QueueSize\"\r\n\r\nBut the jmxtrans-agent will only connect to local pids which is deal-breaker for me.\r\n\r\nA possible solution could be to make use of resultAlias but I couldn't find any documentation that jmxtrans supports the use of variables like the jmxtrans-agent. \r\n\r\nI'll take a look at the Sif4JoutPutWriter, thanks."}}