Q:

Gather keys and values from two plain-text files

I try to do LLD in zabbix for portworx volumes, but I don't have much experience with JSON.  I have two files:
file 1
10.10.10.100
10.10.10.101
10.10.10.102

file 2
host 1
host 2
host 3

and I can turn them into JSON with cat raw_name | jq -R '.'  | jq -s '{NAME:map({"{#NAME}":.})}'  and get:
{
  "NAME": [
    {
      "{#NAME}": "host 1"
    },
    {
      "{#NAME}": "host 2"
    },
    {
      "{#NAME}": "host 3"
    }
  ]
}

but how I can use them both to get something like this
[
  {
    "{#IP}": "10.234.8.100",
    "{#NAME}": "host 1"
  },
  {
    "{#IP}": "10.234.8.101",
    "{#NAME}": "host 2"
  },
  {
    "{#IP}": "10.234.8.102",
    "{#NAME}": "host 3"
  }
]

A:

Merge input files side by side using paste.  Then in JQ, split each line by tab character (paste's default output delimiter), and use resulting parts for building objects. 
paste file1 file2 | jq -Rn '[
  inputs
  | split("\t")
  | {"{#IP}": .[0], "{#NAME}": .[1]}
]'

Without paste it gets a bit complicated:
jq -Rn '[ inputs ]
| (length / 2) as $i
| [ .[:$i], .[$i:] ]
| transpose
| map({"{#IP}": .[0], "{#NAME}": .[1]})' file1 file2

