Avoid empty returns

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Avoid empty returns

L3 Networker

Hello All

 

In my Playbook I run into an issue with empty returns.

My Playbook requests Cherwell with several hosts in an array: ["server-A","server-B"]

In Cherwell, "server-B" does not exist, so I do see that in the "Result Tab" of the Task, but the Output is only from the one Host (server-A), which is in the Cherwell DB.

The reason is, that I have to fill out later some other DB. And they fill me in both Servers (server-A and server-B) the same one content from Cherwell.

How do I avoid "empty" fields?

I'm looking for something like (If output = "no result" then ...)

But this must happen in the Cherwell-Task.

 

To understand:

Cherwell-Task:

Input:

    ["server-A","server-B"]

Result:

    dbot request server-A:

        a Table with contents of server-A

    dbot request server-B:

        "no results"

Output:

    Cherwell.QueryResults [{ "stuff from server-A" }]

 

Next Task I see:

for [{"server-A","server-B"}] insert [{ cherwell-output }]

and cherwell-output contains only info from one server (server-A)

and this Task inserts the content of server-A in both targets (server-A and server-B)

 

How may I bring this "no entry" into this whole loop?

 

I hope my question is clear... 🙂

thanks

roger

 

1 REPLY 1

L3 Networker

Hi,
By default if you query for something that wasn't found- it won't be written to the context, it is like this in pretty much all the integrations,
the Cherwell result should include the host name which you can use to verify if you got anything back regarding that host,
for example if you have an input of 10 hosts, but only some returned data from Cherwell; you can have a task\playbook that will loop the input host names one by one, and will check if it exists in the Cherwell response, if so it will write the data to the other DB, if not it will continue to the next one,
thanks.

  • 1825 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!