Automatic Visibility/Observability

 View Only
  • 1.  How to monitor logs with instanta?

    IBM Champion
    Posted Tue January 30, 2024 04:26 PM

    I have Instana installed on a Windows server, but we need Instana to be able to see a log of an application, how can I add this log so that Instana consumes it?



    ------------------------------
    saury granados
    ing
    GBM Corporation
    San José
    506-22843999
    ------------------------------


  • 2.  RE: How to monitor logs with instanta?

    Posted Wed January 31, 2024 02:23 AM

    Hi , instana only collect warnings and errors from log in curret releases. Its not user configurble for now.



    ------------------------------
    Ronny Hammar
    ------------------------------



  • 3.  RE: How to monitor logs with instanta?

    IBM Champion
    Posted Wed January 31, 2024 09:36 AM

    And putting a script that consumes the log and sends it to Instana will be feasible,

    #Var
    LOGREAD=/opt/instana/instana-agent/data/log/agent.log
    LOGWRITE=/opt/instana/instana-agent/data/customScripts/monitorScript.log
    URL="http://localhost:42699/com.instana.plugin.generic.event"
    DESCR1='{"title":"TSE_OracleDB_CRI", "text": "'
    DESCR2='", "duration": 300000, "severity": 10, "incident": true}'
    JSON="Content-Type: application/json"

    #read log 
    tail -n 0 -f $LOGREAD | grep --line-buffered ERROR |  grep --line-buffered OracleDB | while read LINE; 
    do
        MESSAGE="$(cut -d'|' -f6 <<<"$LINE")"
        echo $MESSAGE >> $LOGWRITE
        EVENTO=$DESCR1$MESSAGE$DESCR2
        echo "$EVENTO" >> $LOGWRITE

        content="$(curl -XPOST "$URL" -H "$JSON" -d "$EVENTO")"

    done



    ------------------------------
    saury granados
    ing
    GBM Corporation
    San José
    506-22843999
    ------------------------------