2017-11-20 11:07 AM - edited 2017-11-20 11:09 AM
I have been trying to find effective ways to use filters to create reports (that can be emailed or saved) based upon criteria. My problem is, I am looking for information to display and sort, not to act on / action (as input for other commands). The workflows that I have been establishing use a loop based on the filter, per line, which will give me the full output, but not in a format that I am able to copy / paste or otherwise use, it just outputs it to the screen following execution. The wonderful thing about WFA is that I can cross reference several tables and values for my entire environment utilizing OCI and OCUM all in one go, rather than just using sql tools to build tables from each, then finding a way to merge them.
I have run into a few problems with this.
1. Not all fields that exist as entries in the OCUM database are queryable by stock WFA (and my attempts to define specific values from keys has had very mixed results, mostly bad)
2. how do you take the results of these filter queries and generate a file / email?
1. continue to create custom filters to query information based on criteria from within WFA
2. output the results into a format that I can use externally (email, excel, etc)
3. create custom workflows using selected filters on an as needed / desired basis (for use in one-offs, environmental checks, pre-checks for specific actions, etc)
2017-11-20 09:29 PM
There is an old post in community, please have a look , It might help you
2017-12-05 09:30 AM - edited 2017-12-05 09:31 AM
There are 2 ways to do it.
You can use the REST API to execute your filters and get filter result in a editable format for preparing your reports.
1. You need to know your filter uuid. To get UUID call the API http://<WFA>/rest/filters to get the list of all filters. Now find your filter name and you get your filter UUID. Take the atom link for 'test' which will be something like: http://<WFA>/rest/filters/f6d29198-f6ff-463c-92e1-afeee221a98e/test
2. on this test link call the method GET with something like http://<WFA>/rest/filters/f6d29198-f6ff-463c-92e1-afeee221a98e/test?param1=val1¶m2=val2
The response will get you the the filter result in XML/JSON format which can be used to prepare reports.
The response will be something like:
<filterTestResults> <filterName>Filter to get all WFA servers</filterName> <dictionaryName>wfa_servers.wfa_server</dictionaryName> <parameters/> <columns> <column>#</column> <column>httpsPort</column> <column>ipv4Address</column> </columns> <rows> <row> <cell key="#" value="1"/> <cell key="httpsPort" value="443"/> <cell key="ipv4Address" value="10.235.44.107"/> </row> <row> <cell key="#" value="2"/> <cell key="httpsPort" value="443"/> <cell key="ipv4Address" value="10.72.41.124"/> </row> </rows> </filterTestResults>
Now you prepare your results.
2. I'll tell you this if you didn't like the first way. But 2nd one is worse, so try the first one.