I would like to parse a CSV.  I need the column with the header 
'ErrorMessage'.  I am reading the variable and gathering the information, 
but I don't know how to pull out the info I need form the results:

- name:  Parse LookingGlass Report for Errors
  read_csv:
    path: /etc/ansible/roles/LookingGlass/files/Pentair.csv
  register: errors

- debug:
    var: errors.list

Results:
ok: [localhost] => {
    "errors.list": [
        {
            "Customer": "Test",
            "ErrorCount": "19",
            "ErrorMessage": "an error",
            "Host": "host1",
            "RecommendedActions": "",
            "Severity": "LOW",
        },
        {
            "Customer": "Test",
            "ErrorCount": "3057",
            "ErrorMessage": "A different error",
            "Host": "host1",
            "RecommendedActions": "",
            "Severity": "LOW",
        },
.... etc

I am hoping to get a list out of it like:

an error
A different error

and so on.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f472f183-e541-417e-a371-31f3424cb50f%40googlegroups.com.

Reply via email to