Thursday, October 14, 2021

#886 Using OIC Logging Analytics for searching OIC Activity Stream log

 The OCI Logging Analytics version of post #884











So my OIC Activity Stream data is available in OCI Logging Analytics. Now I need to see what happened to order nr 2009. That order has been processed by OIC - 

 














Now over to OCI Logging Analytics - I just add "2009" to the query text box - 












So let's take this from the beginning - in Log Explorer - 




I then select the OIC Activity Stream Log - 








I then add the "2009" to the query - and see the order - 




Friday, October 8, 2021

#885 Surfacing OIC Design Time audit logs in OCI Logging Analytics

 The use case here is customer needs to see what is happening in respect of integration activation and deactivation.






The basis is the OIC Design Time Audit Log - visible in OIC Monitoring -


Note the action column values, activate, deactivate etc. Currently OIC does not push this log to OCI Logging, so the quick workaround here is to leverage the OIC REST api to retrieve the design time audit data - 








OIC REST API docs available here

I try this out in Postman, to get the response payload - 



Next step is to create a REST connection in OIC to OIC itself. 














This I then invoke from a Scheduled Orchestration - 















The logic, as you can very well see, is very simple. Just log all activate and deactivate messages.

Log Action is configured as follows - 


I then activate this integration, with tracing not enabled -


This will ensure only the LOG action messages are written to the OIC Activity Stream log.

Now to OCI Logging Analytics - note, I have already done the setup here for processing the OIC Activity Stream logs.

I open Log Explorer and configure the query as follows - 







OIC_AS_IntegrationFlowIdentifier = 'AA_OIC_AUDITLOG!01.00.0000' | fields -Entity, -'Entity Type', -'Log Source', -'Host Name (Server)', -'Problem Priority', -Label, -OIC_AS_IntegrationFlowIdentifier, OIC_AS_Message as 'Activation-Deactivation Messages'

OIC_AS_IntegrationFlowIdentifier and OIC_AS_Message are fields I have already defined in OCI Logging Analytics. Check out my previous posts here for details of OIC Activity Stream setup in OCI Logging Analytics.

I then save this to my OIC Dashboard - that's it. 
Very simple, very succinct!
 

Thursday, October 7, 2021

#884 Using OCI Logging for searching OIC Activity Stream Log




Scenario is as follows - I have an order processing integration used by many of my trading customers. Often they contact me to query what was actually ordered. I can use OIC Monitoring-> Tracking to fid the order, but what happens if the customer contacts me 3 weeks later? Maybe the data is no longer in the Activity Stream log. Here's where OCI Logging comes into play - Enabling OIC to send its activity stream log to OCI Logging is easy - 












Now to this simple demo order processing integration - 

























The Hare of the Dog pub has ordered a keg of Guinness - whatever that is. But as we say at Commiskey Beer Wholesalers - the customer is always right. The JSON payload is transformed into XML for processing - 
I check out what the order looks like in the Activity Stream - 




















Now to finding order 2112 in OCI Logging - 


 



As you see, I can specify compartment, Log Group and Log - I am only interested in the OIC Activity Stream, so I select that as the filter -

Here I see all the log entries, but I am only interested in OrderNr 2112. 

Here is the default query based on compartment/log group/log - 







Now I can augment this with a full text search for a string. I am looking for <orderNr>2112. - note the use of the 2 wildcards *- 



I see the content when I hover over the line with my mouse, unfortunately, it doesn't like screenshots.  
Again, hovering over "message" will show the order details. But, for the sake of this post, I will copy the contents of the message to notepad++









and there is the order - 


Monday, October 4, 2021

Tuesday, September 28, 2021

#882 Installing OIC Connectivity Agent on OCI Compute

 










This is a follow up from the previous OCI Streaming post - the OCI Streaming connection requires a connectivity agent to be specified, when one uses the connection as a trigger. I tried this out with the connectivity agent installed on my laptop. Naturally, this is not feasible for any organization, so installation of the agent on an OCI Compute is a compelling alternative.

Step 1 - Spin up an OCI Compute Instance - 

 


 

 

You can accept the defaults - 














Regarding keys -  simplest way to go is Generate a key pair for me. Save the public / private key locally.


then Paste the public key and click Create.




Step 2 - Login to the Compute Instance - 

I am using Putty to login to the compute instance; pre-requisite is the private key .ppk format. So I use PuttyGen to load the key generated by OCI and then save it in the Putty format.



 Now I leverage this in the Putty connection -









Step 3 - Install JDK on the Compute Instance - 









sudo yum install java

Step 4 - Create a Directory for the Connectivity Agent -


 


As you can see, I have copied the agent installer zip to this directory, using WinSCP.



Step 5 - Create a new Agent Group in OIC - 



then configure the InstallerProfile.cfg file to point to this Agent Group.






Step 6 - Leverage in a Connection Definition - 




Monday, September 27, 2021

#881 - OIC Pub/Sub with OCI Streaming Part 3

This final post in the series covers using the OCI Streaming adapter as a Trigger. 




This requires us to specify a connectivity agent in the connection definition. My Streaming api endpoint is public, so the connectivity agent can run anywhere e.g. on my laptop.


 













Here I leverage my agent group - NIALLC_AGENTGROUP. Now to the integration with OCI Streaming as trigger - 























I apply the same processing logic as in the previous posts - just a LOG action - 
























I activate and test - create a new product in Shopify - 



The integration that subscribes to the Shopify New Product event fires and publishes the message to the Stream.


 
The Streams Subscriber integration is triggered.