title: Printing all keys and values in a single line after sorting the keys
body: <p>I've a folder with more than 1000 request logs (generated per hour/day) which are in the following format:</p>
  
  <pre><code>[
    {
      "input": {
        "random_param_name_1": "random_value_1",
        "random_param_name_2": "random_value_2",
        "random_param_name_3": "random_value_3",
        "random_param_name_4": "random_value_4"
      },
      "output": {
        "some_key_we_dont_care_about": "some_value_we_dont_care_about"
      },
      "status_code": 200
    },
    {
      "input": {
        "random_param_name_1": "random_value_1",
        "random_param_name_4": "random_value_4",
        "random_param_name_3": "random_value_3",
        "random_param_name_5": "random_value_5"
      },
      "output": {
        "some_key_we_dont_care_about": "some_value_we_dont_care_about"
      },
      "status_code": 200
    }
  ]
  </code></pre>
  
  <p>And I need to find all the input requests that are unique. For this, I need to do two things:</p>
  
  <ol>
  <li>sort the keys in <code>input</code> as different inputs might have same keys but in different order</li>
  <li>print all the key and value in a single line, so that I can pipe the output to <code>sort | uniq</code> to get all the unique input combinations.</li>
  </ol>
  
  <p>Please note that the input keys are random, most existing questions in stackoverflow of the similar kind, know the keys in advance, but that's not the case here.</p>
  
  <p>I can print the key and values like this:</p>
  
  <pre><code>jq -r 'keys[] as $k | "\($k):(.[$k])"' 
  </code></pre>
  
  <p>but they end up being on new lines.</p>
  
  <p>to summarise, for the above json, I need a <code>magic_expression</code></p>
  
  <pre class="lang-sh prettyprint-override"><code>$ jq 'magic_expression' log.json
  </code></pre>
  
  <p>that will return</p>
  
  <pre class="lang-sh prettyprint-override"><code>"random_param_name_1":"random_value_1","random_param_name_2":"random_value_2","random_param_name_3":"random_value_3","random_param_name_4":"random_value_4"
  "random_param_name_1":"random_value_1","random_param_name_3":"random_value_3","random_param_name_4":"random_value_4","random_param_name_5":"random_value_5"
  
  </code></pre>