Ad Widget

Collapse

Log Monitoring with Unique Value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fatih gur
    Junior Member
    • Apr 2020
    • 6

    #1

    Log Monitoring with Unique Value

    Hello Everyone !!,
    I encountered a problem and unfortunately I couldn't solve it.
    I need your help. My problem is this: there is a unique value in the logs which I get from syslog and this value defines the unique ID of an alarm.
    Then, when the alarm comes clear, this unique value must match the ID of the alarm generated before. How can I parse this? or How can I match the values each other and then trigger it ?
    As you understand , When the system captured as the same value of nfInstanceId , I wanna see alarm status turn to alarm normal.

    The log like is ;
    Painted Values ​​are the same in 1st and 2nd log as you see and Second one it represents the alarm cleared.

    Jun 1 20:10:27 localhost cnrnef[6057]: cnrnef[6057]: 2020/06/01 20:10:27 242623 ALARM_CRITICAL [140561697117952 CnrAlarmManager.cpp->setAlarm:45]
    {"alarmId":"a7aae75c-3810-4230-b80e-f47048adcabd","alarmNature":"ADAC","alarmRaisedTim e":"2020-06-01T17:10:27Z","eventType":"DATABASE_ACCESS_FAILURE ","info":"Not Found,
    dbType:MONGO, dbPort:30558, dbIp:10.10.21.12","nfInstanceId":"0c9072f9-cc43-46d6-9c75-498b88c848b2","nfType":"NEF","perceivedSeverity":" CRITICAL","probableCause":"DB is unreachable",
    "serviceInstanceId":"0c9072f9-cc43-46d6-9c75-498b88c848b2","serviceName":"nnef-pfdmanagement","snssai":[{}]}


    Jun 1 20:20:32 localhost cnrnef[6057]: cnrnef[6057]: 2020/06/01 20:10:32 402416 ALARM_NORMAL [140561688725248 CnrAlarmManager.cpp->setAlarm:35]
    {"alarmId":"9e66ddbd-beb1-4448-b39e-d6fc0fd1b54c","alarmNature":"ADAC","alarmRaisedTim e":"2020-06-01T17:10:32Z","eventType":"DATABASE_ACCESS_FAILURE ","info":"DB connection is done,
    dbType:MONGO, dbPort:30558, dbIp:10.10.21.12","nfInstanceId":"0c9072f9-cc43-46d6-9c75-498b88c848b2","nfType":"NEF","perceivedSeverity":" CLEARED","probableCause":"DB is reachable","
    serviceInstanceId":"0c9072f9-cc43-46d6-9c75-498b88c848b2","serviceName":"nnef-pfdmanagement","snssai":[{}]}
Working...