host=*
| map search="| dbquery Database \"SELECT * FROM Table WHERE Column='$host$'\""
| table *
I'm fairly new to Splunk (only been playing with it since last Thursday) and I'm still trying to figure things out. What I'm trying to achieve with script is get all hosts, look them up in the database and then output any data resulting from the match. It seems to work but only for one host where literally hundreds to thousands should be present.
What am I doing wrong?
Try this:
host=* | dedup host | map search="| dbquery Database \"SELECT * FROM Table WHERE Column='$host$'\""
Try this:
host=* | dedup host | map search="| dbquery Database \"SELECT * FROM Table WHERE Column='$host$'\""
That did it. Why would dedup make that work, though? I don't see the connection...
There is probably a limit to the map command and if you do not dedup
then you send the same value in over and over and over and over until you hit that limit, before ever getting to any other host
values.