Michael,
I have change the Enrich section with the pairedlist outputtype but it still returning "line"(string) as the result.
<Enrich>
<Field input="time_origin" inputtype="string" type="jdbc"
outputtype="pairedlist" column="sched"
connectionstring="jdbc:sqlserver://**\s2k141;databaseName=mdb;user=**;password=.**;"
jdbcdriver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
query=" SELECT COUNT(*) FROM bpwshft WHERE sched like '%'+convert(varchar, CONVERT(DATETIME, '?'),101)+'%' and sym like 'Regular'"
returntype="string" output="line" />
</Enrich>
I am not seeing any request to the SQL server starting from the connector...
I am wondering if the sql driver is in the right place?
In my case i have it here:
Catalyst\CatalystConnector\container\lib\sqljdbc4.jar
I am also seeing the following in the logs where the outputval-->null
2019-12-18 16:14:35 DEBUG [com.ca.eventplus.catalog.plugin.Enricher:Enrich] AbstractPlugin - fldobj in Enricher ==>com.ca.eventplus.catalog.util.CatalogXMLHandler$FieldObject@6491cb90--field-->line--ntype-->jdbc--inputval-->[time_origin]--outputtype-->pairedlist
2019-12-18 16:14:35 DEBUG [com.ca.eventplus.catalog.plugin.Enricher:Enrich] AbstractPlugin - inside JDBC block ==>SELECT COUNT(*) sched FROM bpwshft WHERE sched like '%'+convert(varchar, CONVERT(DATETIME, '?'),101)+'%' and sym like 'Regular'--intypestring-->string--column-->[Ljava.lang.String;@16a845ee--paramstr-->time_origin,--Key-->time_origin,com.microsoft.sqlserver.jdbc.SQLServerDriverjdbc:sqlserver://****\s2k141;databaseName=mdb;user=**;password=.***;SELECT COUNT(*) sched FROM bpwshft WHERE sched like '%'+convert(varchar, CONVERT(DATETIME, '?'),101)+'%' and sym like 'Regular'stringstringsched--outputval-->null:jdbc
2019-12-18 16:14:35 DEBUG [com.ca.eventplus.catalog.plugin.Enricher:Enrich] AbstractPlugin - com.ca.eventplus.catalog.plugin.Enricher:Enrich***** TestInject-3128779.in*************
Regards,
Rui Dinis
------------------------------
Rui Dinis
HCL-Portugal
------------------------------
Original Message:
Sent: 12-18-2019 05:08 AM
From: MICHAEL BOEHM
Subject: Alert enrichment based on a query output
Hi Rui,
can you try using pairedlist as outputtype, and then use the following syntax to get the returned value. I remember there were some issues that the result of the jdbc query always returns a pairedlist - just try.
<Enrich>
<Field input="internal_resourceaddr" inputtype="string" type="jdbc" outputtype="pairedlist" column="name,desc,org" connectionstring="jdbc:sqlserver://server01;databaseName=mdb; user=nsmadmin;password=admin;" jdbcdriver="com.microsoft.sqlserver.jdbc.SQLServerDriver" query="select name,description,organization_uuid from ca_resource_department where id=?" returntype="string,string,string" output="department" />
</Enrich>
The <Enrich> property uses the internal_resourceaddr value. The query returns the corresponding name, description, and organization_uuid. The query also assigns this information to new properties using the defined column attributes as follows:
■ Returned name is assigned department_name_0
■ Returned description is assigned department_desc_0
■ Returned organization is assigned department_org_0
Michael
------------------------------
Customer Success Architect
CA Deutschland GmbH (a Broadcom company)
Original Message:
Sent: 12-18-2019 04:39 AM
From: Rui Miguel Goncalves Dinis
Subject: Alert enrichment based on a query output
Hi Michael,
The value of userAttribute is "line", it looks is not parsing the result of the query.
Rui
------------------------------
HCL
Original Message:
Sent: 12-18-2019 03:29 AM
From: MICHAEL BOEHM
Subject: Alert enrichment based on a query output
Hi Rui,
you can see the information in the logs, but for that you have to set the connector into debug and then analyze the logs.
The easiest way is to write the "line" value into a userAttribute to see the result of the query.
Michael
------------------------------
Customer Success Architect
CA Deutschland GmbH (a Broadcom company)
Original Message:
Sent: 12-17-2019 03:15 PM
From: Rui Miguel Goncalves Dinis
Subject: Alert enrichment based on a query output
Hi Michael,
Thanks for the reply,
No I didn't test that, is that the o my way to see it is not possible to capture that in the logs?
Regards,
Rui
Original Message------
Hi Rui,
For testing:
Did you try to write the output of "line" directly into a userAttribute, to make sure it contains the output you expect (0 or any other number)?
And once you are sure you only have "0" in the field, you can make the regex more specific:
mapin='^0$'
Michael
------------------------------
Customer Success Architect
CA Deutschland GmbH (a Broadcom company)
------------------------------