{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/kapacitor/issues/1064","repository_url":"https://api.github.com/repos/influxdata/kapacitor","labels_url":"https://api.github.com/repos/influxdata/kapacitor/issues/1064/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/kapacitor/issues/1064/comments","events_url":"https://api.github.com/repos/influxdata/kapacitor/issues/1064/events","html_url":"https://github.com/influxdata/kapacitor/issues/1064","id":192215887,"number":1064,"title":"Issue with outliners","user":{"login":"gkpraveen1988","id":6847782,"avatar_url":"https://avatars.githubusercontent.com/u/6847782?v=3","gravatar_id":"","url":"https://api.github.com/users/gkpraveen1988","html_url":"https://github.com/gkpraveen1988","followers_url":"https://api.github.com/users/gkpraveen1988/followers","following_url":"https://api.github.com/users/gkpraveen1988/following{/other_user}","gists_url":"https://api.github.com/users/gkpraveen1988/gists{/gist_id}","starred_url":"https://api.github.com/users/gkpraveen1988/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkpraveen1988/subscriptions","organizations_url":"https://api.github.com/users/gkpraveen1988/orgs","repos_url":"https://api.github.com/users/gkpraveen1988/repos","events_url":"https://api.github.com/users/gkpraveen1988/events{/privacy}","received_events_url":"https://api.github.com/users/gkpraveen1988/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-29T08:19:59Z","updated_at":"2016-12-01T11:03:24Z","closed_at":null,"body":"Hi Team, \r\n\r\nFacing issues while importing the outliners py file in to the tick scripts. Trying to find out the standard deviation in a series. \r\nClone the repository \"https://github.com/influxdata/kapacitor/tree/master/udf/agent/examples/outliers\" and got the outliers.py file. \r\nWith that, have made the modifications in kapacitor.conf file. \r\n\r\n[udf.functions.outliers]\r\n     prog = \"/usr/bin/python\"\r\n     args = [\"-u\", \"/tmp/kapacitor_udf/kapacitor/udf/agent/examples/outliers/outliers.py\"]\r\n     timeout = \"10s\"\r\n\r\nWrote a tick script to use that outliner scripts and perform some tasks. \r\n\r\nbatch\r\n        |query('''\r\n                SELECT value\r\n                FROM \"testdata\".\"autogen\".\"drive_info\"\r\n        ''')\r\n                .period(1m)\r\n                .every(10s)\r\n        @outliers()\r\n                .field('value')\r\n        |alert()\r\n                .crit(lambda: \"value\" > 0.0 )\r\n                .StateChangesOnly()\r\n                .log('/var/tmp/kapacitor/outline.log')\r\n\r\nThe kapacitor definition and enabling went fine without any issues. \r\n\r\nwhen the query is executed and getting the error in the logs and not alerting in the log files. \r\n\r\n[task_master:main] 2016/11/29 13:48:38 I! closed\r\n[run] 2016/11/29 13:48:38 E! open server: open service *udf.Service: failed to load process info for \"outliers\": write error: write |1: broken pipe\r\n[run] 2016/11/29 13:48:39 I! Kapacitor starting, version 1.0.2, branch master, commit 1011dba109bf3d83366c87873ec285c7f9140d34\r\n[run] 2016/11/29 13:48:39 I! Go version go1.6.3\r\n[srv] 2016/11/29 13:48:39 I! Kapacitor hostname: 10.0.0.22\r\n[srv] 2016/11/29 13:48:39 I! ClusterID: 4516c272-fd1e-4244-a2fc-ce95b8383e39 ServerID: be981e65-35a6-42c5-8fd7-80ac94c02c3d\r\n[task_master:main] 2016/11/29 13:48:39 I! opened\r\n[srv] 2016/11/29 13:48:39 D! opening service: *udf.Service\r\n[udf] 2016/11/29 13:48:39 I!P Traceback (most recent call last):\r\n[udf] 2016/11/29 13:48:39 I!P   File \"/tmp/kapacitor_udf/kapacitor/udf/agent/examples/outliers/outliers.py\", line 3, in <module>\r\n[udf] 2016/11/29 13:48:39 I!P     from kapacitor.udf.agent import Agent, Handler\r\n[udf] 2016/11/29 13:48:39 I!P   File \"build/bdist.linux-x86_64/egg/kapacitor/udf/agent.py\", line 7, in <module>\r\n[udf] 2016/11/29 13:48:39 I!P   File \"build/bdist.linux-x86_64/egg/kapacitor/udf/udf_pb2.py\", line 6, in <module>\r\n[udf] 2016/11/29 13:48:39 I!P ImportError: cannot import name enum_type_wrapper\r\n\r\n\r\nnot sure how to resolve this issues. Please do suggest me with an solution. Thanks. \r\n"},"comment":{"url":"https://api.github.com/repos/influxdata/kapacitor/issues/comments/264143182","html_url":"https://github.com/influxdata/kapacitor/issues/1064#issuecomment-264143182","issue_url":"https://api.github.com/repos/influxdata/kapacitor/issues/1064","id":264143182,"user":{"login":"gkpraveen1988","id":6847782,"avatar_url":"https://avatars.githubusercontent.com/u/6847782?v=3","gravatar_id":"","url":"https://api.github.com/users/gkpraveen1988","html_url":"https://github.com/gkpraveen1988","followers_url":"https://api.github.com/users/gkpraveen1988/followers","following_url":"https://api.github.com/users/gkpraveen1988/following{/other_user}","gists_url":"https://api.github.com/users/gkpraveen1988/gists{/gist_id}","starred_url":"https://api.github.com/users/gkpraveen1988/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkpraveen1988/subscriptions","organizations_url":"https://api.github.com/users/gkpraveen1988/orgs","repos_url":"https://api.github.com/users/gkpraveen1988/repos","events_url":"https://api.github.com/users/gkpraveen1988/events{/privacy}","received_events_url":"https://api.github.com/users/gkpraveen1988/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T11:03:24Z","updated_at":"2016-12-01T11:03:24Z","body":"Hi Nathanielc, Thanks for your input and I was able to fix the issues. Now the outlier script is getting executed explicitly and able to see the process. \r\n\r\nThere is an another issue I am facing. I wrote the tick scripts as below to check the std deviation of last 30 points which I have in the test influxdb. \r\n\r\nbatch\r\n    |query('''\r\n     SELECT value\r\n     FROM \"testdata\".\"autogen\".\"drive_info\"\r\n     ''')\r\n     .period(1d)\r\n     .every(10s)\r\n    @outlierAvg()\r\n     .field('value')\r\n    |alert()\r\n     .crit(lambda: \"value\" > 0.0 )\r\n     .StateChangesOnly()\r\n     .log('/var/tmp/kapacitor/outline.log')\r\n\r\n\r\nIn the above I able to call the method field. The OutlierAvg is able to execute the method in the py script. But post execution the value has to stored to another variable. which should be \r\n\r\n@outliersAvg()\r\n.field('value')\r\n.size(30)\r\n.as('mavg')\r\n\r\nBut when I modify as above, the script is throwing the below error\r\ninvalid TICKscript: line 10 char 7: no method or property \"as\" on *pipeline.UDFNode\r\n\r\nand I am unable to see any logs on to the file \"var/tmp/kapacitor/outline.log\". \r\n\r\nAll I need to do is store the output of .outliersAvg to a variable and check that variable in .Alert() section. \r\nCould you please help in resolving the issue. \r\n\r\nThanks\r\n\r\n"}}
{"actor":{"display_login":"gkpraveen1988"}}