<?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: macro with DBquery in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/macro-with-DBquery/m-p/124437#M1275</link>
    <description>&lt;P&gt;Is the macro eval based? Can you post the macro content?&lt;/P&gt;</description>
    <pubDate>Tue, 08 Apr 2014 16:43:28 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-04-08T16:43:28Z</dc:date>
    <item>
      <title>macro with DBquery</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/macro-with-DBquery/m-p/124436#M1274</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;
I used macro and its return some results, I want to run dbquery to passing parameter using the macro results &lt;BR /&gt;
How can i run the Splunk query&lt;/P&gt;

&lt;P&gt;example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`testmacro` | map search = "dbquery Database \"SELECT [Change_ID],[Approval_Status_Overall],[Approval_Status_Current],[Assignment_Change_Assignee] FROM [ARSystem].[dbo].[A_Reporting_CHG_Infrastructure_Change_Base_Datamart_AllOpen] where host = $A$\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;here macro result was Asd23400SA&lt;BR /&gt;
&lt;CODE&gt;testmacro&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Senthil.R&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2014 16:20:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/macro-with-DBquery/m-p/124436#M1274</guid>
      <dc:creator>senthilgoa</dc:creator>
      <dc:date>2014-04-08T16:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: macro with DBquery</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/macro-with-DBquery/m-p/124437#M1275</link>
      <description>&lt;P&gt;Is the macro eval based? Can you post the macro content?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2014 16:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/macro-with-DBquery/m-p/124437#M1275</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-04-08T16:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: macro with DBquery</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/macro-with-DBquery/m-p/124438#M1276</link>
      <description>&lt;P&gt;Macroname : DB_changes_by_org_grp&lt;BR /&gt;
macro Content : dbquery DB "SELECT * FROM [ARSystem].[dbo].[A_Reporting_CHG_Infrastructure_Change_Base_Datamart_AllOpen] "&lt;BR /&gt;
Description : fetches data form SQL &lt;/P&gt;

&lt;P&gt;macro name : group&lt;BR /&gt;
| eval so = "$source$" | eval X =replace(so, "group=", "(Assignment_Support_Group_Name LIKE \"") |eval X =replace(X, "org=", "(Assignment_Support_Organization LIKE \"") | eval Y =replace(X,",", "%\") OR ")|eval Y=Y."%\")"&lt;BR /&gt;
Description : evaluate where condition based on parameter (splunk where condition)&lt;/P&gt;

&lt;P&gt;Final Query&lt;BR /&gt;
|&lt;CODE&gt;DB_changes_by_org_grp&lt;/CODE&gt;| where &lt;CODE&gt;group("group=DBA,org=EAWS,group=Appl,org=PTG")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Description : I wnat run final query like this &lt;BR /&gt;
dbquery DB "SELECT * FROM [ARSystem].[dbo].[A_Reporting_CHG_Infrastructure_Change_Base_Datamart_AllOpen] " |where (Assignment_Support_Group_Name LIKE "DBA%") OR (Assignment_Support_Organization LIKE "EAWS%") OR (Assignment_Support_Group_Name LIKE "Appl%") OR (Assignment_Support_Organization LIKE "PTG%")&lt;/P&gt;

&lt;P&gt;we formed a query but we  cant able to run this guery and get the results&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:20:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/macro-with-DBquery/m-p/124438#M1276</guid>
      <dc:creator>senthilgoa</dc:creator>
      <dc:date>2020-09-28T16:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: macro with DBquery</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/macro-with-DBquery/m-p/124439#M1277</link>
      <description>&lt;P&gt;I'm having the same issue. I reported it here:&lt;BR /&gt;
&lt;A href="http://answers.splunk.com/answers/114566/dbquery-command-with-map-command"&gt;http://answers.splunk.com/answers/114566/dbquery-command-with-map-command&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 13:46:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/macro-with-DBquery/m-p/124439#M1277</guid>
      <dc:creator>BP9906</dc:creator>
      <dc:date>2014-07-01T13:46:42Z</dc:date>
    </item>
  </channel>
</rss>

