appending record increments to database

Carter Bullard carter at qosient.com
Tue Dec 29 09:27:53 EST 2009


Hey Polo,
I'll assume that you are referring to rasqlinsert().

There are a few modes when inserting data into a mysql database table.
One is where you just add flow records to the table, as if  you were appending them to a file.
You do this by specifying a key of "none".  I'm assuming your .rarc file has the fields you want
exposed in the table specified using the RA_FIELD_SPECIFIER specifier. (a lot of specification).

   rasqlinsert -m none -S argus.source -w mysql://user@host/db/table 
   rasqlinsert -m none -r argus.file -w mysql://user@host/db/table 

where you supply the 'user' , 'host', 'db' (database name), and 'table' (table name).
If you want an "autoid" provided by mysql(), add it as a field to be printed (-s +autoid).
It will end up in the database schema and mysql() will do the right thing.

The table name uses the same methods as raspilt(), so you can use time and record
contents to generate a table name.  Say you wanted the table name to have the date in it
and you wanted it to change every week (just as an example, I use every day):

   rasqlinsert -M time 1w  -r argus.file -w mysql://user@host/db/table_%Y_%m_%d -m none

Another is where you use the database table as a "backing store", where you have a flow
key, and the client updates the database entry with new values for the database row.
The new values can simply be the new record, or it can be the aggregation of the two flow
records, the new one and the one in the database.

In this case you tell rasqlinsert() to use the database as a  "cache".  You do this with the
"-M cache" option.

   rasqlinsert -M cache -S argus.source -w mysql://user@host/db/table

If you have any problems, or if I answered the wrong question, don't hesitate to send email.


Carter

On Dec 28, 2009, at 10:25 AM, Napoleon Paxton wrote:

> Hi,
> 
> Is there a way to add increments to the existing records in my Argus database?  Thank you.
> 
> Polo
> 
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3815 bytes
Desc: not available
URL: <https://pairlist1.pair.net/pipermail/argus/attachments/20091229/6e8dbc77/attachment.bin>


More information about the argus mailing list