CP R77 SmartLog AdminGuide

  • Upload
    h190416

  • View
    277

  • Download
    1

Embed Size (px)

Citation preview

  • 7/23/2019 CP R77 SmartLog AdminGuide

    1/21

    6 May 2015

    Administration Guide

    SmartLog

    R77

    Classification: [Protected]

  • 7/23/2019 CP R77 SmartLog AdminGuide

    2/21

    2015 Check Point Software Technologies Ltd.

    All rights reserved. This product and related documentation are protected by copyright and distributed underlicensing restricting their use, copying, distribution, and decompilation. No part of this product or relateddocumentation may be reproduced in any form or by any means without prior written authorization of CheckPoint. While every precaution has been taken in the preparation of this book, Check Point assumes noresponsibility for errors or omissions. This publication and features described herein are subject to changewithout notice.

    RESTRICTED RIGHTS LEGEND:

    Use, duplication, or disclosure by the government is subject to restrictions as set forth in subparagraph(c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR52.227-19.

    TRADEMARKS:

    Refer to the Copyright page (http://www.checkpoint.com/copyright.html)for a list of our trademarks.

    Refer to the Third Party copyright notices (http://www.checkpoint.com/3rd_party_copyright.html)for a list ofrelevant copyrights and third-party licenses.

    http://www.checkpoint.com/copyright.htmlhttp://www.checkpoint.com/copyright.htmlhttp://www.checkpoint.com/copyright.htmlhttp://www.checkpoint.com/3rd_party_copyright.htmlhttp://www.checkpoint.com/3rd_party_copyright.htmlhttp://www.checkpoint.com/3rd_party_copyright.htmlhttp://www.checkpoint.com/3rd_party_copyright.htmlhttp://www.checkpoint.com/copyright.html
  • 7/23/2019 CP R77 SmartLog AdminGuide

    3/21

    Important InformationLatest Software

    We recommend that you install the most recent software release to stay up-to-date with the latest functionalimprovements, stability fixes, security enhancements and protection against new and evolving attacks.

    Latest Documentation

    The latest version of this document is at:(http://supportcontent.checkpoint.com/documentation_download?ID=24814)

    For additional technical information, visit the Check Point Support Center(http://supportcenter.checkpoint.com).

    For more about this release, see the R77 home page(http://supportcontent.checkpoint.com/solutions?id=sk104859).

    Revision History

    Date Description

    6 May 2015 Fixed Working with More than One Log Server(on page8)

    Added Aggregated Logs to Running Queries(on page10)

    17 July 2014 Cover changed to be relevant for all R77 versions

    Added Show/Hide User identity("Working with the Results Pane"on page12)icon to Results Pane toolbar

    Added note to Query Language Overview(on page15)topic

    1 January 2014 Added Configuring Query Defaults

    26 August 2013 First release of this document

    Feedback

    Check Point is engaged in a continuous effort to improve its documentation.

    Please help us by sending your comments(mailto:[email protected]?subject=Feedback on SmartLog R77 AdministrationGuide).

    http://supportcontent.checkpoint.com/documentation_download?ID=24814http://supportcontent.checkpoint.com/documentation_download?ID=24814http://supportcontent.checkpoint.com/documentation_download?ID=24814http://supportcenter.checkpoint.com/http://supportcenter.checkpoint.com/http://supportcenter.checkpoint.com/http://supportcontent.checkpoint.com/solutions?id=sk104859http://supportcontent.checkpoint.com/solutions?id=sk104859http://supportcontent.checkpoint.com/solutions?id=sk104859mailto:[email protected]?subject=Feedback%20on%20SmartLog%20R77%20Administration%20Guidemailto:[email protected]?subject=Feedback%20on%20SmartLog%20R77%20Administration%20Guidemailto:[email protected]?subject=Feedback%20on%20SmartLog%20R77%20Administration%20Guidemailto:[email protected]?subject=Feedback%20on%20SmartLog%20R77%20Administration%20Guidemailto:[email protected]?subject=Feedback%20on%20SmartLog%20R77%20Administration%20Guidemailto:[email protected]?subject=Feedback%20on%20SmartLog%20R77%20Administration%20Guidehttp://supportcontent.checkpoint.com/solutions?id=sk104859http://supportcenter.checkpoint.com/http://supportcontent.checkpoint.com/documentation_download?ID=24814
  • 7/23/2019 CP R77 SmartLog AdminGuide

    4/21

    Contents

    Important Information ............................................................................................................ 3

    Introduction ............................................................................................................................ 5

    Enabling Logging on a Security Management Server or Domain Log Server ....................... 5

    Starting and Stopping the SmartLog Index Server ............................................................... 6Activating SmartLog on Multi-Domain Security Management .............................................. 6SmartLog User Interface ..................................................................................................... 7

    Using the Query Results Timeline ................................................................................... 8Working with More than One Log Server ............................................................................. 8

    Minimum Disk Space ........................................................................................................... 9Managing the Event Database ........................................................................................ 9

    Working with Queries .......................................................................................................... 10Running Queries ............................................................................................................... 10Working with Query Settings ............................................................................................. 11Working with the Favorites List .......................................................................................... 11

    Adding a Query to the Favorites List ............................................................................. 11

    Creating a New Folder .................................................................................................. 12Deleting a Folder .......................................................................................................... 12

    Working with the Results Pane .......................................................................................... 12Showing Query Results ................................................................................................ 13Customizing the Results Pane ...................................................................................... 13

    Exporting Query Results ............................................................................................... 13Creating Custom Queries .................................................................................................. 14

    Selecting Query Fields .................................................................................................. 14Selecting Criteria from Grid Columns ............................................................................ 14

    Manually Entering Query Criteria .................................................................................. 14

    Query Syntax ........................................................................................................................ 15Query Language Overview ................................................................................................ 15

    Criteria Values ................................................................................................................... 15IP Addresses ................................................................................................................ 16IP Address Ranges ....................................................................................................... 16

    Numeric Ranges ........................................................................................................... 16Null Values ................................................................................................................... 16

    Wildcards .......................................................................................................................... 16Using Wildcards with IP Addresses ............................................................................... 17

    Field Keywords .................................................................................................................. 17

    Boolean Operators ............................................................................................................ 18

    Date and Time Queries ..................................................................................................... 19Preceding Time Period Queries .................................................................................... 19

    From-To Queries .......................................................................................................... 20Index ..................................................................................................................................... 21

  • 7/23/2019 CP R77 SmartLog AdminGuide

    5/21

    SmartLog Administration Guide R77 | 5

    Chapter 1

    Introduction

    In This Section:

    Enabling Logging on a Security Management Server or Domain Log Server..........5

    Starting and Stopping the SmartLog Index Server...................................................6

    Activating SmartLog on Multi-Domain Security Management..................................6

    SmartLog User Interface...........................................................................................7

    Working with More than One Log Server..................................................................8

    Minimum Disk Space................................................................................................9

    SmartLog reads and indexes logs generated by Check Point and OPSEC products. You can use this data

    to: Detect and monitor security-related events. For example, alerts, rejected connections, and failed

    authentication attempts can indicate intrusion attempts.

    Collect data on problematic issues. For example, a client is authorized to create a connection, butcannot connect. SmartLog shows that the Rule Base incorrectly blocks the client connection attempts.

    Analyze network traffic patterns. For example, find out how many HTTP services were used during peakactivity.

    What sets SmartLog apart from other log utilities is its power, ease of use, and speed. The SmartLog IndexServer gets log files from many log servers and indexes them for rapid data extraction. SmartLog includes apowerful query language that lets you create your own queries in minutes.

    SmartLog is part of the R77 SmartConsole installation.

    Enabling Logging on a Security Management Server orDomain Log Server

    You must enable Logging & Status Software Blade on the Security Management Server and on all LogServer.

    To enable logging on a Security Management Server or Log Server:

    1. Open SmartConsole.2. In the Gatewaysview, double-click the Security Management Server or Log Server.

    The General Propertieswindow opens.

    3. In the Management tab, select Logging & Status.

    4. From the navigation tree, click Logs.

    This shows the Security Gateways that forward logs to this machine.

    5. Make sure that Enable SmartLogis selected.

    It is enabled by default. If you clear this option, it will take much more time to search the logs.

    6. Click OK.

    7. Click Publish.

  • 7/23/2019 CP R77 SmartLog AdminGuide

    6/21

    Introduction

    SmartLog Administration Guide R77 | 6

    Starting and Stopping the SmartLog Index ServerWhen you activate the SmartLog Index Server, it continuously indexes logs on management and log

    servers. To stop the SmartLog Index Server, run smartlogstopfrom the command line. To restart the

    SmartLog Index Server, run smartlogstartfrom the command line.

    Activating SmartLog on Multi-Domain SecurityManagement

    SmartLog in a Multi-Domain Security Management environment works on the Multi-Domain Server. Thisserver is used to query results from the Domain Management Servers and Multi-Domain Log Servers.

    SmartLog on the Multi-Domain Server is active by default. Each Domain Management Server andMulti-Domain Log Server can be activated separately.

    To activate SmartLog on the Multi-Domain Security Management:

    1. Open the SmartDomain Manager > General Multi-Domain Server Contents.

    2. Right-click the Domain Management Server and select Launch Application > SmartDashboard.

    3. In the properties of the Domain Management Server object > Logs, select Enable SmartLog.

    Do this also for the Multi-Domain Log Servers objects.

    4. Click OK and then Save.

    5. In the SmartDomain Manager > General Multi-Domain Server Contents, double-click theMulti-Domain Server object.

    6. Select Enable SmartLog.

    7. Click OK.

    8. Start the SmartLog console.

    SmartLog can be used to access the Domain Management Servers or Multi-Domain Log Servers directly, orthrough the Multi-Domain Server.

    When you connect through the Multi-Domain Server, on the left pane, SmartLog shows the DomainManagement Servers and Multi-Domain Log Servers that you can select as query targets. The results are acollection of logs from the selected Domain Management Servers and Multi-Domain Log Servers (thatmatch the query).

  • 7/23/2019 CP R77 SmartLog AdminGuide

    7/21

    Introduction

    SmartLog Administration Guide R77 | 7

    SmartLog User Interface

    Item Description

    1 Favorites - Shows list of predefined queries. Select a query in this list to run it.

    2 Back/Forward - Scroll backward and forward between recent queries.

    3 Log pane toolbar- Lets you select the grid or table view for the Log pane. You can also show IPaddresses and ports as numbers or their resolved names.

    4 Query Definition field- Shows the query definition for the most recent query. You also definecustom queries in this field using the GUI tools or manually entering query criteria.

    5 Top Results pane- Shows the top results of the most recent query.

    6 Results pane- Shows the log entries for the most recent query.

    7 Log Details pane- Shows the detailed contents of the most recently selected log record.

    8 Query Results Timeline- Shows a chart of the current query results over time.

    9 Disk Space Indicator- Bar graph that shows used and available disk space in the/var/log

    partition. Put the cursor over the indicator to see how much space is used by log files and otherdata.

  • 7/23/2019 CP R77 SmartLog AdminGuide

    8/21

    Introduction

    SmartLog Administration Guide R77 | 8

    Toolbar Icons

    Launch Menu- Opens the menu.

    Grid view - Detailed tabular view. You can select the fields to show and change theorder and width of the columns.

    Table view - Summary view that shows basic information. This view is suitable forsmall windows, but cannot be customized.

    Hide user identity- Hides the source user name in the Results pane,

    Resolve - Resolves IP addresses and services to their names, if possible.

    SmartConsoles- Open SmartConsole clients.

    Using the Query Resul ts Timel ineThe Query Results Timeline shows the results of the current query as a horizontal bar graph. By default, thegraphs shows the number of incidents during the last seven days.

    By default the Query Results Timeline is enabled and shows under the Results Pane. To disable it, Click theX icon in the upper right-hand corner of the timeline. To enable the timeline, select View > Timeline from

    the menu bar.

    The ability to change the time frame on the timeline is intentionally not documented because this featuredoes not work properly.

    Working with More than One Log ServerYou can include log records from more than one Log Server in your SmartLog queries. The Log Serversmust all be managed by the same Security Management Server. SmartLog automatically indexes logs on allLog Servers. The Timeline and Top Results pane are not available when working with more than one LogServer.

    To see logs from more than one Log Server:

    1. Select Tools > Log servers connection.

    2. R77 and R77.10: In the Log Servers Connection window, select Multiple log servers, and click OK.

    R77.20 and higher: Select Reads logs from multiple log servers.

    3. On theLog Serverspane (on the left), select the log servers to include in your queries. By default, all

    servers are selected.

    If you have many log servers with large log files, it may take a long time to index the servers. Please bepatient. The Top Results pane does not show.

    To see logs from only the connected Log Server:

    1. Select Tools > Log servers connection.

    2. R77 and R77.10: In the Log Servers Connection window, select Single Log Server,and click OK.

    R77.20 and higher: Select Reads logs only from connected server.

    The Top Results pane shows in the user interface.

    To see logs from more than one Domain Log Server:

    In a Multi-Domain Security Management environment, the SmartLog queries include log records from all theDomain Log Servers that are managed by the same Multi-Domain Server.

  • 7/23/2019 CP R77 SmartLog AdminGuide

    9/21

    Introduction

    SmartLog Administration Guide R77 | 9

    Minimum Disk SpaceSmartLog creates and uses index files for fast access to log file contents. The index files are located by

    default at $SMARTLOGDIR/data.

    To make sure that there is always sufficient disk space on the server, SmartLog deletes the oldest indexentries when the available disk space is less than a specified minimum. The default minimum value is10,240 MB.

    To change the minimum available disk space value:

    1. On the SmartLog index server command line, go to $SMARTLOGDIR.

    2. Open smartlog_settings.txtin a text editor.

    3. Add this line to the section:

    :min_disk_space (space), where space= the minimum available disk space in MB.

    The default value is 10240 MB, which is in effect when there is no :min_disk_space line in the

    smartlog_settings.txt file. A smaller number will let the index file contain more entries before it

    automatically deletes the oldest records.

    Managing the Event DatabaseSmartLog uses an optimization algorithm to manage disk space and other system resources. When theSmartLog database becomes too large, the oldest events are automatically deleted to save space. Also,events that are more than one year old are automatically deleted.

    For instructions to change maximum period and maximum database size to save past events inSmartEvent database, see sk73640 (http://supportcontent.checkpoint.com/solutions?id=sk73640).

    http://supportcontent.checkpoint.com/solutions?id=sk73640http://supportcontent.checkpoint.com/solutions?id=sk73640http://supportcontent.checkpoint.com/solutions?id=sk73640http://supportcontent.checkpoint.com/solutions?id=sk73640
  • 7/23/2019 CP R77 SmartLog AdminGuide

    10/21

    SmartLog Administration Guide R77 | 10

    Chapter 2

    Working with Queries

    In This Section:

    Running Queries.....................................................................................................10

    Working with Query Settings...................................................................................11

    Working with the Favorites List...............................................................................11

    Working with the Results Pane...............................................................................12

    Creating Custom Queries.......................................................................................14

    SmartLog lets you quickly and easily create log queries. The query results show in the Results pane.SmartLog comes with many predefined queries that are ready to run right out of the box. You can createyour own custom queries and save them for future use.

    Running QueriesYou can run a SmartLog an existing query or create a custom query ("Creating Custom Queries"on page14).

    To run a query:

    Click Favorites and select a predefined or custom query.

    Or

    Click in the Query Definitionfield and select a recent query.

    To create and run a query:

    1. Click in the Query Definitionfield.

    2. Enter or select query criteria.

    The query runs automatically. As you add more criteria, results are updated dynamically.

    To manually refresh your query:

    Click the Refreshicon.

    To continuously refresh your query (Auto-Refresh):

    Click the Auto-Refreshicon. The icon is highlighted when you enable Auto-Refresh.

    The query updates every two seconds while Auto-Refresh is enabled. If the number of logs is greater than20 in any two-second period, logs are aggregated, and a summary view shows. To see all logs that havebeen aggregated in a specific time interval, click View.

    To stop refreshing your query:

    Click Auto-Refreshicon. The icon is not highlighted when you deactivate Auto-Refresh.

  • 7/23/2019 CP R77 SmartLog AdminGuide

    11/21

    Workingwith Queries

    SmartLog Administration Guide R77 | 11

    Working with Query SettingsYou can use the Query Settings to:

    Define the default query that runs when you open SmartLog

    Set the number of items that show in the Top Resultspane.

    Sets the time, in seconds, that the Top Resultsshow after running a query.

    To define the default query:

    1. Go to Menu > Tools > Query Settings.

    The Query Settingswindow opens.

    2. Enter a query (using the query syntax) in the Default Queryfield.

    Tip: Select a query or Define a query in the Query Definition field. Then copy and paste it into theDefault Queryfield.

    If no default query is specified, SmartLog runs the All Recordsquery.

    3. Click OK.

    To configure the Top Results:

    1. Go to Menu > Tools > Query Settings.

    The Query Settingswindow opens.

    2. In the Maximum top resultsfield, enter the number of results to show (default =10).

    3. In the Show top results afterfield, enter the time interval allocated for calculation of top results(default=10 seconds).

    Note- SmartLog stops collecting top results after 150000 log entries or after 10 seconds, whichever

    happens first. To change these limits, refer to sk74800http://supportcontent.checkpoint.com/solutions?id=sk74800.

    4. To get top results from Multi-Domain Log Server and multiple Log Servers:

    a) Select Show top results from Multi-Domain Log Server and multiple Log Servers.

    b) Enter the maximum number of Simultaneous connectionsto Log Servers (default=3).

    Note- top results are collected from all Log Servers in groups of size configured in Simultaneousconnections.

    5. Click OK.

    Working with the Favorites ListThe Favorites list lets you work with predefined and saved custom queries. The predefined queries areorganized into folders by Software Blade. You can add new queries to existing folder or create new foldershold them.

    You can do these actions with the Favorites list:

    Add new custom queries

    Add new query folders

    Delete queries

    In this version, you cannot move a query from one folder to a different folder.

    Adding a Query to the Favor i tes List

    To add a folder to the Favorites list:

    1. From the Favorites menu, select Add to Favorites.

    2. In the Add to Favoriteswindow, enter a name for the new query.

    The query criteria show in the Query field.

    http://supportcontent.checkpoint.com/solutions?id=sk74800http://supportcontent.checkpoint.com/solutions?id=sk74800http://supportcontent.checkpoint.com/solutions?id=sk74800
  • 7/23/2019 CP R77 SmartLog AdminGuide

    12/21

    Workingwith Queries

    SmartLog Administration Guide R77 | 12

    3. Select a folder from the list or click Create a New Folder.

    4. Click Add.

    Creating a New Fo lder

    You can use folders to help you organize custom queries into logical groups. Folders can be created insideof other folders.

    You can also do this procedure while adding a new query to the favorites list.

    To create a new folder:

    1. From the Favorites menu, select Add to Favorites.

    2. In the Add to Favoriteswindow, click the Folder list.

    3. Select Create a New Folderfrom the list.

    4. In the Create a Folderwindow, enter a name for the new folder.

    5. Select a folder to contain the new folder.

    6. Click Add.

    Delet ing a FolderYou can delete folders that are no longer necessary.

    Important- When you delete a folder, you also delete any queries included in that folder. Werecommend that you carefully look at folder contents before deleting it. In this release, you cannotmove a query from one folder to a different one.

    To delete a folder:

    1. From the Favoritesmenu, select Organize Favorites.

    2. In the Organize Favoritesfolder, select the folder to be deleted.

    3. Click Delete.4. Click Close.

    Working with the Results PaneYou can control how the data shows on in the results.

    Select Grid View.This shows log records in a detailed tabular view. You can select the fields thatshow and can change the column order and width.

    Select Table View. This shows a short summary of basic log data. You cannot customize thisview.

    Showor Hide User Identity.

    Show resolved IP addresses and service names.

    Scroll down to increase the quantity of query results that show.

    Export query results to a CSV file.

  • 7/23/2019 CP R77 SmartLog AdminGuide

    13/21

    Workingwith Queries

    SmartLog Administration Guide R77 | 13

    Showing Query Resul ts

    Query results can include tens of thousands of log records. To prevent performance degradation, SmartLogonly shows the first set of results in the Results pane. Typically, this is 50 results.

    Scroll down to show more results. As you scroll down, SmartLog extracts more records from the SmartLogIndex Server and adds them to the results set. The number of results shows above the Results pane.

    For example, on the first run of a query, you can see the first 50 results (128 ms), out of over 150,000

    results. When you scroll down, you can see the first 100 results (128 ms), out of over 150,000 results.

    Customizing the Resul ts Pane

    By default, SmartLog shows a predefined set of columns and information based on the selected blade inyour query. This is known as the Column Profile. If no blade is specified, a column profile is assignedbased on the blade that occurs most frequently in the query results.

    The Column Profile defines which columns appear in the Results Paneand in which order. You can changethe Column Profile as necessary for your environment. You can sort the results by the actual event date andtime or by the time that the event index arrived to the SmartLog Server.

    To use the default Column Profile assignments, right-click a column heading and select Columns Profile>

    Automatic Profile Selection. This option is enabled by default.

    To manually assign Column Profile assignments by default, right-click a column heading and selectColumns Profile> Manual Profile Selection.

    To manually assign a different Column Profile:

    1. Right-click a column heading and select Columns Profile.

    2. Select a Column Profile from the options menu.

    To change a Column Profile:

    1. Right-click a column heading and select Columns Profile> Edit Columns Profile.

    2. In the Show Fieldswindow, select a Column Profile to change.

    3. Select fields to add from the Available Fieldscolumn and click Add.

    4. Select fields to remove from the Selected Fieldscolumn and click Remove.

    5. Select a field in the Selected Fieldsand then click Move Upor Move Downto change its position in

    the Results Pane.

    6. Double click the Width column to change the default column width for the selected field.

    You can drag the right-hand column border in the Results Pane to change the column width. This action isonly applicable to the current session. The width defined in the Column Profile will show when you start anew SmartLog session.

    To change the sort query order:

    1. Right-click the Time column.2. Select Sort by timeor Sort by arrival orderas applicable.

    Expor t ing Query Resul ts

    SmartLog lets you export queries to a comma separated value (CSV) file. You can then use Microsoft Excelor other database programs to further analyze the data information print reports.

    SmartLog only exports the query result included in the result set. You must scroll down to add more recordsto the result set. The actual number of results in the result set, shows below the Query Definitionpane.

    To export query results:

    1. Create or run a query in SmartLog.2. Scroll down in the Results pane until a sufficient quantity of records show.

    3. From the File menu, select Export > Excel CSV.

    4. Enter the file name and path and then click Save.

  • 7/23/2019 CP R77 SmartLog AdminGuide

    14/21

    Workingwith Queries

    SmartLog Administration Guide R77 | 14

    Creating Custom QueriesQueries can include one or more criteria. You can create custom queries using one or a combination ofthese basic procedures:

    Right-click columns in the grid view and select Add Filter.

    Click in the Query Definitionfield and then select the fields and filter criteria for those fields.

    Manually enter filter criteria in the Query Definition field.

    A good way to create a new custom query is to run an existing query and then use one of these proceduresto change it. You can save the new query in the Favorites list.

    When you create complex queries, SmartLog suggests, or automatically enters, an appropriate Booleanoperator. This can be an implied AND operator, which does not explicitly show.

    Select ing Query Fields

    You can enter query criteria directly from the Query Definition field.

    To select field criteria from the Query Definition field:

    1. If you are starting a new query, remove query definitions: click Clear

    2. Put the cursor in the Query Definition Field.

    3. Select a criterion from the drop-down list or enter the criteria in the Query Definition field.

    The query runs automatically.

    Select ing Cri ter ia from Grid Columns

    You can use the column headings in the Grid view to select query criteria. This option is not available in the

    Table view.

    To select query criteria from grid columns:

    1. In the Results pane, right-click on a column heading.

    2. Select Add Filter.

    3. Select or enter the filter criteria.The criteria show in the Query Definitionfield and the query runs automatically.

    You can continue to enter more criteria using this or other procedures.

    Manual ly Enter ing Query Cri ter ia

    You can always type query criteria directly in the Query Definitionfield. You can manually create a newquery or make changes to an existing query that shows in the Query Definitionfield.

    As you type, SmartLog helps you by showing recently used query criteria or even complete queries. To usethese suggestions, simply select them from the drop down list. If you make a syntax error in a query,SmartLog shows a helpful error message that identifies the error and suggests a solution.

  • 7/23/2019 CP R77 SmartLog AdminGuide

    15/21

    SmartLog Administration Guide R77 | 15

    Chapter 3

    Query Syntax

    In This Section:

    Query Language Overview.....................................................................................15

    Criteria Values.........................................................................................................15

    Wildcards................................................................................................................16

    Field Keywords........................................................................................................17

    Boolean Operators..................................................................................................18

    Date and Time Queries...........................................................................................19

    Query Language OverviewA powerful query language lets you show only selected records from the log files, according to your criteria.You can create complex queries by using Boolean operators, wildcards, fields, and ranges. This section is adetailed reference to the query language.

    When you use the GUI to create a query, the applicable criteria show in the Query Definition field.

    The basic query syntax is [:] .

    You can put together many criteria in one query by using Boolean operators:

    [:] AND|OR|NOT [:] ...

    Most query keywords and filter criteria are not case sensitive, but there are some exceptions. For example,Risk:Highis case sensitive (Risk:highwill not match). If your query results do not show the expectedresults, change the case of your query criteria or try both upper and lower case.

    Note: When you use queries with more than one criteria value, you must explicitly enter a Boolean operator.

    Criteria ValuesCriteria values are written as one or more text strings. You can enter one text string, such as a word, IPaddress or URL, without delimiters. Phrases or text strings that contain more than one word must besurrounded by apostrophes or quotation marks.

    One character string examples:

    richard

    inbound

    192.0.2.1

    mahler.ts.example.com

    dns_udp

    Phrase examples

    'John Doe'

    'log out'

    'VPN-1 Embedded Connector

    Note- You cannot put numbers or IP addresses in quotation marks. For example, 'John 1234' is invalid.

  • 7/23/2019 CP R77 SmartLog AdminGuide

    16/21

    Query Syntax

    SmartLog Administration Guide R77 | 16

    IP Add resses

    IPv4 and IPv6 addresses used in SmartLog queries are counted as one word. You can enter IPv4 addressusing dotted decimal or CIDR notation. IPv6 addresses are typically entered using CIDR notation.

    You can also use the '*' wildcard character with IPv6 addresses.

    Examples:

    20.20.20.1

    10.0.0.0/24

    2001:0db8::61:1/32

    2001:0db8::*

    IP Add ress Ranges

    You can use IPv4 and IPv6 address ranges in free text queries or with the source and destination fields.

    Enter the range criteria using this notation: -

    The query shows all IP addresses in the range, and includes the starting and ending addresses.Examples:

    192.0.2.0-192.0.2.255

    2001:0db8::64:1-2001:0db8::64:199

    Numeric Ranges

    You can use ranges for numeric values in free text and numeric field queries, such as the port fields.

    Syntax

    -

    Examples

    65000-66000

    port:80-660

    Null Values

    You can use null (empty) values with field keywords (on page17)in SmartLog queries with one of thesesyntax options:

    ""

    []

    You can also use the Boolean NOT operator to return fields that are not null:

    NOT ""

    NOT []

    Null value queries only work with fields contained in the field keywords (on page17)table.

    WildcardsYou can use the standard wildcard characters (* and ?) in queries to match variable characters or strings inlog records. The wildcard character cannot be the first character in a query criterion. You can use more than

    wildcard character in query criteria.

  • 7/23/2019 CP R77 SmartLog AdminGuide

    17/21

    Query Syntax

    SmartLog Administration Guide R77 | 17

    Wildcard syntax

    The ?(question mark) matches one character.

    The *(asterisk) matches a character string.

    Examples:

    Jo* shows John, Jon, Joseph, Joshua, John Paul, and so on.

    Jo? shows Joe and Jon, but not Joseph.

    If your criteria value contains more than one word, you can use the wildcard in each word. For example, 'Jo*N*' shows Joe North, John Natt, Joshua Named, and so on.

    Using Wi ldcards w i th IP Add resses

    The wildcard character is useful when used with IPv4 addresses. It is a best practice to put the wildcardcharacter after an IP address delimiter.

    Examples:

    192.168.2.* shows all records for 192.168.2.0 to 192.168.2.255 inclusive

    192.168.* shows all records for 192.168.0.0 to 192.168.255.255 inclusive

    Field KeywordsYou can use predefined field names, followed by a colon, as keywords in filter criteria. SmartLog only showslog records that match the criteria in the specified field. If you do not use field names, SmartLog showsrecords that contain the criteria in all fields.

    This table shows the predefined field keywords. Some fields also support keyword aliases that you can typeas alternatives to the primary keyword.

    Keyword Keyword Aliases Description

    action Action taken by a security rule

    blade product Software Blade

    destination dst, dest, to Traffic destination IP address, DNS name or CheckPoint network object name

    ipproto protocol IP Protocol number

    origin Name of originating Security Gateway

    port dport, d_port, dst_port,

    destination_port

    Destination TCP/UDP port

    rule Security rule that generated the log entry

    service Service that generated the log entry

    source src, from Traffic source IP address, DNS name or Check Pointnetwork object name

    source_port sport, s_port, src_port Source TCP/UDP port

    user User name

    The syntax for a field name query is: :

  • 7/23/2019 CP R77 SmartLog AdminGuide

    18/21

    Query Syntax

    SmartLog Administration Guide R77 | 18

    - One of the predefined field names

    - One or more filter criteria

    When using the Rulefield as a criterion, you must specify rule number or rule UID together as one string.This is the syntax for this special case:

    rule:/

    Examples: source:192.0.2.1

    rule:2/my_policy

    action:(drop or reject or block)

    You can use the OR Boolean operator in parentheses to include multiple criteria values.

    Notes:

    When using fields with multiple criteria values, you must explicitly write the Boolean operator. SmartLogdoes not automatically presume the AND operator if it is not specified.

    You must use parentheses when using multiple criteria with fields.

    Boolean OperatorsYou can use the Boolean operators AND, OR, and NOT to create filters with many different criteria. You can

    put multiple Boolean expressions in parentheses.

    If you enter more than one criteria without a Boolean operator, the AND operator is implied. When usingmultiple criteria without parentheses, the OR operator is applied before the AND operator.

    Examples:

    blade:"application control" AND action:block- Shows log records from the Application

    Control and URL Filtering Software Blade where traffic was blocked.

    192.0.2.133 10.19.136.101- Includes log entries that match the two IP addresses. The AND

    operator is presumed.

    192.0.2.133 OR 10.19.136.101- Includes log entries the match one of the IP addresses.

    (blade:Firewall or blade:IPS or blade:VPN) AND NOT action:drop- Includes all log entries

    from the Firewall, IPS or VPN blades that are not dropped. The criteria in the parentheses are applied

    before the AND NOTcriterion.

    Source:(192.0.2.1 OR 192.0.2.2) AND destination:17.168.8.2- Includes log entries from

    the two source IP addresses if the destination IP address is 17.168.8.2. This example also shows

    how you can use Boolean operators with field criteria.

    Notes:

    Boolean operators are not case sensitive.

  • 7/23/2019 CP R77 SmartLog AdminGuide

    19/21

    Query Syntax

    SmartLog Administration Guide R77 | 19

    Date and Time QueriesYou can define a query that shows logs generated during the preceding period of time using the lastor past

    keywords. The applicable periods of time are:

    minute

    hour day

    week

    month

    year

    The syntax for this criterion is:

    last|past []

    You can specify the period of time in the singular or the plural. If you do not enter a number, the value ispresumed to be the most recent period.

    Examples

    last 12 hours- Shows logs generated during the last 12 hours.

    past 10 week- Shows logs generated during the last 10 weeks. Using the singular is permitted.

    last year- Shows logs generated

    Preceding Time Period Queries

    You can define a query that shows logs generated during the preceding period of time using the lastor pastkeyword.

    Preceding period of time queries show log records based on the time that you run the query. For example, if

    your criterion is 'last 2 weeks' at 3:15 PM, SmartLog shows all logs starting from 3:15 on the 14th day

    before today. A log generated at 1:15 PM on the 14th day does not show, but one generated at 6:50 doesshow.

    The valid periods of time are:

    minute

    hour

    day

    week

    month

    year

    The syntax is:

    last|past []

    Examples

    last 12 hours- Shows logs generated during the last 12 hours before the most recent time.

    past 10 week- Shows logs generated during the last 10 weeks before the most recent date and

    time. This example shows that you can use the singular or plural interchangeably.

    last year- Shows logs generated during the last 365 days starting from the most recent date and

    time. This example shows that the default value (1) applies if no number value is entered.

    Notes:

    You can specify the period of time in the singular or the plural.

    If you do not enter a value, the number one is assumed.

  • 7/23/2019 CP R77 SmartLog AdminGuide

    20/21

    Query Syntax

    SmartLog Administration Guide R77 | 20

    From-To Queries

    You can define queries that show log records between a starting date and time and an ending date andtime. SmartLog shows records between and including the specified dates.

    Syntax

    dd/mmm/yyyy hh:mm:ss[-dd/mmm/yyyy hh:mm:ss]

    dd - Day of the month. The leading 0 is optional.

    mmm - Three character mnemonic for the month. This value is case insensitive.

    yyyy - Year (four digits are required).

    hh - Hour in 24 hour time notation. The leading 0 is optional.

    mm - Minutes. The leading 0 is optional.

    ss - Seconds. The leading 0 is optional.

    Syntax Notes

    You can use the yesterdayand todaykeywords as alternatives to the date parameter. You can use

    these with or without time values.

    The 'to' value is optional. If not specified, SmartLog shows all values on the specified 'from' value.

    The time value is optional. If no time is specified, SmartLog shows all records from 00:00 to 23:59 on thespecified date.

    If you specify a time value, you must specify the hours and minutes. You can ignore the second values.

    The day and year values are optional. If you do not specify these values the most recent day and/or yearis assumed.

    You can ignore the date value. Today is assumed.

    You must always specify the month value.

    You cannot use wildcards with dates and times.

    Examples

    1/mar/2012-5/mar/2012 - Shows all logs on and between these dates.

    5/mar/2012- Shows all logs for 5 March only.

    yesterday-today - Shows all logs from 00:00 yesterday to 23:59 today.

    5/mar/2012 07:00-08:59- Shows all logs from 7:00 on 5 March to 8:59 today. This example

    illustrates the fact that you can ignore the date value. Today is assumed.

  • 7/23/2019 CP R77 SmartLog AdminGuide

    21/21

    IndexA

    Activating SmartLog on Multi-Domain SecurityManagement 6

    Adding a Query to the Favorites List 11

    B

    Boolean Operators 18

    C

    Creating a New Folder 12Creating Custom Queries 14Criteria Values 15Customizing the Results Pane 13

    D

    Date and Time Queries 19Deleting a Folder 12

    E

    Enabling Logging on a Security ManagementServer or Domain Log Server 5

    Exporting Query Results 13

    F

    Field Keywords 17From-To Queries 20

    I

    Important Information 3Introduction 5IP Address Ranges 16IP Addresses 16

    M

    Managing the Event Database 9Manually Entering Query Criteria 14Minimum Disk Space 9

    N

    Null Values 16Numeric Ranges 16

    P

    Preceding Time Period Queries 19

    Q

    Query Language Overview 15Query Syntax 15

    R

    Running Queries 10

    S

    Selecting Criteria from Grid Columns 14Selecting Query Fields 14Showing Query Results 13

    SmartLog User Interface 7Starting and Stopping the SmartLog Index

    Server 6

    U

    Using the Query Results Timeline 8Using Wildcards with IP Addresses 17

    W

    Wildcards 16Working with More than One Log Server 8Working with Queries 10Working with Query Settings 11Working with the Favorites List 11Working with the Results Pane 12