Unable to get count of number of messages in smatDB in 6.2

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Unable to get count of number of messages in smatDB in 6.2

  • Creator
    Topic
  • #55788
    Varun Sinha
    Participant

      Hi,

       

      SmatDB : Unable to find exact count of number of messages in smatDB in Cloverleaf 6.2.

      If the number of message count goes beyond 2000, it shows as 2000+.

      Is there any way to find the total number of message count for a particular smatDB (either in current or SmatHistory) or am I missing any configuration as such in cloverleaf 6.2?

        Is there any TCL script to count the number of messages from smatDB file?

      Regards,

       Varun

    Viewing 2 reply threads
    • Author
      Replies
      • #86503
        Jeff Anderson
        Participant

          I ran into the same issue. Here is my work-around. If you are using the default database, sqlite, you can do the following from the command line in linux. Go to the directory where your smat file is and do the following:

          SmatHistory$ sqlite tcpresults_data.20180920234713.smatdb ‘select count(1) from smat_msgs’

          5000

          If you cycle the smat files daily and want a monthly count, you can do this:

          for i in {01..31}; do sqlite tcpresults_data.201808$i*.smatdb ‘select count(1) from smat_msgs’; done

          You’ll get a line for each day.

          Hope this helps,

          Jeff

        • #86504
          Varun Sinha
          Participant

            Thanks Jeff!

            I ran the following command in backend (linux)

            sqlite tcpresults_data.20180920234713.smatdb ‘select count(1) from smat_msgs’  

            and got the following error

            Error: file is encrypted or is not a database

            I have even gone through the following topic, but I am unable to decrypt the smatdb file (Apology as I am new to sqlite)

            Access encrypted smatdb files…

            (https://usspvlclovertch2.infor.com/viewtopic.php?t=8059&highlight=smatdb)

            How can we decrypt smatdb files?

            What is the significance of SmatHistory$ as you mentioned below the command as

            SmatHistory$ sqlite tcpresults_data.20180920234713.smatdb ‘select count(1) from smat_msgs’

            Regards,

             Varun

          • #86505
            bill bearden
            Participant

              Varun,

              The default encryption key for SMATDB is the site name. Normally, we use this command to specify the key.

              PRAGMA key=’yourkeyhere’;

              Unfortunately, our firewall won’t let me post the command that worked here. It thinks I am attempting a SQL injection hack. But what I did in Windows was put the PRAGMA command before the SELECT command. I surrounded the PRAGMA;SELECT commands in double-quotes instead of the single quotes since the PRAGMA command really wants the key surrounded by single quotes. I’m not sure if you can make the same substitution in Linux.

              Bill

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