{"id":17586837,"url":"https://github.com/anyks/acu","last_synced_at":"2026-05-10T09:35:22.697Z","repository":{"id":258386225,"uuid":"861069764","full_name":"anyks/acu","owner":"anyks","description":"ANYKS - convert utility","archived":false,"fork":false,"pushed_at":"2024-10-23T20:36:13.000Z","size":1973,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-24T08:20:51.089Z","etag":null,"topics":["anyks","cef","csv","grok","ini","json","syslog","utility","xml","yaml"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anyks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-21T23:16:37.000Z","updated_at":"2024-10-23T20:34:44.000Z","dependencies_parsed_at":"2024-12-29T01:30:52.263Z","dependency_job_id":null,"html_url":"https://github.com/anyks/acu","commit_stats":null,"previous_names":["anyks/acu"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anyks%2Facu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anyks%2Facu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anyks%2Facu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anyks%2Facu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anyks","download_url":"https://codeload.github.com/anyks/acu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246223267,"owners_count":20743158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anyks","cef","csv","grok","ini","json","syslog","utility","xml","yaml"],"created_at":"2024-10-22T03:06:30.782Z","updated_at":"2026-05-10T09:35:22.692Z","avatar_url":"https://github.com/anyks.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![ANYKS - convert utility](https://raw.githubusercontent.com/anyks/acu/main/img/banner.jpg)](https://anyks.com)\n\n# ANYKS - convert utility (ACU) C++\n\n### Format compatibility\n| **#**      | **XML** | **JSON** | **YAML** | **INI** | **CSV** | **CEF** | **SYSLOG** | **GROK** |\n|------------|---------|----------|----------|---------|---------|---------|------------|----------|\n| **XML**    | Yes     | Yes      | Yes      | Yes     | Yes     | Yes     | Yes        | Yes      |\n| **JSON**   | Yes     | Yes      | Yes      | Yes     | Yes     | Yes     | Yes        | Yes      |\n| **YAML**   | Yes     | Yes      | Yes      | Yes     | Yes     | Yes     | Yes        | Yes      |\n| **INI**    | Yes     | Yes      | Yes      | Yes     | No      | No      | No         | No       |\n| **CSV**    | No      | Yes      | Yes      | No      | Yes     | No      | No         | No       |\n| **CEF**    | No      | Yes      | Yes      | No      | No      | No      | No         | No       |\n| **SYSLOG** | No      | Yes      | Yes      | No      | No      | No      | No         | No       |\n\n## Requirements\n\n- [AWH](https://gitflic.ru/project/anyks/awh)\n- [LibXML2](https://gitflic.ru/project/third_party/libxml2)\n- [YAML-CPP](https://gitflic.ru/project/third_party/yaml-cpp)\n\n## To build and launch the project\n\n### To clone the project\n\n```bash\n$ git clone --recursive https://gitflic.ru/project/anyks/acu.git\n```\n\n### Activate SCTP only (FreeBSD / Linux)\n\n#### FreeBSD\n\n```bash\n$ sudo kldload sctp\n```\n\n#### Linux (ALT)\n\n```bash\n$ sudo apt-get install liblksctp-devel\n$ sudo modprobe sctp\n$ sudo sysctl -w net.sctp.auth_enable=1\n```\n\n#### Linux (Ubuntu)\n\n```bash\n$ sudo apt install libsctp-dev\n$ sudo modprobe sctp\n$ sudo sysctl -w net.sctp.auth_enable=1\n```\n\n#### Linux (Fedora)\n\n```bash\n$ sudo yum install lksctp-tools-devel\n$ sudo modprobe sctp\n$ sudo sysctl -w net.sctp.auth_enable=1\n```\n\n#### Linux (openSUSE)\n\n```bash\n$ sudo zypper install lksctp-tools-devel\n$ sudo modprobe sctp\n$ sudo sysctl -w net.sctp.auth_enable=1\n```\n\n### Build third party for MacOS X, Linux, FreeBSD and Solaris\n\n```bash\n$ ./build_third_party.sh\n```\n\n### Build on MacOS X, Linux, FreeBSD and Solaris\n\n```bash\n$ mkdir ./build\n$ cd ./build\n\n$ cmake \\\n -DCMAKE_BUILD_TYPE=Release \\\n -DCMAKE_SHARED_BUILD_LIB=YES \\\n ..\n\n$ make\n```\n\n### Build on Windows [MSYS2 MinGW]\n\n#### Development environment configuration\n- [GIT](https://git-scm.com)\n- [Perl](https://strawberryperl.com)\n- [Python](https://www.python.org/downloads/windows)\n- [MSYS2](https://www.msys2.org)\n- [CMAKE](https://cmake.org/download)\n\n#### Assembly is done in MSYS2 - MINGW64 terminal\n\n```bash\n$ pacman -Syuu\n$ pacman -Ss cmake\n$ pacman -S mingw64/mingw-w64-x86_64-cmake\n$ pacman -S make\n$ pacman -S curl\n$ pacman -S wget\n$ pacman -S mc\n$ pacman -S gdb\n$ pacman -S bash\n$ pacman -S clang\n$ pacman -S git\n$ pacman -S autoconf\n$ pacman -S --needed base-devel mingw-w64-x86_64-toolchain\n$ pacman -S mingw-w64-x86_64-dlfcn\n```\n\n### Build third party for MS Windows\n```bash\n$ ./build_third_party.sh\n```\n\n#### Project build\n\n```bash\n$ mkdir ./build\n$ cd ./build\n\n$ cmake \\\n -G \"MSYS Makefiles\" \\\n -DCMAKE_BUILD_TYPE=Release \\\n -DCMAKE_SYSTEM_NAME=Windows \\\n -DCMAKE_SHARED_BUILD_LIB=YES \\\n ..\n\n$ cmake --build .\n```\n\n### Example convert text to Base64\n```bash\n$ echo 'Hello World!!!' | acu -from text -to base64\n```\n\n---\n\n### Example convert Base64 to text\n```bash\n$ echo 'SGVsbG8gV29ybGQhISE=' | acu -from base64 -to text\n```\n\n---\n\n### Example convert text to MD5\n```bash\n$ echo 'Hello World!!!' | acu -from text -to MD5\n```\n\n---\n\n### Example convert text to HMAC SHA256\n```bash\n$ echo 'Hello World!!!' | acu -from text -to SHA256 -hmac 236bf30c70dc03f69175f030afbe38f3\n```\n\n---\n\n### Example convert JSON to XML\n```bash\n$ echo '{\"Hello\": \"World!!!\"}' | acu -from json -to xml -prettify\n```\n\n---\n\n### Example convert JSON to XML from file\n```bash\n$ acu -from json -to xml -src ./example.json -prettify\n```\n\n#### OR\n```bash\n$ acu -from json -to xml -src ./example.json -dest ./result -prettify\n```\n\n---\n\n### Example convert CSV to XML from file\n```bash\n$ acu -from csv -to xml -src ./example.csv -header -prettify\n```\n\n#### OR\n```bash\n$ acu -from csv -to xml -src ./example.csv -dest ./result -header -prettify\n```\n\n---\n\n### Example convert JSON to CSV from file\n```bash\n$ acu -from json -to csv -src ./example.json -delim \",\"\n```\n\n#### OR\n```bash\n$ acu -from json -to csv -src ./example.json -dest ./result -delim \",\"\n```\n\n---\n\n### Example convert CEF to XML from file\n```bash\n$ acu -from cef -to xml -src ./example.txt -cef low -prettify\n```\n\n#### OR\n```bash\n$ acu -from cef -to xml -src ./example.txt -dest ./result -cef low -prettify\n```\n\n---\n\n### Example convert GROK to XML without patterns from file\n```bash\n$ acu -from grok -to xml -src ./example.txt -express ./express.txt -prettify\n```\n\n#### OR\n```bash\n$ acu -from grok -to xml -src ./example.txt -express ./express.txt -dest ./result -prettify\n```\n\n---\n\n### Example convert GROK to XML with patterns from file\n```bash\n$ acu -from grok -to xml -src ./example.txt -express ./express.txt -patterns ./patterns.json -prettify\n```\n\n#### OR\n```bash\n$ acu -from grok -to xml -src ./example.txt -express ./express.txt -patterns ./patterns.json -dest ./result -prettify\n```\n\n---\n\n### Example convert JSON to XML from folder\n```bash\n$ acu -from json -to xml -src ./input -dest ./result -prettify\n```\n\n---\n\n### Converting numbers from decimal to binary\n```bash\n$ echo \"3369\" | acu -notation -from 10 -to 2\n```\n\n### Converting numbers from Arabic to Roman numerals\n```bash\n$ echo \"3369\" | acu -notation -from 10 -to 1\n```\n\n### Converting numbers from binary to decimal\n```bash\n$ echo \"0000110100101001\" | acu -notation -from 2 -to 10\n```\n\n### Convert text to binary\n```bash\n$ echo \"Hello World\" | acu -notation -from 0 -to 2\n```\n\n### Converting from binary to text\n```bash\n$ echo \"0110010001101100011100100110111101010111001000000110111101101100011011000110010101001000\" | acu -notation -from 2 -to 0\n```\n\n---\n\n### Generate date from timestamp\n```bash\n$ echo \"1740268539834\" | acu -date -from timestamp -to date -formatDate \"%a, %d %b %Y %H:%M:%S %Z\"\n```\n\n### Generate timestamp from date\n```bash\n$ echo \"Sun, 23 Feb 2025 02:55:39 MSK\" | acu -date -to timestamp -from date -formatDate \"%a, %d %b %Y %H:%M:%S %Z\"\n```\n\n---\n\n### Convert seconds to minutes\n```bash\n$ echo \"120\" | acu -seconds -from s -to m\n```\n\n### Convert seconds to hours\n```bash\n$ echo \"16200\" | acu -seconds -from s -to h\n```\n\n### Convert seconds to days\n```bash\n$ echo \"1555200\" | acu -seconds -from s -to d\n```\n\n### Convert Seconds to Weeks\n```bash\n$ echo \"1555200\" | acu -seconds -from s -to w\n```\n\n### Convert seconds to months\n```bash\n$ echo \"7884000\" | acu -seconds -from s -to M\n```\n\n### Convert seconds to years\n```bash\n$ echo \"7884000\" | acu -seconds -from s -to y\n```\n\n---\n\n### Convert bytes to kilobytes\n```bash\n$ echo \"4096\" | acu -bytes -from b -to Kb\n```\n\n### Convert bytes to megabytes\n```bash\n$ echo \"4096\" | acu -bytes -from b -to Mb\n```\n\n### Convert bytes to gigabytes\n```bash\n$ echo \"34896609280\" | acu -bytes -from b -to Gb\n```\n\n### Convert bytes to terabytes\n```bash\n$ echo \"3188583720550.4\" | acu -bytes -from b -to Tb\n```\n\n---\n\n## Creating installation packages\n\n### Creating a tar.gz archive\n```bash\n$ ./make_tar_archive.sh\n```\n\n### Creating a deb package\n```bash\n$ ./linux_make_deb.sh\n```\n\n### Creating an rpm package\n```bash\n$ ./linux_make_rpm.sh\n```\n\n### Creating an Installation Package for MacOS X\n```bash\n$ ./make_installer_macos.sh\n```\n\u003e Installation package will be located in the directory **./package/MacOS/target/pkg**\n\n### Create exe package\n```bash\n$ ./windows_make_installer.sh\n```\n\u003e To create an installation package, you need to open the **install.iss** file from the **win** directory in the application [Inno Setup](https://jrsoftware.org/isinfo.php)\n\n## Installation from the installation package\n\n### Installation from tar.gz\n```bash\n$ tar -xzvf ./acu_1.0.0_MacOSX_arm64.tar.gz -C /\n```\n\n### Installation from deb package\n```bash\n$ sudo dpkg -i ./acu_1.0.0-1~buster_amd64.deb\n```\n\n### Installation from rpm package\n```bash\n$ sudo rpm -i ./acu-1.0.0-1.amd64.rpm\n```\n\n---\n\n## Basic launch parameters\n\n### Getting the version application\n```bash\n$ acu -V\n\n## Result:\n# \n# ANYKS - conversion utility 1.0.4 (built: Oct 31 2024 21:22:56)\n# awh: 4.2.6\n# target: MacOS X\n# installed dir: /opt/acu/bin\n# \n# *\n# * site:     https://acu.anyks.com\n# * email:    info@anyks.com\n# * telegram: @forman\n# *\n#\n```\n\u003e There are several ways to get the version of an application, the short version is **\"-V\"** or the full version is **\"--version\"**.\n\n### Getting reference information\n```bash\n$ acu -H\n\n## Result:\n# \n# usage: acu [-V | --version] [-H | --info] [\u003cargs\u003e]\n# \n# \n# [FLAGS]\n# + Flag for generating headers when parsing CSV files: [-header | --header]\n# \n# + Flag for generating a readable file format (XML or JSON): [-prettify | --prettify]\n# \n# + Display application version: [-version | --version | -V]\n# \n# + Display information about available application functions: [-info | --info | -H]\n# \n# [ARGS]\n# + CEF file parsing mode: [-cef \u003cvalue\u003e | --cef=\u003cvalue\u003e]\n#   - (LOW | MEDIUM | STRONG)\n# \n# + Format of the file from which reading is performed: [-from \u003cvalue\u003e | --from=\u003cvalue\u003e]\n#   - (XML | JSON | INI | YAML | CSV | CEF | SYSLOG | GROK | TEXT | BASE64)\n# \n# + File format to which the writing is made: [-to \u003cvalue\u003e | --to=\u003cvalue\u003e]\n#   - (XML | JSON | INI | YAML | CSV | CEF | SYSLOG | TEXT | BASE64 | MD5 | SHA1 | SHA224 | SHA256 | SHA384 | SHA512)\n# \n# + Format date (if required): [-formatDate \"\u003cvalue\u003e\" | --formatDate=\"\u003cvalue\u003e\"]\n#   - ( %m/%d/%Y %H:%M:%S | %H:%M:%S %d.%m.%Y | ... )\n# \n# + Logging level (if required): [-logLevel \u003cvalue\u003e | --logLevel=\u003cvalue\u003e]\n#   - ( 0 = NONE | 1 = INFO | 2 = WARNING | 3 = CRITICAL | 4 = INFO and WARNING | 5 = INFO and CRITICAL | 6 = WARNING CRITICAL | 7 = ALL)\n# \n# + Hash-based message authentication code: [-hmac \u003cvalue\u003e | --hmac=\u003cvalue\u003e]\n# \n# + File address for writing logs (if required): [-log \u003cvalue\u003e | --log=\u003cvalue\u003e]\n# \n# + File or directory address for saving converted files: [-dest \u003cvalue\u003e | --dest=\u003cvalue\u003e]\n# \n# + Separator for parsing CSV files (default: \";\"): [-delim \u003cvalue\u003e | --delim=\u003cvalue\u003e]\n# \n# + Address of the file or directory with files to convert: [-src \u003cvalue\u003e | --src=\u003cvalue\u003e]\n# \n# + Address of the file in JSON format with GROK templates: [-patterns \u003cvalue\u003e | --patterns=\u003cvalue\u003e]\n# \n# + Address of the file with the regular expression in GROK format: [-express \u003cvalue\u003e | --express=\u003cvalue\u003e]\n# \n```\n\u003e There are several ways to get help information, the short version is **\"-H\"** or the full version is **\"--info\"**.\n\n### General concepts\n\nIt should be explained in advance that the launch parameters can be specified in any order; there is a full and short form for setting the launch parameters.\n\n- **Full form:** --\u003cNAME\u003e=\u003cVALUE\u003e\n- **Short form:** -\u003cNAME\u003e \u003cVALUE\u003e\n\u003e For example, the entries **--config=config.json** and **-config config.json** are equivalent.\n\nTo simplify work with **ACU Server**, there is a configuration file in **JSON** format, all startup parameters can be specified in this configuration file. By default, each operating system has its own set of paths by which **ACU Server** searches for the configuration file. The path by which **ACU Server** will search for the configuration file is specified in the **[PATHS]** section of the reference information. The address of the configuration file can be specified independently using the **config** parameter.\n\nFor **UNIX-like** operating systems, parameters can be specified using environment variables with the **ACU_** prefix.\n\n---\n\n## Description of the ACU Server configuration file\n\n### Configuration file example\n```json\n{\n\t\n\t\"ssl\": {\n\t\t\"key\": \"\",\n\t\t\"cert\": \"\",\n\t\t\"verify\": false\n\t},\n\t\"net\": {\n\t\t\"ipv\": 4,\n\t\t\"wait\": 15,\n\t\t\"sonet\": \"tcp\",\n\t\t\"host\": \"127.0.0.1\",\n\t\t\"port\": 2222,\n\t\t\"proto\": \"http2\",\n\t\t\"unixSocket\": \"\",\n\t\t\"total\": 100,\n\t\t\"ipv6\": false,\n\t\t\"filter\": {\n\t\t\t\"type\": \"mac\",\n\t\t\t\"black\": [],\n\t\t\t\"white\": []\n\t\t},\n\t\t\"compress\": [\n\t\t\t\"ZSTD\",\n\t\t\t\"BROTLI\",\n\t\t\t\"GZIP\",\n\t\t\t\"DEFLATE\"\n\t\t],\n\t\t\"authentication\": {\n\t\t\t\"enabled\": false,\n\t\t\t\"auth\": \"Basic\",\n\t\t\t\"digest\": \"MD5\",\n\t\t\t\"users\": {\"admin\": \"admin\"}\n\t\t},\n\t\t\"bandwidth\": {\n\t\t\t\"read\": \"20Mbps\",\n\t\t\t\"write\": \"20Mbps\"\n\t\t}\n\t},\n\t\"workers\": 0,\n\t\"user\": \"auto\",\n\t\"group\": \"auto\",\n\t\"maxRequests\": 600,\n\t\"root\": \"./html\",\n\t\"log\": \"./acu.log\",\n\t\"pidfile\": \"acu.pid\",\n\t\"index\": \"index.html\",\n\t\"favicon\": \"./icons/icon.ico\",\n\t\"origin\": \"http://127.0.0.1:2222\",\n\t\"formatDate\": \"%H:%M:%S %d.%m.%Y\"\n}\n```\n\n### Description of configuration file parameters\n| **Parameter name**     | **Parameter Description** |\n|------------------------|---------------------------|\n| **ssl** | Object of parameters for **secure network SSL connection** to network services. |\n| **ssl.verify** | Parameter for activating the **SSL certificate validity check** mode. |\n| **ssl.key** | Key of the certificate file in the file system, for working in secure server mode. |\n| **ssl.cert** | Certificate file in the file system, for working in secure server mode. |\n| **server** | Server parameters |\n| **server.ipv** | Supported Internet Protocol Type **IPv4** or **IPv6**. |\n| **server.wait** | Time to wait for data to be received from the client in seconds. |\n| **server.sone** | Internet connection protocol (TCP, TLS, SCTP). |\n| **server.host** | Server host through which the connection is made. |\n| **server.port** | Server port through which the connection is made. |\n| **server.proto** | Default server application protocol (http or http2). |\n| **server.unixSocket** | Name of the **Unix socket** in the file system, through which the connection to the server will be made. The Unix socket will be located in the **/tmp** directory. |\n| **server.total** | Number of clients simultaneously connected to one server. |\n| **server.ipv6** | Perform server communication only via **IPv6**. |\n| **server.filter** | An object that filters the list of clients connecting to the server. |\n| **server.filter.type** | Filter clients by **MAC** or **IP** address. |\n| **server.filter.black** | List of clients that are prohibited from connecting to the server. |\n| **server.filter.white** | List of clients that are only allowed to connect to the server. |\n| **server.compres** | List of compressors supported by the server, in priority order (ZSTD, BROTLI, GZIP, DEFLATE, LZ4, LZMA, BZIP2). |\n| **server.authentication** | Server authorization parameters object. |\n| **server.authentication.enabled** | Parameter for activating the authorization mode on the server. |\n| **server.authentication.auth** | Server authorization method **Basic** or **Digest**. |\n| **server.authentication.digest** | Hash type for the **Digest** authentication method (**MD5**, **SHA1**, **SHA256**, **SHA512**). |\n| **server.authentication.username** | Username for authorization on the server. |\n| **server.authentication.password** | User password for authorization on the server. |\n| **server.bandwidth** | Object of network connection speed limit parameters for the server. |\n| **server.bandwidth.read** | Maximum data transfer rate in read mode. |\n| **server.bandwidth.write** | Maximum data transfer rate in recording mode. |\n| **workers** | Number of cluster processes, if the value is not set or set to -1, the cluster will not be activated. Set to 0, the cluster will automatically create the number of processes for your machine. |\n| **user** | Name or user ID under which the application should be launched. The \"auto\" parameter sets the current user. |\n| **group** | Name or identifier of the user group under which the application should be launched. The \"auto\" parameter sets the current user group. |\n| **maxRequests** | Maximum number of requests to the server per day available to one specific user. |\n| **root** | Catalog with the site location in HTML format. |\n| **log** | Address of the log file where the processes occurring on the server will be recorded. |\n| **pidfile** | Name of the **PID file** located in the **/var/run** directory to record the identifier of the active process in a unix-like operating system. |\n| **index** | An index HTML file that is opened by default by the server when a client's root request occurs. |\n| **favicon** | Address to the site icon file. |\n| **origin** | Website address that the client must send to the server in the **Origin** HTTP header. |\n| **formatDate** | Format of the date and time displayed when logging processes on the server. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanyks%2Facu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanyks%2Facu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanyks%2Facu/lists"}