FortiAnalyzer
FortiAnalyzer can receive logs and Windows host events directly from endpoints connected to EMS, and you can use FortiAnalyzer to analyze the logs and run reports.
farhanahmed
Staff
Staff
Article Id 366830
Description The article describes how to see the total log count in Log View.
Scope FortiAnalyzer.
Solution

Go to Log View -> Logs (in older versions select: FortiGate) -> Select the type of Logs. e.g. Traffic. (Search filters can be added). At the bottom of the screen, it shows 'x.x seconds' Select that to view the total logs.

 

log_view1.png

 

V7.4.x (v7.4.4 and higher) does not show the total count, instead, the total count is fetched by selecting the 'Get Total Count' button.

 

log_view2.png

 

 

The total log count of Log View can be fetched using API:

 

  1. Create a log search to generate a Task ID 'tid: (Search filters can be added. Here a filter is added to search all logs with action 'all-accept').

    {
        "id": "2",
        "jsonrpc": "2.0",
        "method": "add",
        "params": [
            {
                "case-sensitive": false,
                "filter": "smart_action=\"all-accept\"",
                "logtype": "traffic",
                "time-order": "desc",
                "time-range": {
                    "start": "2024-09-16 09:42:38",
                    "end": "2024-12-25 09:42:38"
                },
                "limit": 50,
                "url": "/logview/adom/{{ADOM}}/logsearch/",
                "device": [
                    {
                        "devid": "All_FortiGate"
                    }
                ],
                "apiver": 3
            }
        ],
        "session": "{{session}}"

    }

Sample output:

 

1.png

 

 

  1. Use the 'tid' from step #1 to get the log count:

 

{
    "id": "3",
    "jsonrpc": "2.0",
    "method": "get",
    "params": [
        {
             "url": "/logview/adom/{{ADOM}}/logsearch/count/{{tid}}",
             "apiver": 3
        }
    ],
    "session": "{{session}}"

}


Sample output:

 

2.png

 

Related articles:

Filtering messages in Log View.
Technical Tip: Using FortiManager/FortiAnalyzer API.
Fortinet Development Network (FNDN) - FortiAnalyzer.