UiPath Integration with Splunk


#1

What are the configurations required for integrating UiPath with Splunk?
Can we publish process / orchestrator dashboard logs to Splunk?


#2

Hi,

I don’t know if there is any ready to use solution for that, but You can install Splunk agent for Windows and then get values from log files by regular expressions.

Also I’m not sure about ready solutions for integration Orchestrator with Splunk, but I would use Orchestrator API to put logs to Splunk.

Regards


#3

What will be the path for the below logs?

Queue details
Robot specific metrics
Workflow execution log

regards
Kaushal


#4

I don’t think that there is any direct path. Probably You would have to create that file on your own.
I have 3 possible solutions on my mind:

  1. Create log files during Robot running (create it in workflows) and then install Splunk Agent and get logs from that files by regular expressions -> pretty clumsy, but should work

  2. Create simple App in .NET to get data by Orchestrator API and create log files from that data. Then install Splunk Agent and get logs from that files by regular expressions.

  3. Create simple App in .NET to get data by Orchestrator API and send them directly to Splunk
    -> could be pretty neat I think, You could use this App for all of your Robots in Orchestrator

Here is Orchestrator API: https://www.uipath.com/hubfs/Documentation/OrchestratorAPIGuide_2016.2/UiPathOrchestratorAPIGuide_2016.2.html#Functions

And there are also Splunk libraries for .NET
http://dev.splunk.com/view/splunk-loglib-dotnet/SP-CAAAEX4


#5

Since all logs would be on the UiPath server where Orchestrator is installed, is there a way to schedule this Splunk .NET component as a task without utilizing a Robot


#6

Hello,
any news on this ? Which is the easiest and smoothest way to integrate UiPath with Splunk ?


#7

I’ve done this with a local instance of UiPath Studio and Splunk, but not at the Orchestrator level. However, you should be able to follow the same steps with Orchestrator.

  1. You will need to replace the NLog.dll file with the latest version (I used 4.5.8) (.Net 4.5)
    http://nlog-project.org/
    https://www.nuget.org/packages/NLog/

  2. Add the NLog.Targets.Splunk.dll file in the same location.
    https://github.com/AlanBarber/NLog.Targets.Splunk
    https://www.nuget.org/packages/NLog.Targets.Splunk/

  3. Alter the NLog.config file like so:

<xml version="1.0" encoding="utf-8" ?>

`<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"`

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"

      autoReload="false"

      throwExceptions="false"

      internalLogLevel="Info" internalLogFile="c:\temp\nlog-internal.log">

 

  `<variable name="LogDirectory"`

            value="${specialfolder:folder=LocalApplicationData}/UiPath/Logs" />

  <extensions>

    <add assembly="NLog.Targets.Splunk" />

  </extensions>

 

  <targets>

    <!-- VisionHost tracing -->

    <target xsi:type="File"

            name="visionHostFile"

            fileName="${LogDirectory}/${shortdate}_VisionHost.log"

            layout="${time} ${level} ${message}"

            concurrentWrites="true" />

    <target name="Splunk"

            layout="${time} ${level} ${message}"

            xsi:type="SplunkHttpEventCollector"

            serverUrl=" http://localhost:8088/services/collector/raw"

            token="xxxxxxx-xxxx-xxxx....."

            retriesOnError="0">

      <contextproperty name="host" layout="${machinename}" />

      <contextproperty name="threadid" layout="${threadid}" />

      <contextproperty name="logger" layout="${logger}" />

    </target>

   

    <target xsi:type="File"

            name="executionFile"

            fileName="${LogDirectory}/${shortdate}_Execution.log"

            layout="${time} ${level} ${message}"

            concurrentWrites="true" />

    <target xsi:type="EventLog"

            name="eventLog"

            layout="${callsite:className=false:includeSourcePath=true:methodName=false} ${message}"

            source="UiPath"

            log="Application" />

  `</targets>`

  <rules>

   <logger name="UiPath.Vision.Host.exe"

            minLevel="Warn"

            writeTo="visionHostFile"

            final="true" />

    <logger name="*"

            minlevel="Debug"

            writeTo="Splunk" />

  

    <logger name="Internal"

            minLevel="Trace"

            writeTo="eventLog" />

    <logger name="Execution"

            minLevel="Trace"

            writeTo="executionFile"

            final="true" />

  </rules>

</nlog>

That should be enough to get you started. You’ll need to learn about NLog targets to be able to change anything.