Amarisoft

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)

NOTE : The order of the configuration parameters in the extracted configuration would not be exactly same as you used in the original configuration file. so if you want to compare the extracted config and original config file with text diff software, it may not work very well.  However, you should be able to run the test with the extracted config file in the same way as the original configuration file.

 

Table of Contents

 

Where is the tool ?

You can find the extraction tool (json_util) at /root/ots directory as shown below.

ExtractConfigFromLog Tool 01

 

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.

ExtractConfigFromLog ConfigInLog 01

 

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.

ExtractConfigFromLog ConfigInExtract 01

You will get the extracted configuration as follows.

ExtractConfigFromLog ConfigInExtract 02

 

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

Configuration extraction from log file illustration related to ConfigFromLog ConfigInExtractFile 01

Open the saved file and confirm.

ExtractConfigFromLog ConfigInExtractFile 02

 

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. (NOTE : Make it sure that the specified log file exists before you run this type of command)

[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"

    }

}