Skip to content

extracts different types of information out of your XMRig log-file and saves it to dedicated files

License

Notifications You must be signed in to change notification settings

Dat-Pudding/XMCleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github All Releases GitHub release GitHub Release Date GitHub license GitHub stars GitHub forks

XMCleaner

Extracts information about hashrates, accepted/rejected shares and newly received jobs from your standard XMRig log-file and saves it to respectively dedicated files in CSV format.

What can it do?

NOTE: As of right now it's pretty bare-bones, this will change in the near future.

When run in default mode (without a given filter mode) it will take the specified logfile and extract all lines that contain the hashrate reports with their timestamps. By choosing one of the three available filter modes the lines that should be extracted can be set.

How to use

You can run it either manually via command line or append it to your start.cmd in the XMRig directory to have it run as soon as XMRig stops and therefore automatically stripping the most recent log-file.

For it to have any data to work with it is obligatory to enable log-files in XMRig. You can do this by just appending a -l yourLogfileNameHere to your usual xmrig.exe <YOUR_MINING_CREDENTIALS> setup line.

General usage

Independent of the platform, the overall usage syntax will always be as follows:

<executable> <logFilePath> <extractFilePath> <filterMode>

And the individual parameters consist of the following:

Command/Parameter Description
<executable> Unless renamed and depending on the platform either XMCleaner.exe or XMCleaner
<logFilePath> The file path AND file name of XMRig's log-file.
  • Can be absolute or relative to the executable
  • Has to be explicit with the file extension if the target file has one
  • Should be the same as the one specified in XMRig settings

  • Example: ./logs/miner.log
    <extractFilePath> The file path AND name of the desired output file.
  • Can be absolute or relative to the executable
  • Has to be explicit with the file extension
  • If a subdirectory is desired as target, this subdirectory has to already exist

  • Example: ./cleaned/hashRates.csv
    <filterMode> Defines the type of extracted information
  • -h extracts hashrate information
  • -j extracts new-job-reception information
  • -s extracts accepted/rejected share information
  • Syntax examples

    On Windows:

    XMCleaner.exe miner.log ./cleaned/hashes.csv -h

    On Linux:

    XMCleaner miner.log ./cleaned/hashes.csv -h

    Examples

    Usage examples - Windows

    Given a directory structure like this:

    [C:\]═╦[\xmrig\]═╦[\cleaned\]
          ╠[<other>] ╠[SHA256sums]
          ╚[<stuff>] ╠[XMCleaner.exe]
                     ╠[miner.log]
                     ╠[WinRing64]
                     ╠[start.cmd]
                     ╚[xmrig.exe]
    

    We can either directly run it from the command line with:

    C:\xmrig\XMCleaner.exe miner.log .\cleaned\hashes.csv -h

    After which we'll find hashes.csv within the \cleaned\ directory, containing our extracted information and making our structure look like this:

    [C:\]═╦[\xmrig\]═╦[\cleaned\]══[hashes.csv]
          ╠[<other>] ╠[other]
          ╚[<stuff>] ╚[stuff]
    

    Or in case that we want to keep it updating the output after each mining session we simply edit XMRig's start.cmd content from this:

    @echo off
    cd /d "%~dp0"
    xmrig.exe <YOUR_MINING_CREDENTIALS> -l miner.log
    pause

    To this:

    @echo off
    cd /d "%~dp0"
    xmrig.exe <YOUR_MINING_CREDENTIALS> -l miner.log
    XMCleaner.exe miner.log .\cleaned\hashes.csv -h
    del miner.log
    pause

    Since multi-filtering (more than one filterMode at a time) isn't yet implemented, to get all available output information we have to write it like this:

    @echo off
    cd /d "%~dp0"
    xmrig.exe <YOUR_MINING_CREDENTIALS> -l miner.log
    XMCleaner.exe miner.log .\cleaned\hashes.csv -h
    XMCleaner.exe miner.log .\cleaned\shares.csv -s
    XMCleaner.exe miner.log .\cleaned\jobs.csv -j
    del miner.log
    pause

    This will result in our exemplary directory structure looking like this:

    [C:\]═╦[\xmrig\]═╦[\cleaned\]═╦[hashes.csv]
          ╠[<other>] ╠[other]     ╠[shares.csv]
          ╚[<stuff>] ╚[stuff]     ╚[jobs.csv]
    

    We have added del miner.log here as to mitigate already stripped lines from being read twice. Leave it out if you have other ways of dealing with duplicate lines in e.g. your data processing software.

    Compiling

    You can either build it yourself from the code in /source/ by importing the code files into an empty project/solution or download the latest release in the releases section.

    When compiling yourself make sure to use at least C++17 or newer, since the code utilises the non-experimental std::filestream for interacting with the input and output files. The code itself was written in a C++22 environment.

    A CMake/Premake will be available soon, I got to get a hang of it first.

    About

    extracts different types of information out of your XMRig log-file and saves it to dedicated files

    Resources

    License

    Stars

    Watchers

    Forks

    Packages

    No packages published

    Languages