# How do I compare a registry\_value (value in the machine) with the node attribute for every chef-client run if the value keeps changing

**URL:** <https://discourse.chef.io/t/how-do-i-compare-a-registry-value-value-in-the-machine-with-the-node-attribute-for-every-chef-client-run-if-the-value-keeps-changing/12429>\
**Category:** Chef Infra (archive)\
**Created:** [January 16, 2018, 12:39pm UTC](https://discourse.chef.io/t/how-do-i-compare-a-registry-value-value-in-the-machine-with-the-node-attribute-for-every-chef-client-run-if-the-value-keeps-changing/12429 "2018-01-16T12:39:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anjz](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@Anjz](https://discourse.chef.io/u/Anjz)\
**Post date:** [January 16, 2018, 12:39pm UTC](https://discourse.chef.io/t/how-do-i-compare-a-registry-value-value-in-the-machine-with-the-node-attribute-for-every-chef-client-run-if-the-value-keeps-changing/12429/1 "2018-01-16T12:39:05Z")

</div>

The value in the regedit (registry value) keeps changing for every chef client-run. Lets say the default value is **default[abc][def] = ‘NULL’** in attributes folder-\> default.rb . In the Chef::Recipe “enable.rb” I get the registry\_value .

```
  `first_reg_value = registry_get_values'HKEY_LOCAL_MACHINE\xxx\yy\zzz'
   second_value = node[abc][def]
   first_reg_value.each do |key|
    if key[:name] == 'theoriginal_value' 
    second_value = key[:data]
    only_if { first_reg_value = second_value }
   end 
  end`

```

How to get the value for every chef-client run from the machine. The value should be changed from NULL to ‘xyz’ and it should reflect in the node attribute value in the chef [console.In](http://console.In) the next chef-client run if the value changes again the that value should reflect in the node attributes.  
Kindly help
