Configure and Customize LogShark


By default, LogShark picks up its configuration settings from the config file that is located in the <LogShark_install_location>\Config\LogSharkConfig.json file. Some of these configuration settings can be overridden at the command line. Other settings can only be set in the configuration file.

In this section:


Config

Example of config file

{
  "Logging": {
    "Directory": "Logs",
    "FileNamePrefix": "LogShark",
    "FileSizeLimitBytes": 10485760,
    "RetainedFileCountLimit": 5,
    "LogLevel": {
      "Default": "Debug",
      "Microsoft": "Information"
    },
    "Console": {
      "IncludeScopes": true
    }
  },
  "EnvironmentConfig": {
    "NumberOfProcessingThreads": 2,
    "TempDirOverride": null,
    "OutputDir": "Output",
    "OutputDirMaxResults": null,
    "WorkbookTemplatesDir": "Workbooks",
    "CustomWorkbookTemplatesDir": null,
    "NumberOfErrorDetailsToKeep": 25,
    "DefaultWriter": "hyper",
    "AppendLogsetNameToOutput": false,
    "DynamicPluginsDirectory": null
  },
  "TableauServer": {
    "Url": "<EnterServerUrlHere>",
    "Site": "<EnterSiteNameHere>",
    "Username": "<EnterUsernameHere>",
    "Password": "<EnterPasswordHere>",
    "Timeout": 240,
    "GroupsToProvideWithDefaultPermissions": [],
    "ParentProject": {
      "Id": "",
      "Name": ""
    }
  }
}

Including your Custom Workbooks

One of the neat features LogShark 4.1 provides, is the ability to easily include your custom workbooks in a LogShark run. You can specify a folder where your custom workbooks are located in CustomWorkbookTemplatesDir variable in the config file. Make sure that the extract file name(s) in your customized workbooks match the name(s) of the extract file(s) generated by LogShark run. During the next run LogShark will include your workbooks in the run. Please note that if you modify workbooks in LogShark's <LogShark_install_location>/Workbooks folder, all your subsequent runs will be affected.

NOTE: You will need to escape backslashes by using double slashes.

"CustomWorkbookTemplatesDir": "C:\\Users\\Full Path\\My Awesome Workbooks",

Saving Output in a Different Directory

By default, LogShark saves the resulting workbooks in an Output folder in the directory from where it was ran. If you want to specify a different directory, add a full path to the OutputDir variable in the config file.

NOTE: You need to escape backslashes by using double slashes.

"OutputDir": "C:\\Users\\Full Path\\All the answers you need",

Providing a custom name for your project folder

LogShark creates a project folder where all generated workbooks are saved. The default name of a project is Timestamp-MachineName-FileName, where Timestamp is the timestamp that indicates when the logs were processed, MachineName is the name of the computer where LogShark was run, and FileName is the name of the archive file. The project contains all the workbooks for the archive file. If you want to replace MachineName-FileName portion with your own RunID, you can do so by specifying the Run ID in the command line. The resulting project folder will be named Timestamp-RunID, where RunID is the runID you provided in the command line.

   LogShark <LogSetLocation> <RunId>

Attach Logset’s Name to the Workbook

If you are working on several logsets at the same time, having several Apache workbooks open at the same time can get confusing quickly. With this version you can differentiate between workbooks by attaching the name of the logset to the workbook name by setting AppendLogsetNameToOutput to true. The resulting workbooks will be named **_.twbx**, e.g. **Apache_TinyLog.twbx**.

"AppendLogsetNameToOutput": true

You can also override the config value in command line using --workbookname "<string>"command.


Controlling which plugins run by default

The PluginsConfiguration.DefaultPluginSet section controls which plugins are used when --plugins is not specified, or when --plugins All is requested:

"PluginsConfiguration": {
    "DefaultPluginSet": {
      "PluginsToRunByDefault": "",
      "PluginsToExcludeFromDefaultSet": "Replayer"
    }
}

This same section also holds per-plugin configuration (for example Apache.IncludeGatewayChecks, VizqlDesktop.MaxQueryLength), nested under PluginsConfiguration:<PluginName>.


Hyper extract generation timeout

The HyperProcess section controls the timeout for the underlying Hyper process used to generate .hyper extracts:

"HyperProcess": {
    "external_stream_timeout": "10h"
}

LogShark’s own log files

LogShark saves a log of each run (useful for troubleshooting) in the Logs folder of the LogShark install location. Each run creates a file named <FileNamePrefix>-<timestamp>-<logset name>.log. Use the Logging section of the config file to control this:

"Logging": {
    "Directory": "Logs",
    "FileNamePrefix": "LogShark",
    "FileSizeLimitBytes": 10485760,
    "RetainedFileCountLimit": 5
}

Note: Older versions of LogShark used PathFormat and Json settings in this section. These are no longer used. If you are carrying over a config file from an earlier version, replace them with the settings above.


Loading additional plugins

LogShark can load additional plugins from a folder at run time. Set DynamicPluginsDirectory in the EnvironmentConfig section to the folder containing the plugin assemblies (.dll files), or use the --dynamic-plugins-dir command line option, which takes priority over the config file. Leave the setting as null to disable this feature.

"EnvironmentConfig": {
    "DynamicPluginsDirectory": "C:\\LogSharkPlugins"
}

Use an absolute path. A relative path is resolved from the LogShark install location, not from the folder you run LogShark in. Once loaded, an additional plugin is run like any other, by adding its name to --plugins. If an additional plugin has the same name as a built-in plugin, the built-in plugin is used.