Given the JSON snippet below, what is the value of hostname?
{
"device": {
"hostname": "R1",
"mgmt_ip": "192.0.2.10"
}
}{
"device": {
"hostname": "R1",
"mgmt_ip": "192.0.2.10"
}
}Given the JSON snippet below, what is the value of hostname?
{
"device": {
"hostname": "R1",
"mgmt_ip": "192.0.2.10"
}
}Answer choices
Good practice is not just finding the correct option. The wrong answers often show the exact trap the exam wants you to fall into.
device
device is the object name, not the hostname value.
hostname
hostname is the key name, not the value.
R1
Correct. R1 is the value assigned to hostname.
192.0.2.10
That is the management IP value.
Common exam trap
A common exam trap is mistaking the JSON key "hostname" for its value or confusing the parent object name "device" with the hostname itself. Candidates might select "hostname" as the answer because it appears prominently, but it is only the key name, not the actual hostname value. Another tempting mistake is choosing the management IP address "192.0.2.10" since it is also present in the JSON snippet, but this represents the device's IP, not its hostname. Understanding the difference between keys and values in JSON is critical to avoid these errors.
Technical deep dive
In Cisco networking and automation contexts, JSON (JavaScript Object Notation) is a widely used data format for representing structured information such as device configurations. The JSON snippet in the question shows a hierarchical structure where the key "device" contains an object with keys "hostname" and "mgmt_ip". The value associated with the key "hostname" is "R1", which represents the device's name or identifier in the network. When parsing JSON data for network automation or programmability tasks, the key-value pairs must be correctly interpreted. The key "hostname" is a label, and its corresponding value "R1" is the actual hostname string assigned to the device. This value is critical for network identification, device management, and automation scripts that rely on device names to execute commands or gather information. A common exam trap is confusing keys with values or misreading the JSON structure. For example, mistaking "hostname" as the value rather than the key, or selecting the parent object name "device" as the hostname. Understanding JSON syntax and the distinction between keys and values is essential for correctly extracting configuration data in Cisco automation scenarios.
Related practice questions
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Practise IPv4 subnetting, CIDR, masks, host ranges and subnet selection.
Practise OSPF neighbours, router IDs, metrics, areas and routing-table interpretation.
Practise VLANs, access ports, trunks, allowed VLANs and switching scenarios.
Practise spanning tree, root bridge election, port roles and STP troubleshooting.
Practise LACP, PAgP, port-channel behaviour and bundle requirements.
Practise standard and extended ACLs, permit/deny logic and traffic filtering.
Practise static NAT, dynamic NAT, PAT and inside/outside address translation.
Practise DHCP scopes, relay, leases and troubleshooting.
Practise routing-table output, longest-prefix match, AD and route selection.
Practise trunk verification and VLAN forwarding across switches.
Practise WLAN security, authentication and wireless architecture concepts.
Practise IPv6 addressing, routes, neighbour discovery and common IPv6 exam traps.
Keep practising from the same exam bank, or move into a focused topic page if this question exposed a weak area.
Question 1
Question 2
Question 3
Question 4
Question 5
Question 6
FAQ
JSON uses key-value pairs where keys are labels and values are the actual data assigned to those keys in network device configurations.
The correct answer is: R1 — The key hostname inside the device object has the value R1.
Then try more questions from the same exam bank and focus on understanding why the wrong options are tempting.
Sign in to join the discussion.