Filter Error Database on msgUserData or message content

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Filter Error Database on msgUserData or message content

  • Creator
    Topic
  • #52510
    Diana de Bruin
    Participant

    I have a thread that produces a lot of errors in the Error database.

    It’s mostly the same type of error that I just want to ignore.

    These errors obscure the more interesting errors that I also receive on the same thread.

    All the errors are of type: 201 = Tcl failure in IB data TPS (201)

    I’m looking for a way in which I can delete a group of errors from the error datbase based on the contents of the msgUserData which contains a text like: “Received HL7 NAK (CR): Message processing error”

    If that’s a problem, then a filter on the message content would also be helpfull.

    Diana

    LUMC -Leiden University Medical Centre
    The Netherlands

Viewing 3 reply threads
  • Author
    Replies
    • #74505
      garry r fisher
      Participant

      Hi,

      In the first instance I would look into what’s causing the 201 error and fix that.

      You can use Tcl to filter messages – Simply read the message, check for a string or pattern and then kill the message so it doesn’t go through the engine. I would also add a log of some kind to record the messages you are killing.

      BUT – I’d fix the 201 error first.

      Regards

      Garry

    • #74506
      Russ Ross
      Participant

      Your need to selectively clean up your error database peaked my interest, so I thought I would see how I might get rid of selective messages from the error database by searching for a string in the user metadata.

      I haven’t used the GUI much for data base stuff so you might check if there is some search capability built into the GUI.

      I’m sure that are other ways but this is the first that came to mind for me.

      I wanted to get a long list of everything in the error database to a file first so I did the following

      Code:

      hcidbdump -e -L >f1

      Next I proceeded to get just the msgMid and msgUserData into a file using

      Code:

      egrep “msgMid|msgUserData” f1 >f2

      at this point my test file looks like this

      Code:

         msgMid            : [0.0.230768]
         msgUserData       : bogus
         msgMid            : [0.0.230802]
         msgUserData       :
         msgMid            : [0.0.232393]
         msgUserData       : bogus
         msgMid            : [0.0.232394]
         msgUserData       :
         msgMid            : [0.0.232395]
         msgUserData       :

      Now I decided to join every other line in the file by using this command

      Code:

      paste -s -d” n” f2 >f3

      so now I have this

      Code:

         msgMid            : [0.0.230768]     msgUserData       : bogus
         msgMid            : [0.0.230802]     msgUserData       :
         msgMid            : [0.0.232393]     msgUserData       : bogus
         msgMid            : [0.0.232394]     msgUserData       :
         msgMid            : [0.0.232395]     msgUserData       :

      now I search for the string bogus as follows

      Code:

      grep bogus f3 >f4

      and end up with this

      Code:

         msgMid            : [0.0.230768]     msgUserData       : bogus
         msgMid            : [0.0.232393]     msgUserData       : bogus

      now I need to extract the msgMid(s) that I want removed from the error database and generate the hcidbdump commands to remove them so I did this next

      Code:

      cat f4 | awk ‘{print “hcidbdump -e -D -F -m “$3}’ >f5

      which left me with this

      Code:

      hcidbdump -e -D -F -m [0.0.230768]
      hcidbdump -e -D -F -m [0.0.232393]

      which I ws able to run to selectively delete the unwated messages of interest from the error database.

      Now that I have all the individual steps working I no longer desire the intermediate files to check my steps so I combined the working steps as follows (NOTE: the paste command wanted a file so I replaced that command with sed in this example rather than fight it):

      Code:

      hcidbdump -e -L
      | egrep “msgMid|msgUserData”
      | sed ‘$!N;s/n/ /’
      | grep bogus
      | awk ‘{print “hcidbdump -e -D -F -m “$3}’

      Which results in the same output as before as follows which can be redirect to a file and run once comfortable it is doing what you want.

      Code:

      hcidbdump -e -D -F -m [0.0.230768]
      hcidbdump -e -D -F -m [0.0.232393]

      Be careful not to accidnetally put any blank space after any of the continuation characters at the end of each line or it will not work and will be hard to figure out what isn’t working.

      Of course you will have to change the word bogus in my example to what works for your case.

      I’ve got a feeling there is a more effecient way but I  went with my first thought and I did learn how to combine every other line in a file which will be handy to have around for other situations.

      Russ Ross
      RussRoss318@gmail.com

    • #74507
      Diana de Bruin
      Participant

      Thanks for both answers.

      I’m using a Windows environment but I should be able to adapt the grep commands into a windows script.

      Diana

      LUMC -Leiden University Medical Centre
      The Netherlands

    • #74508
      Robert Kersemakers
      Participant

      Awesome! Just what I needed.

      And if you want to execute the printed commands immediately, just send them to sh or bash.

      Code:

      hcidbdump -e -L
      | egrep “msgMid|msgUserData”
      | sed ‘$!N;s/n/ /’
      | grep bogus
      | awk ‘{print “hcidbdump -e -D -F -m “$3}’
      | sh

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

Viewing 3 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,292
Replies
34,435
Topic Tags
286
Empty Topic Tags
10