Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store in a raw json object #9

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Store in a raw json object #9

merged 1 commit into from
Aug 29, 2024

Conversation

asteel-gsa
Copy link

Stores the out tables and rows in json format. Hopefully this will send the entire json raw to new relic in a way that only shows it on one line, and then we can manually convert by copying the message and simply running jq . file.json.
Raw:

{"TABLEROWCOUNT":[{"Table":"census_duns21","Rows":"12704"},{"Table":"census_eins18","Rows":"6235"},{"Table":"census_cfda19","Rows":"612642"},{"Table":"census_duns18","Rows":"13065"},{"Table":"census_eins16","Rows":"5497"},{"Table":"census_cpas21","Rows":"305"},{"Table":"census_cpas17","Rows":"144"},{"Table":"census_agency16","Rows":"42874"},{"Table":"census_captext19","Rows":"12640"},{"Table":"census_captext_formatted21","Rows":"95948"},{"Table":"census_cfda20","Rows":"682979"},{"Table":"census_captext20","Rows":"12082"},{"Table":"census_agency17","Rows":"42598"},{"Table":"census_captext21","Rows":"14287"},{"Table":"dissemination_note","Rows":"0"},{"Table":"census_cfda16","Rows":"913822"},{"Table":"census_duns19","Rows":"11665"},{"Table":"census_cpas18","Rows":"166"},{"Table":"census_cpas22","Rows":"223"},{"Table":"census_agency19","Rows":"41504"},{"Table":"census_eins17","Rows":"5628"},{"Table":"census_duns22","Rows":"6789"},{"Table":"census_cfda21","Rows":"781756"},{"Table":"census_captext_formatted19","Rows":"77422"},{"Table":"census_cpas19","Rows":"146"},{"Table":"census_duns16","Rows":"11509"},{"Table":"census_agency20","Rows":"45313"},{"Table":"census_cfda22","Rows":"717802"},{"Table":"census_cfda17","Rows":"586920"},{"Table":"census_notes20","Rows":"122160"},{"Table":"census_duns17","Rows":"11590"},{"Table":"census_cfda18","Rows":"596309"},{"Table":"census_cpas20","Rows":"190"},{"Table":"census_duns20","Rows":"10189"},{"Table":"census_captext_formatted20","Rows":"79053"},{"Table":"census_agency22","Rows":"41649"},{"Table":"census_cpas16","Rows":"156"},{"Table":"census_findings18","Rows":"79898"},{"Table":"census_eins19","Rows":"5840"},{"Table":"census_findings16","Rows":"74025"},{"Table":"census_findings20","Rows":"50617"},{"Table":"census_findings22","Rows":"48519"},{"Table":"census_findings21","Rows":"54738"},{"Table":"census_eins21","Rows":"9959"},{"Table":"census_eins22","Rows":"5832"},{"Table":"census_eins20","Rows":"6949"},{"Table":"census_findings19","Rows":"56021"},{"Table":"census_findings17","Rows":"67427"},{"Table":"census_findingstext_formatted22","Rows":"149420"},{"Table":"census_findingstext21","Rows":"14284"},{"Table":"census_gen16","Rows":"36989"},{"Table":"census_gen18","Rows":"37011"},{"Table":"census_findingstext_formatted19","Rows":"172654"},{"Table":"census_gen17","Rows":"36905"},{"Table":"census_findingstext_formatted20","Rows":"177274"},{"Table":"census_findingstext_formatted21","Rows":"201839"},{"Table":"census_findingstext19","Rows":"12629"},{"Table":"census_findingstext20","Rows":"12079"},{"Table":"census_gen22","Rows":"36966"},{"Table":"census_notes21","Rows":"142182"},{"Table":"census_notes19","Rows":"109873"},{"Table":"census_passthrough16","Rows":"379652"},{"Table":"census_passthrough18","Rows":"398155"},{"Table":"census_gen19","Rows":"37317"},{"Table":"census_gen21","Rows":"44858"},{"Table":"census_gen20","Rows":"39946"},{"Table":"census_passthrough17","Rows":"391242"},{"Table":"census_notes22","Rows":"117921"},{"Table":"census_passthrough22","Rows":"504401"},{"Table":"census_revisions22","Rows":"597"},{"Table":"census_ueis22","Rows":"4991"},{"Table":"census_revisions19","Rows":"1612"},{"Table":"census_revisions21","Rows":"1653"},{"Table":"census_revisions20","Rows":"1580"},{"Table":"census_passthrough20","Rows":"459461"},{"Table":"census_passthrough19","Rows":"412150"},{"Table":"census_passthrough21","Rows":"534984"},{"Table":"audit_deletedaccess","Rows":"0"},{"Table":"census_findingstext22","Rows":"9832"},{"Table":"auth_group_permissions","Rows":"0"},{"Table":"django_content_type","Rows":"52"},{"Table":"auth_permission","Rows":"208"},{"Table":"django_migrations","Rows":"67"},{"Table":"auth_group","Rows":"0"},{"Table":"auth_user","Rows":"0"},{"Table":"auth_user_user_permissions","Rows":"0"},{"Table":"django_admin_log","Rows":"0"},{"Table":"auth_user_groups","Rows":"0"},{"Table":"audit_submissionevent","Rows":"0"},{"Table":"authtoken_token","Rows":"0"},{"Table":"audit_singleauditreportfile","Rows":"0"},{"Table":"census_historical_migration_elecauditfindings","Rows":"0"},{"Table":"census_historical_migration_eleceins","Rows":"0"},{"Table":"census_historical_migration_elecfindingstext","Rows":"0"},{"Table":"census_historical_migration_eleccpas","Rows":"0"},{"Table":"census_historical_migration_elecnotes","Rows":"0"},{"Table":"census_historical_migration_elecauditheader","Rows":"0"},{"Table":"census_historical_migration_elecaudits","Rows":"0"},{"Table":"census_historical_migration_eleccaptext","Rows":"0"},{"Table":"dissemination_additionalein","Rows":"0"},{"Table":"census_historical_migration_reportmigrationstatus","Rows":"0"},{"Table":"census_historical_migration_migrationerrordetail","Rows":"0"},{"Table":"census_historical_migration_elecueis","Rows":"0"},{"Table":"census_historical_migration_elecpassthrough","Rows":"0"},{"Table":"dissemination_finding","Rows":"0"},{"Table":"support_administrative_key_uuids","Rows":"3"},{"Table":"dissemination_general","Rows":"115915"},{"Table":"dissemination_migrationinspectionrecord","Rows":"0"},{"Table":"django_session","Rows":"0"},{"Table":"dissemination_issuedescriptionrecord","Rows":"0"},{"Table":"dissemination_invalidauditrecord","Rows":"0"},{"Table":"users_permission","Rows":"1"},{"Table":"support_adminapievent","Rows":"0"},{"Table":"users_staffuserlog","Rows":"0"},{"Table":"users_userprofile","Rows":"0"},{"Table":"support_cognizantassignment","Rows":"0"},{"Table":"users_staffuser","Rows":"0"},{"Table":"support_cognizantbaseline","Rows":"2338"},{"Table":"dissemination_tribalapiaccesskeyids","Rows":"0"},{"Table":"dissemination_findingtext","Rows":"0"},{"Table":"dissemination_additionaluei","Rows":"0"},{"Table":"dissemination_captext","Rows":"0"},{"Table":"users_userpermission","Rows":"0"},{"Table":"dissemination_onetimeaccess","Rows":"0"},{"Table":"dissemination_federalaward","Rows":"0"},{"Table":"dissemination_passthrough","Rows":"0"},{"Table":"audit_singleauditchecklist","Rows":"0"},{"Table":"census_captext22","Rows":"9837"},{"Table":"census_captext_formatted22","Rows":"69310"},{"Table":"census_agency21","Rows":"51218"},{"Table":"dissemination_secondaryauditor","Rows":"0"},{"Table":"census_agency18","Rows":"42661"},{"Table":"audit_excelfile","Rows":"0"},{"Table":"audit_access","Rows":"0"}]}

Pretty:

{
  "TABLEROWCOUNT": [
    {
      "Table": "census_duns21",
      "Rows": "12704"
    },
    {
      "Table": "census_eins18",
      "Rows": "6235"
    },
    {
      "Table": "census_cfda19",
      "Rows": "612642"
    },
    {
      "Table": "census_duns18",
      "Rows": "13065"
    },
    {
      "Table": "census_eins16",
      "Rows": "5497"
    },
    {
      "Table": "census_cpas21",
      "Rows": "305"
    },
    {
      "Table": "census_cpas17",
      "Rows": "144"
    },
    {
      "Table": "census_agency16",
      "Rows": "42874"
    },
    {
      "Table": "census_captext19",
      "Rows": "12640"
    },
    {
      "Table": "census_captext_formatted21",
      "Rows": "95948"
    },
    {
      "Table": "census_cfda20",
      "Rows": "682979"
    },
    {
      "Table": "census_captext20",
      "Rows": "12082"
    },
    {
      "Table": "census_agency17",
      "Rows": "42598"
    },
    {
      "Table": "census_captext21",
      "Rows": "14287"
    },
    {
      "Table": "dissemination_note",
      "Rows": "0"
    },
    {
      "Table": "census_cfda16",
      "Rows": "913822"
    },
    {
      "Table": "census_duns19",
      "Rows": "11665"
    },
    {
      "Table": "census_cpas18",
      "Rows": "166"
    },
    {
      "Table": "census_cpas22",
      "Rows": "223"
    },
    {
      "Table": "census_agency19",
      "Rows": "41504"
    },
    {
      "Table": "census_eins17",
      "Rows": "5628"
    },
    {
      "Table": "census_duns22",
      "Rows": "6789"
    },
    {
      "Table": "census_cfda21",
      "Rows": "781756"
    },
    {
      "Table": "census_captext_formatted19",
      "Rows": "77422"
    },
    {
      "Table": "census_cpas19",
      "Rows": "146"
    },
    {
      "Table": "census_duns16",
      "Rows": "11509"
    },
    {
      "Table": "census_agency20",
      "Rows": "45313"
    },
    {
      "Table": "census_cfda22",
      "Rows": "717802"
    },
    {
      "Table": "census_cfda17",
      "Rows": "586920"
    },
    {
      "Table": "census_notes20",
      "Rows": "122160"
    },
    {
      "Table": "census_duns17",
      "Rows": "11590"
    },
    {
      "Table": "census_cfda18",
      "Rows": "596309"
    },
    {
      "Table": "census_cpas20",
      "Rows": "190"
    },
    {
      "Table": "census_duns20",
      "Rows": "10189"
    },
    {
      "Table": "census_captext_formatted20",
      "Rows": "79053"
    },
    {
      "Table": "census_agency22",
      "Rows": "41649"
    },
    {
      "Table": "census_cpas16",
      "Rows": "156"
    },
    {
      "Table": "census_findings18",
      "Rows": "79898"
    },
    {
      "Table": "census_eins19",
      "Rows": "5840"
    },
    {
      "Table": "census_findings16",
      "Rows": "74025"
    },
    {
      "Table": "census_findings20",
      "Rows": "50617"
    },
    {
      "Table": "census_findings22",
      "Rows": "48519"
    },
    {
      "Table": "census_findings21",
      "Rows": "54738"
    },
    {
      "Table": "census_eins21",
      "Rows": "9959"
    },
    {
      "Table": "census_eins22",
      "Rows": "5832"
    },
    {
      "Table": "census_eins20",
      "Rows": "6949"
    },
    {
      "Table": "census_findings19",
      "Rows": "56021"
    },
    {
      "Table": "census_findings17",
      "Rows": "67427"
    },
    {
      "Table": "census_findingstext_formatted22",
      "Rows": "149420"
    },
    {
      "Table": "census_findingstext21",
      "Rows": "14284"
    },
    {
      "Table": "census_gen16",
      "Rows": "36989"
    },
    {
      "Table": "census_gen18",
      "Rows": "37011"
    },
    {
      "Table": "census_findingstext_formatted19",
      "Rows": "172654"
    },
    {
      "Table": "census_gen17",
      "Rows": "36905"
    },
    {
      "Table": "census_findingstext_formatted20",
      "Rows": "177274"
    },
    {
      "Table": "census_findingstext_formatted21",
      "Rows": "201839"
    },
    {
      "Table": "census_findingstext19",
      "Rows": "12629"
    },
    {
      "Table": "census_findingstext20",
      "Rows": "12079"
    },
    {
      "Table": "census_gen22",
      "Rows": "36966"
    },
    {
      "Table": "census_notes21",
      "Rows": "142182"
    },
    {
      "Table": "census_notes19",
      "Rows": "109873"
    },
    {
      "Table": "census_passthrough16",
      "Rows": "379652"
    },
    {
      "Table": "census_passthrough18",
      "Rows": "398155"
    },
    {
      "Table": "census_gen19",
      "Rows": "37317"
    },
    {
      "Table": "census_gen21",
      "Rows": "44858"
    },
    {
      "Table": "census_gen20",
      "Rows": "39946"
    },
    {
      "Table": "census_passthrough17",
      "Rows": "391242"
    },
    {
      "Table": "census_notes22",
      "Rows": "117921"
    },
    {
      "Table": "census_passthrough22",
      "Rows": "504401"
    },
    {
      "Table": "census_revisions22",
      "Rows": "597"
    },
    {
      "Table": "census_ueis22",
      "Rows": "4991"
    },
    {
      "Table": "census_revisions19",
      "Rows": "1612"
    },
    {
      "Table": "census_revisions21",
      "Rows": "1653"
    },
    {
      "Table": "census_revisions20",
      "Rows": "1580"
    },
    {
      "Table": "census_passthrough20",
      "Rows": "459461"
    },
    {
      "Table": "census_passthrough19",
      "Rows": "412150"
    },
    {
      "Table": "census_passthrough21",
      "Rows": "534984"
    },
    {
      "Table": "audit_deletedaccess",
      "Rows": "0"
    },
    {
      "Table": "census_findingstext22",
      "Rows": "9832"
    },
    {
      "Table": "auth_group_permissions",
      "Rows": "0"
    },
    {
      "Table": "django_content_type",
      "Rows": "52"
    },
    {
      "Table": "auth_permission",
      "Rows": "208"
    },
    {
      "Table": "django_migrations",
      "Rows": "67"
    },
    {
      "Table": "auth_group",
      "Rows": "0"
    },
    {
      "Table": "auth_user",
      "Rows": "0"
    },
    {
      "Table": "auth_user_user_permissions",
      "Rows": "0"
    },
    {
      "Table": "django_admin_log",
      "Rows": "0"
    },
    {
      "Table": "auth_user_groups",
      "Rows": "0"
    },
    {
      "Table": "audit_submissionevent",
      "Rows": "0"
    },
    {
      "Table": "authtoken_token",
      "Rows": "0"
    },
    {
      "Table": "audit_singleauditreportfile",
      "Rows": "0"
    },
    {
      "Table": "census_historical_migration_elecauditfindings",
      "Rows": "0"
    },
    {
      "Table": "census_historical_migration_eleceins",
      "Rows": "0"
    },
    {
      "Table": "census_historical_migration_elecfindingstext",
      "Rows": "0"
    },
    {
      "Table": "census_historical_migration_eleccpas",
      "Rows": "0"
    },
    {
      "Table": "census_historical_migration_elecnotes",
      "Rows": "0"
    },
    {
      "Table": "census_historical_migration_elecauditheader",
      "Rows": "0"
    },
    {
      "Table": "census_historical_migration_elecaudits",
      "Rows": "0"
    },
    {
      "Table": "census_historical_migration_eleccaptext",
      "Rows": "0"
    },
    {
      "Table": "dissemination_additionalein",
      "Rows": "0"
    },
    {
      "Table": "census_historical_migration_reportmigrationstatus",
      "Rows": "0"
    },
    {
      "Table": "census_historical_migration_migrationerrordetail",
      "Rows": "0"
    },
    {
      "Table": "census_historical_migration_elecueis",
      "Rows": "0"
    },
    {
      "Table": "census_historical_migration_elecpassthrough",
      "Rows": "0"
    },
    {
      "Table": "dissemination_finding",
      "Rows": "0"
    },
    {
      "Table": "support_administrative_key_uuids",
      "Rows": "3"
    },
    {
      "Table": "dissemination_general",
      "Rows": "115915"
    },
    {
      "Table": "dissemination_migrationinspectionrecord",
      "Rows": "0"
    },
    {
      "Table": "django_session",
      "Rows": "0"
    },
    {
      "Table": "dissemination_issuedescriptionrecord",
      "Rows": "0"
    },
    {
      "Table": "dissemination_invalidauditrecord",
      "Rows": "0"
    },
    {
      "Table": "users_permission",
      "Rows": "1"
    },
    {
      "Table": "support_adminapievent",
      "Rows": "0"
    },
    {
      "Table": "users_staffuserlog",
      "Rows": "0"
    },
    {
      "Table": "users_userprofile",
      "Rows": "0"
    },
    {
      "Table": "support_cognizantassignment",
      "Rows": "0"
    },
    {
      "Table": "users_staffuser",
      "Rows": "0"
    },
    {
      "Table": "support_cognizantbaseline",
      "Rows": "2338"
    },
    {
      "Table": "dissemination_tribalapiaccesskeyids",
      "Rows": "0"
    },
    {
      "Table": "dissemination_findingtext",
      "Rows": "0"
    },
    {
      "Table": "dissemination_additionaluei",
      "Rows": "0"
    },
    {
      "Table": "dissemination_captext",
      "Rows": "0"
    },
    {
      "Table": "users_userpermission",
      "Rows": "0"
    },
    {
      "Table": "dissemination_onetimeaccess",
      "Rows": "0"
    },
    {
      "Table": "dissemination_federalaward",
      "Rows": "0"
    },
    {
      "Table": "dissemination_passthrough",
      "Rows": "0"
    },
    {
      "Table": "audit_singleauditchecklist",
      "Rows": "0"
    },
    {
      "Table": "census_captext22",
      "Rows": "9837"
    },
    {
      "Table": "census_captext_formatted22",
      "Rows": "69310"
    },
    {
      "Table": "census_agency21",
      "Rows": "51218"
    },
    {
      "Table": "dissemination_secondaryauditor",
      "Rows": "0"
    },
    {
      "Table": "census_agency18",
      "Rows": "42661"
    },
    {
      "Table": "audit_excelfile",
      "Rows": "0"
    },
    {
      "Table": "audit_access",
      "Rows": "0"
    }
  ]
}

{"TABLEROWCOUNT":[{"Table":"table_name","Rows":"#"},......]}
@asteel-gsa asteel-gsa requested a review from jadudm August 29, 2024 12:50
@asteel-gsa asteel-gsa mentioned this pull request Aug 29, 2024
18 tasks
Copy link

@jadudm jadudm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Simplifies things for us in the backend when querying/in case of restore/etc.

@jadudm jadudm added this pull request to the merge queue Aug 29, 2024
Merged via the queue into main with commit 157a7ea Aug 29, 2024
1 check passed
@asteel-gsa asteel-gsa deleted the row-count-format-patch branch October 29, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants