Integration of cloud hub with on premise splunk - mule

In one of the requirement i want to integrate splunk with existing mule esb server that we are using(we are using cloudhub).
How can we achieve that?
Any help will be great.

You can use the Splunk connector to integrate within your applications. If you want to just send event data from existing applications see this other documentation page: Sending Data from Runtime Manager to External Monitoring Software

Add below configuration in your log4j file.
<Configuration packages="com.mulesoft.ch.logging.appender,com.splunk.logging">
<Http name="SPLUNK" url="https://input-prd-p-3ppsrv6qrg3h.cloud.splunk.com:8088" token="19954BDA-7A21-4FFA-A1E5-B3DFB7C75D55" disableCertificateValidation="true">
<PatternLayout pattern="%m" />
</Http>
where you should prefix "input-" to the domain name you have for splunk & the token will be the one that of http even collector.
Also while logging give reference of above http splunk appender :
<Root level="INFO">
<AppenderRef ref="SPLUNK" />
</Root>
Let me know if it works

Related

How do you "accept" a file upload in Mule 3.8? (Not deprecated)

How does one upload a file using an API in Mule 3.8? Can someone provide an example for a multipart/form-field POST using an example log file? Here's an old way but the connector is deprecated.
<http:connector name="httpConnector" doc:name="HTTP\HTTPS">
<service-overrides
messageFactory="org.mule.transport.http.HttpMultipartMuleMessageFactory" />
</http:connector>
I'm testing a process API that creates an import and then "will" call another service to upload itself. I'm modeling my own file upload using Mule and I can't seem to get anything to work. I have a Spring Boot servlet that uses Apache Commons Upload but I would prefer to have my upload prototype in Mule with my real projects until our Mule servers are installed.

MUnit with SFTP component

Has anyone used MUnit with SFTP component, could yo please provide me any helpful information/example to start up?
I went through the MUnit documentation but didnt get much help on the SFTP component with Munit.
Use Munit FTP server. Enable secure attribute true to use SFTP . Please Refer this page https://docs.mulesoft.com/munit/v/1.2.0/munit-ftp-server.
Start the server before suites run, and stops the servers after. Example as below.
<ftpserver:config name="FTP_Server" secure="true" doc:name="FTP Server"/>
<munit:before-suite name="suiteBefore" description="MUnit Test">
<ftpserver:start-server config-ref="FTP_Server" doc:name="FTP Server"/>
</munit:before-suite>
<munit:test name="FlowTest" description="Test">
--flow test goes here----
<flow-ref name="test5Flow" doc:name="Flow-ref to test5Flow"/>
<ftpserver:contains-files config-ref="FTP_Server" file="testFile.xml" path="/tmp" doc:name="FTP Server"/>
</munit:test>
<munit:after-suite name="After_Suite" description="After suite actions">
<ftpserver:stop-server config-ref="FTP_Server" doc:name="FTP Server"/>
</munit:after-suite>
From Anypoint Studio, go to Help and Install New Software…​.
In the Work with: panel look for MUnit Update Site, and from the MUnit Tools for Mule section, select FTP server Module (Mule 3.4.0+) then you come to get munit component for ftp server .you can use this ftp server in before/after suite to handle data transformation for testing of the application and you can use this as a out bound to your application munit flow.

What are the minimum capabilities for Application Insights to work?

I'm trying to get Application Insights added to an existing project, which only flags the following as capabilities:
<Capability Name="ID_CAP_LOCATION" />
<Capability Name="ID_CAP_NETWORKING" />
<Capability Name="ID_CAP_PHONEDIALER" />
<Capability Name="ID_CAP_MAP" />
I've added the call in my App's constructor to:
WindowsAppInitializer.InitializeAsync();
And of course, I've checked the ApplicationInsights.config file to check the InstrumentationKey matches that shown on my portal.
Do I need to add additional capabilities to allow these to work, as I'm not seeing anything show up on the Azure Portal for the subscription, and I'm not seeing anything in the debug output to suggest that any diagnostics are being attempted to be sent?
The only required capability appears to be ID_CAP_NETWORKING.
One other thing to watch out for; when using the UI to associate with your applciation insights it will add include a schema in the applicationInsights.config file, which stops it working.
So, instead of:
<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights>
<InstrumentationKey xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</InstrumentationKey>
</ApplicationInsights>
It should look more like:
<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights>
<InstrumentationKey>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</InstrumentationKey>
</ApplicationInsights>

how to make file endpoint in mule configerable

I have a flow with file endpoint and groovy.
I want to make the file path configerable.
Please suggest.
I am using file node to trigger the flow. So if anybody can suggest me that how to trigger groovy alone then there will be no need to use file endpoint.
Please suggest any solution.
What you want to do here is configure a file endpoint like so and use this as your inbound endpoint to trigger the flow:
<file:endpoint name="inputFile" path="${input.path}">
<!-- Add any filters (e.g. regex) here -->
</file:endpoint>
Then, you should create a mule-app.properties file inside of src/main/resources that will include something like the following:
# Input Properties
input.path=/path/to/file
Lastly, include the following at the top of your Mule config file (after <mule> but before your flow):
<spring:beans>
<context:property-placeholder location="classpath:mule-app.properties" />
</spring:beans>
Doing this should allow you to achieve what you've outlined above. Hope this helps!

How to make a deployable war file of a mule ESB application

can somebody please help me how to make a war of a simple mule application.
My mule application consists of a single mule-config.xml file.
I have made this mule project in ecplise and can run it as a mule server.
My requirement is to make a war and deploy it in a tomcat or tcat server.
Thanks and Regards,
Arijit
As explained in the user guide:
To embed Mule inside a webapp, you provide one or more configuration file locations as context params and include a context listener to initialize the Mule Server.
So just add this in your web.xml, with mule-config.xml at the root of your classpath (for ex. in src/main/resources):
<context-param>
<param-name>org.mule.config</param-name>
<param-value>mule-config.xml</param-value>
</context-param>
<listener>
<listener-class>org.mule.config.builders.MuleXmlBuilderContextListener</listener-class>
</listener>
EDIT I've open-sourced a running demo: https://github.com/ddossot/mule-webapp-example