Also, as per the document, Tags are always preserved regardless how keep is used
But, my TICK script is writing only 2 columns in the new measurement, i.e time & tablespace_used only. In the table Oracle_Intellix_TableSpace from where I’m querying the data has few tags fields like hostname, instance & table names , and I want those details to write back to new measurements when the tablespace_used computed is > 0.6 [cid:[email protected]] From: Hallur, Jayanna(CONT) Sent: Monday, November 14, 2016 11:54 AM To: '[email protected]' <[email protected]>; InfluxData <[email protected]> Subject: RE: Kapacitor: TICK script ignores condition & alerting everytime Hi Nathan Appreciated your quick response. I want to alert & write the filtered data back into InfluxDB on new measurement for all entried where tablespace_used > 0.6 meet . As per your response, do you think I can add the condition as mentioned below? How can we do if we need to alert based on multiple field values? Like where field1 > 0.2 AND ServerName=cap1* AND SOURCE=AWS-EAST ..etc? Can I have multiple where condition one below the other one? var tablespace_errors = batch |query(''' SELECT * FROM "comm_qa"."default"."Oracle_Intellix_TableSpace" ''') .period(20m) .every(10m) tablespace_errors |eval(lambda: "USED_MB" / "TOTAL_MB") .as('tablespace_used') |where(lambda: "tablespace_used" > 0.6) |alert() .crit(lambda: "tablespace_used" > 0.6) // Whenever we get an alert write it to a file. .log('/tmp/batch_alerts.log') |influxDBOut() .cluster('emmo_relays') .database('comm_qa') .measurement('Oracle_Intellix_TableSpace_Alerts') From: [email protected]<mailto:[email protected]> [mailto:[email protected]] Sent: Monday, November 14, 2016 11:11 AM To: InfluxData <[email protected]<mailto:[email protected]>> Cc: Hallur, Jayanna(CONT) <[email protected]<mailto:[email protected]>> Subject: Re: Kapacitor: TICK script ignores condition & alerting everytime Based on your description it looks like you only want to filter the source data, not necessarily trigger alerts from that data. Is that correct? If it is I would recommend using the `|where(lambda: "tablespace_used" > 0.6)` node instead of the alert node. If you do want to track alerts based on the data, then it seems like maybe you want to ignore the `OK` recovery alerts it is sending, since those alerts will have a value below the threshold. In that case add a `.noRecoveries()` to the alert node to instruct it to not send recovery events. For #2 see https://docs.influxdata.com/kapacitor/v1.1/nodes/eval_node/#keep On Monday, November 14, 2016 at 8:55:47 AM UTC-7, Hallur, Jayanna(CONT) wrote: Hi All I have posted this question here and someone recommended to send the email to this email address. Here is simple code which simple condition. But the Kapacitor is ignoring the condition and write the alert info to file & influxDB everytime irrespective of condition matched or not. Please do the needful. https://github.com/influxdata/docs.influxdata.com/issues/875 I have written the TICK script to query the data from InfluxDB, calculate tablespace_used and I want to write back to InfluxDB if the tablespace_used is > 0.6 in this example. The below TICK is able to query the data and write the data back to InfluxDB successfully. However, it is writing the entry into Database (Oracle_Intellix_TableSpace_Alerts meansurement) and to /tmp/batch_alerts.log even if the value of tablespace used is less than 0.6. I do see the entries in the DB and also in File /tmp/batch_alerts.log with tablespace_used value as 0.02, 0.5, 0.8, 0.9..etc. 1. Why the script is writing the entries for the tablespace_used values less than 0.6??? 2. How to pass USED_MB, TOTAL_MB and other parameters of Oracle_Intellix_TableSpace measurement like serverName back into InfluxDB measurement created for alert (i.e Oracle_Intellix_TableSpace_Alerts)? var tablespace_errors = batch |query(''' SELECT * FROM "comm_qa"."default"."Oracle_Intellix_TableSpace" ''') .period(15m) .every(10m) tablespace_errors |eval(lambda: "USED_MB" / "TOTAL_MB") .as('tablespace_used') |alert() .crit(lambda: "tablespace_used" > 0.6) // Whenever we get an alert write it to a file. .log('/tmp/batch_alerts.log') |influxDBOut() .cluster('emmo_relays') .database('comm_qa') .measurement('Oracle_Intellix_TableSpace_Alerts') ==== Kapacitor 1.1 InfluxDB 1.0 Best Regards Jayanna ________________________________ The information contained in this e-mail is confidential and/or proprietary to Capital One and/or its affiliates and may only be used solely in performance of work or services for Capital One. The information transmitted herewith is intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer. ________________________________________________________ The information contained in this e-mail is confidential and/or proprietary to Capital One and/or its affiliates and may only be used solely in performance of work or services for Capital One. The information transmitted herewith is intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer. -- Remember to include the version number! --- You received this message because you are subscribed to the Google Groups "InfluxData" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/influxdb. To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/BL2P103MB0052F2A52E4F7760542C830BE1BC0%40BL2P103MB0052.NAMP103.PROD.OUTLOOK.COM. For more options, visit https://groups.google.com/d/optout.
