Extraction of Configuration from Log File
This tutorial shows how to extract configuration from the log file. Sometimes you may get confused with the configuration file that you think you used and the log file that is really used. It is getting more and more difficult to understand the configuration that is used for a specific test due to too many #if statements in the log. For all of these case, the configuration extracted from the log file would help.
When do you want to use this tool ? Following is the some of my cases : (In any of these cases, you may extract the configuration from the log and save it as a file if you want)
- I got a log and configuration file from somebody, but they don't seem to match. so I want to check out the configuration that are really used in the test
- I got a log from somebody without the configuration file and I want to duplicate the configuration and try the test in my system.
Table of Contents
- Extraction of Configuration from Log File
- Where is the tool ?
- Where is Configuration in the log ?
- Extracting the Configuration
- Extracting A Component from Configuration File
- Extracting the Configuration into a file
- Extracting Configuration file from a log file without Text Copy
- Stripping the Configuration file
Introduction
In complex software testing environments, accurately understanding and replicating the configuration used during a specific test execution can be challenging. Configuration management becomes especially intricate when multiple conditional compilation directives (such as #if statements) are present in the codebase, or when configuration files and log files become desynchronized. This tutorial focuses on the technical process of extracting configuration information directly from a log file, which is invaluable in scenarios where the original configuration file is missing, mismatched, or heavily obfuscated by dynamic conditions. The extraction process involves parsing log files to reconstruct the set of configuration parameters actually utilized during a test run, independent of the original configuration file structure or order. This method ensures reproducibility of test conditions, aids in debugging, and fosters a deeper understanding of the runtime environment. By leveraging log file analysis, engineers can reconstruct configuration files that reflect the real operational context, thereby enhancing traceability, auditability, and troubleshooting capabilities in software quality assurance workflows. While the order of parameters in the extracted configuration may not match the original, the functional equivalence allows seamless re-execution of tests, making this technique an essential tool within the broader ecosystem of configuration management and test automation.
-
Context and Background
- Configuration extraction addresses the frequent mismatch between intended and actual test setups, which often results from conditional compilation, environmental overrides, or undocumented changes.
- Log files serve as a definitive source of truth for the configuration parameters that were active during test execution, capturing the resolved runtime environment as opposed to potentially stale configuration files.
- This approach is particularly relevant in collaborative settings where logs and configuration files are exchanged and may not always be in sync.
-
Relevance and Importance
- Ensures reproducibility of test conditions by providing a reliable means to reconstruct the exact configuration used during execution.
- Facilitates root cause analysis and debugging by clarifying which configuration parameters influenced test outcomes.
- Enables effective collaboration and knowledge transfer, especially when configuration artifacts are incomplete or ambiguous.
-
What Learners Will Gain
- Technical knowledge of parsing log files to accurately extract configuration parameters.
- Ability to reconstruct functional configuration files from logs, regardless of parameter order or conditional logic.
- Skills to validate, duplicate, and execute tests using configurations derived from logs, thereby improving test reliability and auditability.
- Understanding of the limitations and best practices for comparing extracted configurations with original files.
-
Prerequisite Knowledge or Skills
- Familiarity with software testing concepts and configuration management.
- Basic understanding of log file structure and syntax.
- Experience with text parsing techniques or scripting (e.g., Python, awk, sed) is advantageous.
- Awareness of conditional compilation and preprocessor directives (such as #if statements) in source code.
Summary of the Tutorial
This document provides a comprehensive guide for extracting and processing configuration data from log files and configuration files using the json_util tool. The following summarizes the procedures and methodologies described:
-
Tool Location:
- The json_util extraction tool is located in the
/root/otsdirectory.
- The json_util extraction tool is located in the
-
Locating Configuration in Log Files:
- At the beginning of a log file, the configuration is stored as compressed text.
-
Extracting Configuration from Log Files:
- To extract the configuration directly from a log file, use:
./json_util config file:<filename>
Example:./json_util config file:/tmp/gnb0.log - To save the extracted configuration to a file, redirect the output:
./json_util config file:/tmp/gnb0.log > /tmp/mygnb.cfg
- To extract the configuration directly from a log file, use:
-
Extracting Configuration from Text:
- Run json_util with the configuration text input and press enter to obtain the extracted configuration.
-
Extracting a Specific Component from a Configuration File:
- To dump a specific component, use:
./json_util dump <configuration_file> <component_name> - Examples:
./json_util dump /root/enb/config/gnb-sa.cfg nr_cell_list
./json_util dump /root/enb/config/gnb-sa.cfg rf_driver
- To dump a specific component, use:
-
Extracting Configuration File from Log File without Text Copy:
- Configuration can be extracted directly from a log file without manual copy-paste using:
./json_util -n log /tmp/gnb0.log - Ensure the log file exists prior to running the command.
- Configuration can be extracted directly from a log file without manual copy-paste using:
-
Verifying Extracted Configuration:
- Once extracted and saved, open the configuration file to confirm its contents.
-
Stripping Flags and Conditions from Configuration Files:
- For config files containing preprocessor flags (e.g.,
#define,#if), use json_util to strip these and output only the effective configuration: - Command example:
./json_util dump /root/enb/config/gnb-sa.cfg - This outputs the configuration as it is used at runtime, removing conditional compilation elements.
- For config files containing preprocessor flags (e.g.,
-
Maintaining Output Order:
- To print the configuration output in the same order as the original file, use the
-noption:
./json_util -n dump /root/enb/config/gnb-sa.cfg
- To print the configuration output in the same order as the original file, use the
In summary, the procedures cover multiple methods for extracting, saving, and refining configuration data from log and configuration files using the json_util tool. Each method provides flexibility depending on the source format and desired output, including the capability to extract specific components, handle files with compile-time flags, and control output formatting.
Where is the tool ?
You can find the extraction tool (json_util) at /root/ots directory as shown below.

Where is Configuration in the log ?
At the beginning of a log file, you will find the compressed text of the configuration as shown below.

Extracting the Configuration
There are a few different ways to extract the configuration contained in the log as shown below.
Extracting from the log file
you can extract the configuraion directly from the log file using the syntax : ./json_util config file:<filename>
|
./json_util config file:/tmp/gnb0.log |
If you want to save the extracted configuration into a file, you can do as shown below.
|
./json_util config file:/tmp/gnb0.log > /tmp/mygnb.cfg |
Extracting from the text
Run the json_util with the configuration text as shown below and hit enter.

You will get the extracted configuration as follows.

Extracting A Component from Configuration File
With this tool, you can dump a specific component from a configuration file using ./jason_util dump <configuration_file><component_name> as shown in the examples below.
|
[root@CBC-2021050100 ots]# ./json_util dump /root/enb/config/gnb-sa.cfg nr_cell_list
[ { "band": 78, "cell_id": 1, "dl_nr_arfcn": 632628, "rf_port": 0, "ssb_pos_bitmap": "10000000", "subcarrier_spacing": 30 } ] |
|
[root@CBC-2021050100 ots]# ./json_util dump /root/enb/config/gnb-sa.cfg rf_driver
{ "args": "dev0=/dev/sdr0", "name": "sdr", "rx_antenna": "rx" } |
Extracting the Configuration into a file
You can extract the log into a file as shown below

Open the saved file and confirm.

Extracting Configuration file from a log file without Text Copy
You can extract the configuration directly from the specified log file without manual copy & paste from the log file as shown in this example. (
|
[root@CBC-2023010100 ots]# ./json_util -n log /tmp/gnb0.log { "amf_list": [ { "amf_addr": "127.0.1.100" } ], "cell_list": [], "com_addr": "[::]:9001", "en_dc_support": true, "gnb_id": 74565, "gnb_id_bits": 28, "gtp_addr": "127.0.1.1", "gtp_use_packet_bundling": true, "log_filename": "/tmp/gnb0.log", "log_options": "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1", "nr_cell_default": { "bandwidth": 5, "cell_barred": false, "cipher_algo_pref": [], "csi_rs": { "csi_report_config": [ { "period": 80, "report_config_type": "periodic" } ], "resource_auto": { "nzp_csi_rs_period": 80 } }, "dmrs_type_a_pos": 2, "drb_config": "drb_nr.cfg", "inactivity_timer": 10000, "integ_algo_pref": [2, 1], "intra_freq_reselection": true, "mac_config": { "dl_max_consecutive_retx": 30, "dl_max_harq_tx": 5, "msg3_max_harq_tx": 5, "periodic_bsr_timer": 20, "periodic_phr_timer": 500, "phr_tx_power_factor_change": "dB3", "prohibit_phr_timer": 200, "retx_bsr_timer": 320, "sr_prohibit_timer": 0, "sr_trans_max": 64, "ul_max_consecutive_retx": 30, "ul_max_harq_tx": 5 }, "n_antenna_dl": 1, "n_antenna_ul": 1, "n_id_cell": 500, "pdcch": { "al_index": 1, "coreset0_index": 1, "css": { "n_candidates": [0, 0, 4, 0, 0] }, "dedicated_coreset": { "duration": 0, "l_crb": -1, "precoder_granularity": "sameAsREG_bundle", "rb_start": -1 }, "rar_al_index": 2, "search_space0_index": 0, "si_al_index": 2, "uss": { "dci_0_1_and_1_1": true, "n_candidates": [0, 4, 0, 0, 0] } }, "pdsch": { "dmrs_add_pos": 1, "dmrs_max_len": 1, "dmrs_type": 1, "mapping_type": "typeA", "mcs_table": "qam256", "rar_mcs": 2, "si_mcs": 6 }, "plmn_list": [ { "nssai": [ { "sst": 1 } ], "plmn": "00101", "reserved": false, "tac": 100 } ], "prach": { "cb_preambles_per_ssb": 8, "msg1_fdm": 1, "msg1_frequency_start": -1, "power_ramping_step": 4, "prach_config_index": 7, "preamble_received_target_power": -110, "preamble_trans_max": 7, "ra_contention_resolution_timer": 64, "ra_response_window": 10, "restricted_set_config": "unrestricted_set", "ssb_per_prach_occasion": 1, "zero_correlation_zone_config": 15 }, "pucch": { "p0_nominal": -96, "resource_auto": {} }, "pusch": { "beta_offset_ack_index": 9, "dmrs_add_pos": 1, "dmrs_max_len": 1, "dmrs_type": 1, "ldpc_max_its": 5, "mapping_type": "typeA", "mcs_table": "qam256", "mcs_table_tp": "qam256", "msg3_delta_power": 0, "msg3_mcs": 4, "n_symb": 14, "p0_nominal_with_grant": -84, "tf_precoding": false }, "q_qual_min": -20, "q_rx_lev_min": -70, "root_sequence_index": 1, "si_window_length": 40, "sr_period": 40, "ssb_period": 20, "tdd_ul_dl_config": { "pattern1": { "dl_slots": 3, "dl_symbols": 2, "period": 5, "ul_slots": 1, "ul_symbols": 1 } } }, "nr_cell_list": [ { "band": 41, "cell_id": 1, "dl_nr_arfcn": 518670, "drb_config": [ { "5qi_qos": { "averaging_window": 2000, "priority_level": 20 }, "ims_dedicated_bearer": true, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 1, "prioritisedBitRate": 0, "priority": 7 }, "pdcp_config": { "discardTimer": 100, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 12, "pdcp_SN_SizeUL": 12, "statusReportRequired": false, "t_Reordering": 0 }, "qci": 1, "rlc_config": { "dl_um": { "sn_FieldLength": 6, "t_Reassembly": 50 }, "ul_um": { "sn_FieldLength": 6 } }, "use_for_mr_dc_scg": false }, { "5qi_qos": { "averaging_window": 2000, "priority_level": 40 }, "ims_dedicated_bearer": true, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 1, "prioritisedBitRate": 0, "priority": 8 }, "pdcp_config": { "discardTimer": 150, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": false, "t_Reordering": 0 }, "qci": 2, "rlc_config": { "dl_um": { "sn_FieldLength": 12, "t_Reassembly": 50 }, "ul_um": { "sn_FieldLength": 12 } }, "use_for_mr_dc_scg": false }, { "5qi_qos": { "averaging_window": 2000, "priority_level": 30 }, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 2, "prioritisedBitRate": 0, "priority": 7 }, "pdcp_config": { "discardTimer": 100, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": false, "t_Reordering": 0 }, "qci": 3, "rlc_config": { "dl_um": { "sn_FieldLength": 12, "t_Reassembly": 50 }, "ul_um": { "sn_FieldLength": 12 } } }, { "5qi_qos": { "averaging_window": 2000, "priority_level": 50 }, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 3, "prioritisedBitRate": 8, "priority": 9 }, "pdcp_config": { "discardTimer": 0, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": true, "t_Reordering": 3000 }, "qci": 4, "rlc_config": { "dl_am": { "sn_FieldLength": 18, "t_Reassembly": 80, "t_StatusProhibit": 10 }, "ul_am": { "maxRetxThreshold": 4, "pollByte": 125, "pollPDU": 64, "sn_FieldLength": 18, "t_PollRetransmit": 80 } } }, { "5qi_qos": { "averaging_window": 2000, "priority_level": 7 }, "ims_dedicated_bearer": true, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 4, "prioritisedBitRate": 0, "priority": 5 }, "pdcp_config": { "discardTimer": 100, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 12, "pdcp_SN_SizeUL": 12, "statusReportRequired": false, "t_Reordering": 0 }, "qci": 65, "rlc_config": { "dl_um": { "sn_FieldLength": 6, "t_Reassembly": 50 }, "ul_um": { "sn_FieldLength": 6 } }, "use_for_mr_dc_scg": false }, { "5qi_qos": { "averaging_window": 2000, "priority_level": 20 }, "ims_dedicated_bearer": true, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 4, "prioritisedBitRate": 0, "priority": 7 }, "pdcp_config": { "discardTimer": 150, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": false, "t_Reordering": 0 }, "qci": 66, "rlc_config": { "dl_um": { "sn_FieldLength": 12, "t_Reassembly": 50 }, "ul_um": { "sn_FieldLength": 12 } }, "use_for_mr_dc_scg": false }, { "5qi_qos": { "averaging_window": 2000, "priority_level": 15 }, "ims_dedicated_bearer": true, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 5, "prioritisedBitRate": 0, "priority": 6 }, "pdcp_config": { "discardTimer": 100, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": false, "t_Reordering": 0 }, "qci": 67, "rlc_config": { "dl_um": { "sn_FieldLength": 12, "t_Reassembly": 50 }, "ul_um": { "sn_FieldLength": 12 } }, "use_for_mr_dc_scg": false }, { "5qi_qos": { "priority_level": 10 }, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 4, "prioritisedBitRate": 8, "priority": 6 }, "pdcp_config": { "discardTimer": 0, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": true, "t_Reordering": 3000 }, "qci": 5, "rlc_config": { "dl_am": { "sn_FieldLength": 18, "t_Reassembly": 80, "t_StatusProhibit": 10 }, "ul_am": { "maxRetxThreshold": 4, "pollByte": 125, "pollPDU": 64, "sn_FieldLength": 18, "t_PollRetransmit": 80 } }, "use_for_mr_dc_scg": false }, { "5qi_qos": { "priority_level": 60 }, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 5, "prioritisedBitRate": 8, "priority": 10 }, "pdcp_config": { "discardTimer": 0, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": true, "t_Reordering": 3000 }, "qci": 6, "rlc_config": { "dl_am": { "sn_FieldLength": 18, "t_Reassembly": 80, "t_StatusProhibit": 10 }, "ul_am": { "maxRetxThreshold": 4, "pollByte": 125, "pollPDU": 64, "sn_FieldLength": 18, "t_PollRetransmit": 80 } } }, { "5qi_qos": { "priority_level": 70 }, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 6, "prioritisedBitRate": 0, "priority": 11 }, "pdcp_config": { "discardTimer": 100, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": false, "t_Reordering": 0 }, "qci": 7, "rlc_config": { "dl_um": { "sn_FieldLength": 12, "t_Reassembly": 50 }, "ul_um": { "sn_FieldLength": 12 } } }, { "5qi_qos": { "priority_level": 80 }, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 7, "prioritisedBitRate": 8, "priority": 12 }, "pdcp_config": { "discardTimer": 0, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": true, "t_Reordering": 3000 }, "qci": 8, "rlc_config": { "dl_am": { "sn_FieldLength": 18, "t_Reassembly": 80, "t_StatusProhibit": 10 }, "ul_am": { "maxRetxThreshold": 4, "pollByte": 125, "pollPDU": 64, "sn_FieldLength": 18, "t_PollRetransmit": 80 } } }, { "5qi_qos": { "priority_level": 90 }, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 7, "prioritisedBitRate": 8, "priority": 13 }, "nr_dc_split": { "type": "scg", "ul_data_threshold": 0 }, "pdcp_config": { "discardTimer": 0, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": true, "t_Reordering": 3000 }, "qci": 9, "rlc_config": { "dl_am": { "sn_FieldLength": 18, "t_Reassembly": 80, "t_StatusProhibit": 10 }, "ul_am": { "maxRetxThreshold": 4, "pollByte": 125, "pollPDU": 64, "sn_FieldLength": 18, "t_PollRetransmit": 80 } } }, { "5qi_qos": { "priority_level": 90 }, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 7, "prioritisedBitRate": 8, "priority": 13 }, "pdcp_config": { "discardTimer": 0, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": true, "t_Reordering": 3000 }, "qci": 10, "rlc_config": { "dl_am": { "sn_FieldLength": 18, "t_Reassembly": 1100, "t_StatusProhibit": 400 }, "ul_am": { "maxRetxThreshold": 4, "pollByte": 125, "pollPDU": 64, "sn_FieldLength": 18, "t_PollRetransmit": 800 } } }, { "5qi_qos": { "priority_level": 5 }, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 4, "prioritisedBitRate": 8, "priority": 4 }, "pdcp_config": { "discardTimer": 0, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": true, "t_Reordering": 3000 }, "qci": 69, "rlc_config": { "dl_am": { "sn_FieldLength": 18, "t_Reassembly": 80, "t_StatusProhibit": 10 }, "ul_am": { "maxRetxThreshold": 4, "pollByte": 125, "pollPDU": 64, "sn_FieldLength": 18, "t_PollRetransmit": 80 } }, "use_for_mr_dc_scg": false }, { "5qi_qos": { "priority_level": 55 }, "logical_channel_config": { "bucketSizeDuration": 100, "logicalChannelGroup": 5, "prioritisedBitRate": 8, "priority": 11 }, "pdcp_config": { "discardTimer": 0, "outOfOrderDelivery": false, "pdcp_SN_SizeDL": 18, "pdcp_SN_SizeUL": 18, "statusReportRequired": true, "t_Reordering": 3000 }, "qci": 70, "rlc_config": { "dl_am": { "sn_FieldLength": 18, "t_Reassembly": 80, "t_StatusProhibit": 10 }, "ul_am": { "maxRetxThreshold": 4, "pollByte": 125, "pollPDU": 64, "sn_FieldLength": 18, "t_PollRetransmit": 80 } } } ], "rf_port": 0, "ssb_pos_bitmap": "1000", "ssb_subcarrier_spacing": 15, "subcarrier_spacing": 15 } ], "rf_driver": { "args": "dev0=/dev/sdr0", "name": "sdr", "rx_antenna": "rx" }, "rf_ports": [ {} ], "rx_gain": 60, "tx_gain": 90 } |
Stripping the Configuration file
Sometimes you would come across a config file with a lot of #define, #if statements in it. If you know of the exact structure and flow of those flags and conditions, it will be handy to create such a config file that let you do various things just by changing flags (#define) in the config file. But if you were give such a file from somebody else it would be challenging to analyze the configuration file. In such a situation, you can also json_util to strip off all those flags and conditions from the config file and print out the configuration that are really used when executed as show below.
|
[root@CBC-2023010100 ots]# ./json_util dump /root/enb/config/gnb-sa.cfg { "amf_list": [ { "amf_addr": "127.0.1.100" } ], "cell_list": [], "com_addr": "[::]:9001", "en_dc_support": true, "gnb_id": 74565, "gnb_id_bits": 28, "gtp_addr": "127.0.1.1", "log_filename": "/tmp/gnb0.log", "log_options": "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1", "nr_cell_default": { "bandwidth": 40, "cell_barred": false, "cipher_algo_pref": [], "csi_rs": { "csi_report_config": [ { "period": 80, "report_config_type": "periodic" } ], "resource_auto": { "nzp_csi_rs_period": 80 } }, "dmrs_type_a_pos": 2, "drb_config": "drb_nr.cfg", "inactivity_timer": 10000, "integ_algo_pref": [2, 1], "intra_freq_reselection": true, "mac_config": { "dl_max_consecutive_retx": 30, "dl_max_harq_tx": 5, "msg3_max_harq_tx": 5, "periodic_bsr_timer": 20, "periodic_phr_timer": 500, "phr_tx_power_factor_change": "dB3", "prohibit_phr_timer": 200, "retx_bsr_timer": 320, "sr_prohibit_timer": 0, "sr_trans_max": 64, "ul_max_consecutive_retx": 30, "ul_max_harq_tx": 5 }, "n_antenna_dl": 1, "n_antenna_ul": 1, "n_id_cell": 500, "pdcch": { "al_index": 1, "css": { "n_candidates": [0, 0, 4, 0, 0] }, "dedicated_coreset": { "duration": 0, "l_crb": -1, "precoder_granularity": "sameAsREG_bundle", "rb_start": -1 }, "rar_al_index": 2, "search_space0_index": 0, "si_al_index": 2, "uss": { "dci_0_1_and_1_1": true, "n_candidates": [0, 4, 0, 0, 0] } }, "pdsch": { "dmrs_add_pos": 1, "dmrs_max_len": 1, "dmrs_type": 1, "mapping_type": "typeA", "mcs_table": "qam256", "rar_mcs": 2, "si_mcs": 6 }, "plmn_list": [ { "nssai": [ { "sst": 1 } ], "plmn": "00101", "reserved": false, "tac": 100 } ], "prach": { "cb_preambles_per_ssb": 8, "msg1_fdm": 1, "msg1_frequency_start": -1, "msg1_subcarrier_spacing": 30, "power_ramping_step": 4, "prach_config_index": 160, "preamble_received_target_power": -110, "preamble_trans_max": 7, "ra_contention_resolution_timer": 64, "ra_response_window": 20, "restricted_set_config": "unrestricted_set", "ssb_per_prach_occasion": 1, "zero_correlation_zone_config": 15 }, "pucch": { "p0_nominal": -96, "resource_auto": {} }, "pusch": { "beta_offset_ack_index": 9, "dmrs_add_pos": 1, "dmrs_max_len": 1, "dmrs_type": 1, "ldpc_max_its": 5, "mapping_type": "typeA", "mcs_table": "qam256", "mcs_table_tp": "qam256", "msg3_delta_power": 0, "msg3_mcs": 4, "n_symb": 14, "p0_nominal_with_grant": -84, "tf_precoding": false }, "q_qual_min": -20, "q_rx_lev_min": -70, "root_sequence_index": 1, "si_window_length": 40, "sr_period": 40, "ssb_period": 20, "tdd_ul_dl_config": { "pattern1": { "dl_slots": 7, "dl_symbols": 6, "period": 5, "ul_slots": 2, "ul_symbols": 4 } } }, "nr_cell_list": [ { "band": 78, "cell_id": 1, "dl_nr_arfcn": 632628, "rf_port": 0, "ssb_pos_bitmap": "10000000", "subcarrier_spacing": 30 } ], "rf_driver": { "args": "dev0=/dev/sdr0", "name": "sdr", "rx_antenna": "rx" }, "rf_ports": [ {} ], "rx_gain": 60, "tx_gain": 90 } |
In the output above, you would notice that the printing order is reversed comparing to the original config. If you want to print the output in similar order as your original configuration file, you can use -n option as shown below.
|
[root@CBC-2023010100 ots]# ./json_util -n dump /root/enb/config/gnb-sa.cfg { "log_options": "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1", "log_filename": "/tmp/gnb0.log", "com_addr": "[::]:9001", "rf_driver": { "name": "sdr", "args": "dev0=/dev/sdr0", "rx_antenna": "rx" }, "tx_gain": 90, "rx_gain": 60, "amf_list": [ { "amf_addr": "127.0.1.100" } ], "gtp_addr": "127.0.1.1", "gnb_id_bits": 28, "gnb_id": 74565, "en_dc_support": true, "rf_ports": [ {} ], "cell_list": [], "nr_cell_list": [ { "rf_port": 0, "cell_id": 1, "band": 78, "dl_nr_arfcn": 632628, "subcarrier_spacing": 30, "ssb_pos_bitmap": "10000000" } ], "nr_cell_default": { "bandwidth": 40, "n_antenna_dl": 1, "n_antenna_ul": 1, "tdd_ul_dl_config": { "pattern1": { "period": 5, "dl_slots": 7, "dl_symbols": 6, "ul_slots": 2, "ul_symbols": 4 } }, "ssb_period": 20, "n_id_cell": 500, "plmn_list": [ { "tac": 100, "plmn": "00101", "reserved": false, "nssai": [ { "sst": 1 } ] } ], "si_window_length": 40, "cell_barred": false, "intra_freq_reselection": true, "q_rx_lev_min": -70, "q_qual_min": -20, "root_sequence_index": 1, "sr_period": 40, "dmrs_type_a_pos": 2, "prach": { "prach_config_index": 160, "msg1_subcarrier_spacing": 30, "msg1_fdm": 1, "msg1_frequency_start": -1, "zero_correlation_zone_config": 15, "preamble_received_target_power": -110, "preamble_trans_max": 7, "power_ramping_step": 4, "ra_response_window": 20, "restricted_set_config": "unrestricted_set", "ra_contention_resolution_timer": 64, "ssb_per_prach_occasion": 1, "cb_preambles_per_ssb": 8 }, "pdcch": { "search_space0_index": 0, "dedicated_coreset": { "rb_start": -1, "l_crb": -1, "duration": 0, "precoder_granularity": "sameAsREG_bundle" }, "css": { "n_candidates": [0, 0, 4, 0, 0] }, "rar_al_index": 2, "si_al_index": 2, "uss": { "n_candidates": [0, 4, 0, 0, 0], "dci_0_1_and_1_1": true }, "al_index": 1 }, "pdsch": { "mapping_type": "typeA", "dmrs_add_pos": 1, "dmrs_type": 1, "dmrs_max_len": 1, "mcs_table": "qam256", "rar_mcs": 2, "si_mcs": 6 }, "csi_rs": { "resource_auto": { "nzp_csi_rs_period": 80 }, "csi_report_config": [ { "report_config_type": "periodic", "period": 80 } ] }, "pucch": { "p0_nominal": -96, "resource_auto": {} }, "pusch": { "mapping_type": "typeA", "n_symb": 14, "dmrs_add_pos": 1, "dmrs_type": 1, "dmrs_max_len": 1, "tf_precoding": false, "mcs_table": "qam256", "mcs_table_tp": "qam256", "ldpc_max_its": 5, "p0_nominal_with_grant": -84, "msg3_mcs": 4, "msg3_delta_power": 0, "beta_offset_ack_index": 9 }, "mac_config": { "msg3_max_harq_tx": 5, "ul_max_harq_tx": 5, "dl_max_harq_tx": 5, "ul_max_consecutive_retx": 30, "dl_max_consecutive_retx": 30, "periodic_bsr_timer": 20, "retx_bsr_timer": 320, "periodic_phr_timer": 500, "prohibit_phr_timer": 200, "phr_tx_power_factor_change": "dB3", "sr_prohibit_timer": 0, "sr_trans_max": 64 }, "cipher_algo_pref": [], "integ_algo_pref": [2, 1], "inactivity_timer": 10000, "drb_config": "drb_nr.cfg" } } |