<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: OR statement with results from DBXquery in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/OR-statement-with-results-from-DBXquery/m-p/755612#M242953</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/274090"&gt;@DarthHerm&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I started to look into this but hit a stumbling block.&lt;/P&gt;&lt;P&gt;You can get a subquery to return an OR using the 'return' command, such as:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=2 | eval product=123 | streamstats count as CandyNoteInfoId | return 100 CandyNoteInfoId&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1763420106129.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/40839i61DABCF4BC11A8C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1763420106129.png" alt="livehybrid_0-1763420106129.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You would ensure that the fieldname returned matches the field in your wider search and then apply this as a subsearch by placing in square braces ([ ]) as part of your main search - however in your data I cannot see a&amp;nbsp;&lt;SPAN&gt;CandyNoteInfoId field, I can only see it as part of an object with the name and value in different fields as&amp;nbsp;parameters{}.name, is that right?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
    <pubDate>Mon, 17 Nov 2025 23:05:52 GMT</pubDate>
    <dc:creator>livehybrid</dc:creator>
    <dc:date>2025-11-17T23:05:52Z</dc:date>
    <item>
      <title>OR statement with results from DBXquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/OR-statement-with-results-from-DBXquery/m-p/755607#M242952</link>
      <description>&lt;P&gt;Hopefully this makes some sense.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am working on a dashboard that pulls up activity when someone clicks on the details on a note.&amp;nbsp; The event log lists the note id number but it not tied to the product page the user is on.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Leveraging dbxquery, I have a query that generates me the Note Ids for the Product page. Pending on the product, there could be just a handful or several hundred.&amp;nbsp;&lt;/P&gt;&lt;P&gt;with the results of the dbxquery, is it possible to take those results and have it as a large OR statement? I considered making the noteid as a seperate drop down in my dashboard but the problem with multiple hundred notes to a specific product makes it difficult. I want to in the dashboard to show when a user with the product selected to see when they clicked on the details of that product's notes. Right now I have it show all the notes a user pulls up.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;dbxquery (sanitzed)&lt;BR /&gt;| dbxquery query="SELECT o.[CandyNoteInfoId] ,n.[CandyNoteId] ,o.[ProductId] ,o.[NoteTypeId] ,o.[StaffId] as userId ,o.[UpdateUserId] ,n.[Details] FROM [DataBase_Name].[ind].[CandyNoteInfo] o left join [DataBase_Name].[ind].[CandyNote] n on o.[CandyNoteInfoId] = n.[CandyNoteInfoId] where ProductId = 12345" connection="Confection"&lt;BR /&gt;|stats count by CandyNoteInfoId&lt;BR /&gt;&lt;BR /&gt;Current search without the DBXquery results.&amp;nbsp;&lt;BR /&gt;index="index_name" userName=pvenkman module="Vendor.Product.BLL.Candy" storedProcedureName=CandyNoteInfoGetById&lt;BR /&gt;| dedup _time&lt;BR /&gt;| eval newtime=strftime(_time,"%b %d, %Y %I:%M:%S %p %Z")&lt;BR /&gt;| table newtime userName serverHost CandyNoteInfoId storedProcedureName&lt;BR /&gt;| rename newtime AS "Date and time" userName AS "Username" serverHost AS "Atlas server" CandyNoteInfoId AS "SQL Candy note info id number" storedProcedureName AS "Stored procedure name"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Raw text of event log (sanitized)&lt;/P&gt;&lt;P&gt;{"auditResultSets":null,"schema":"ind","storedProcedureName":"CandyNoteInfoGetById","commandText":"ind.CandyNoteInfoGetById","Locking":null,"commandType":4,"parameters":[{"name":"@RETURN_VALUE","value":0},{"name":"@CandyNoteInfoId","value":15979125}],"serverIPAddress":"000.000.000.000","serverHost":"webserver","clientIPAddress":"111.111.111.111","sourceSystem":"WebSite","module":"Vendor.Product.BLL.Candy","accessDate":"2025-11-14T12:52:15.1335635-07:00","userId":1984,"userName":"pvenkman","traceInformation":[{"type":"Page","class":"Vendor.Product.Web.UI.Website.Client.NotesDetails","method":"Page_Load"},{"type":"Manager","class":"Vendor.Product.BLL.Candy.CandyNoteInfoManager","method":"Get"}]}&lt;BR /&gt;&lt;BR /&gt;Syntax highlighted&lt;BR /&gt;{ [-]&lt;BR /&gt;auditResultSets: null,&lt;BR /&gt;schema: "ind",&lt;BR /&gt;storedProcedureName: "CandyNoteInfoGetById",&lt;BR /&gt;commandText: "ind.CandyNoteInfoGetById",&lt;BR /&gt;Locking: null,&lt;BR /&gt;commandType: 4,&lt;BR /&gt;parameters: [ [-]&lt;BR /&gt;{ [-]&lt;BR /&gt;name: "@RETURN_VALUE",&lt;BR /&gt;value: 0&lt;BR /&gt;},&lt;BR /&gt;{ [-]&lt;BR /&gt;name: "@CandyNoteInfoId",&lt;BR /&gt;value: 15979125&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;serverIPAddress: "000.000.000.000",&lt;BR /&gt;serverHost: "webserver",&lt;BR /&gt;clientIPAddress: "111.111.111.111",&lt;BR /&gt;sourceSystem: "WebSite",&lt;BR /&gt;module: "Vendor.Product.BLL.Candy",&lt;BR /&gt;accessDate: "2025-11-14T12:52:15.1335635-07:00",&lt;BR /&gt;userId: 1984,&lt;BR /&gt;userName: "pvenkman",&lt;BR /&gt;traceInformation: [ [-]&lt;BR /&gt;{ [-]&lt;BR /&gt;type: "Page",&lt;BR /&gt;class: "Vendor.Product.Web.UI.Website.Client.NotesDetails",&lt;BR /&gt;method: "Page_Load"&lt;BR /&gt;},&lt;BR /&gt;{ [-]&lt;BR /&gt;type: "Manager",&lt;BR /&gt;class: "Vendor.Product.BLL.Candy.CandyNoteInfoManager",&lt;BR /&gt;method: "Get"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 17 Nov 2025 22:15:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/OR-statement-with-results-from-DBXquery/m-p/755607#M242952</guid>
      <dc:creator>DarthHerm</dc:creator>
      <dc:date>2025-11-17T22:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: OR statement with results from DBXquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/OR-statement-with-results-from-DBXquery/m-p/755612#M242953</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/274090"&gt;@DarthHerm&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I started to look into this but hit a stumbling block.&lt;/P&gt;&lt;P&gt;You can get a subquery to return an OR using the 'return' command, such as:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=2 | eval product=123 | streamstats count as CandyNoteInfoId | return 100 CandyNoteInfoId&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1763420106129.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/40839i61DABCF4BC11A8C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1763420106129.png" alt="livehybrid_0-1763420106129.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You would ensure that the fieldname returned matches the field in your wider search and then apply this as a subsearch by placing in square braces ([ ]) as part of your main search - however in your data I cannot see a&amp;nbsp;&lt;SPAN&gt;CandyNoteInfoId field, I can only see it as part of an object with the name and value in different fields as&amp;nbsp;parameters{}.name, is that right?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
      <pubDate>Mon, 17 Nov 2025 23:05:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/OR-statement-with-results-from-DBXquery/m-p/755612#M242953</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-11-17T23:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: OR statement with results from DBXquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/OR-statement-with-results-from-DBXquery/m-p/755617#M242954</link>
      <description>&lt;P&gt;You can get the format statement to create an OR query with a multivalue field, is this something you can use&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| stats values(CandyNoteInfoId) as search
| format&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 18 Nov 2025 00:20:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/OR-statement-with-results-from-DBXquery/m-p/755617#M242954</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-11-18T00:20:19Z</dc:date>
    </item>
  </channel>
</rss>

