Skip to main content
Mattias
New Member
Mar 16, 2015 11:53 AM UTC
Solved

Help with dataset needed

Hi there,

 

i need help configuring a new dataset in FortiAnalyzer 5.2.1. It is a very simple query but I don't get it running due to a lack of SQL knowledge

 

I need a dataset for dial-up vpn (sslvpn and ipsec vpn) which only should show username and date.

I tried with the query:

select from_dtime (dtime) as date, `xauthuser` as Benutzer, tunneltype from $log where (tunneltype= 'ssl-tunnel' or tunneltype='ipsec') and action='tunnel-up' order by date desc

 

Problem is that for sslvpn the user attribute is "user" and for ipsec vpn it is "xauthuser". So I need a query which gets the attribute "user" for sslvpn and attribute "xauthuser" for ipsec BUT the usernames from both sslvpn and ipsec needs to be put in the column "Benutzer".

 

Could you please help me? Thanks and Cheers,

Mattias

    AtiT
    AtiTAnswer
    New Member
    Mar 16, 2015 1:33 PM UTC

    Hello,

     

    How about this one?:

     

    SELECT from_dtime (dtime) AS date, (CASE (`tunneltype`)   WHEN 'ssl-tunnel' THEN `user`   ELSE `xauthuser` END) AS Benutzer, `tunneltype` FROM $log WHERE $filter AND `subtype`='vpn' AND `action`='tunnel-up' AND `tunneltype` IN ('ssl-tunnel', 'ipsec') ORDER BY date DESC

    2 replies

    AtiT
    AtiTAnswer
    New Member
    Mar 16, 2015 1:33 PM UTC

    Hello,

     

    How about this one?:

     

    SELECT from_dtime (dtime) AS date, (CASE (`tunneltype`)   WHEN 'ssl-tunnel' THEN `user`   ELSE `xauthuser` END) AS Benutzer, `tunneltype` FROM $log WHERE $filter AND `subtype`='vpn' AND `action`='tunnel-up' AND `tunneltype` IN ('ssl-tunnel', 'ipsec') ORDER BY date DESC

    Translate
    Mattias
    MattiasAuthor
    New Member
    Mar 16, 2015 1:39 PM UTC

    Works like a charm!

     

    Lots of thanks @AtiT!

    Translate
    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024