Hi Anthony, The problem with your specific lines is the name, src_host and dst_host. These are reserved. As Yann was proposing, use instead src_host_int and dst_host_int for example. In your 'aggregate' line you will also have to modify src_host and dst_host into src_host_int and dst_host_int. I tried this working for me.
Paolo On Thu, Apr 19, 2018 at 03:01:24PM -0400, Anthony Caiafa wrote: > Yep that didnt work when i tried it. It still exported the src_host a string. > > On Thu, Apr 19, 2018 at 2:58 PM, Paolo Lucente <[email protected]> wrote: > > > > Hi Anthony, > > > > Yes, nice tip from Yann actually - i'm going to document it :) This > > would work and is portable across all plugins, you can give it a try. > > Specifically for the SQL plugins, which i understand is not your case, > > a sql_num_hosts feature exists - failing the custom primitive approach > > for any unforeseen reason, we could consider a porting of this feature. > > > > Paolo > > > > On Thu, Apr 19, 2018 at 11:04:24AM -0400, Anthony Caiafa wrote: > >> So this should technically work? > >> > >> name=src_host field_type=8 len=4 semantics=u_int > >> name=dst_host field_type=12 len=4 semantics=u_int > >> > >> Going against the direct keys instead of creating a new one for > >> src_host_int. > >> > >> On Thu, Apr 19, 2018 at 10:05 AM, Anthony Caiafa <[email protected]> wrote: > >> > yeah backend is clickhouse and it has a similar function. However > >> > conversion for range queries is meh. might as well store as an int. > >> > > >> > On Thu, Apr 19, 2018 at 7:21 AM, Karl O. Pinc <[email protected]> wrote: > >> >> On Thu, 19 Apr 2018 07:30:12 +0000 > >> >> Yann Belin <[email protected]> wrote: > >> >> > >> >>> As far as I know it doesn't but if you use nfacctd, you can easily > >> >>> define your own primitives to do the same job: > >> >> > >> >>> On Thu, Apr 19, 2018 at 12:14 AM Anthony Caiafa <[email protected]> > >> >>> wrote: > >> >>> > >> >>> > Does this feature currently exist? Having the ability to convert > >> >>> > the ipv4 key field to an int? > >> >> > >> >> Another option would be to save your data in PostgreSQL > >> >> and use the ip address data type, converting from there > >> >> on output if necessary. > >> >> > >> >> https://www.postgresql.org/docs/10/static/datatype-net-types.html > >> >> > >> >> Regards, > >> >> > >> >> Karl <[email protected]> > >> >> Free Software: "You don't pay back, you pay forward." > >> >> -- Robert A. Heinlein > >> >> > >> >> _______________________________________________ > >> >> pmacct-discussion mailing list > >> >> http://www.pmacct.net/#mailinglists > >> > >> _______________________________________________ > >> pmacct-discussion mailing list > >> http://www.pmacct.net/#mailinglists > > > > _______________________________________________ > > pmacct-discussion mailing list > > http://www.pmacct.net/#mailinglists _______________________________________________ pmacct-discussion mailing list http://www.pmacct.net/#mailinglists
