It seems like your issue is you want the raw output, rather than the table- or chart-style output from @aholzer's great suggestions. If so, use <event> instead of <table> . Assuming you have a dropdown that produces a srcType value and a text input for your str value, you should be able to do something like this:
<row>
<event>
<searchString>sourcetype="$srcType$" index="index1" "$str$"</searchString>
</event>
</row>
Check out http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#event for your other options for this tag.
... View more