<?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: Splunk Rest API Response filtering in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/685618#M19254</link>
    <description>&lt;P&gt;I dont know about the exact postman config for filtering, but via CLI you can test the below first and assuming you can use a Linux syste. .&lt;BR /&gt;&lt;BR /&gt;For the API call its seems to be called&lt;STRONG&gt; name&lt;/STRONG&gt; and not&lt;STRONG&gt; title&lt;/STRONG&gt; as I have noticed, this is difference between | rest and calling the API. (dont know why this is...)&lt;/P&gt;&lt;P&gt;Further more If you install the jq command it’s a json processer command, it will help with the two fields you want, if not remove from my command below.&lt;/P&gt;&lt;P&gt;You will need a token created in Splunk.&lt;/P&gt;&lt;P&gt;See my example below&lt;BR /&gt;&lt;BR /&gt;curl -k -H "Authorization: Bearer &amp;lt;YOUR TOKEN&amp;gt;" https://*****:8089/servicesNS/-/-/admin/macros --get -d output_mode=json | jq '.entry[] | {name: .name, definition: .content.definition}'&lt;/P&gt;&lt;P&gt;This should give you the results for the name of the macro and its defintion, optionally output to a json file&lt;/P&gt;</description>
    <pubDate>Fri, 26 Apr 2024 12:38:06 GMT</pubDate>
    <dc:creator>deepakc</dc:creator>
    <dc:date>2024-04-26T12:38:06Z</dc:date>
    <item>
      <title>Splunk Rest API Response filtering</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/685607#M19251</link>
      <description>&lt;P&gt;Hello ,&lt;BR /&gt;&lt;BR /&gt;Using the below query i am able to get title and Definition of macros .&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;|rest /servicesNS/-/-/admin/macros
|table title,definition&lt;/LI-CODE&gt;
&lt;P&gt;Can this same be achievable using&amp;nbsp;&lt;A href="https://*****:8089/servicesNS/-/-/admin/macros?output_mode=json" target="_blank" rel="noopener"&gt;https://*****:8089/servicesNS/-/-/admin/macros?output_mode=json&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;postman call , that i will get only title and definition in response of an api call .&lt;BR /&gt;&lt;BR /&gt;i tried using filter&amp;nbsp; f, search as per the documentation but its not giving required response&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks In advance&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 14:06:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/685607#M19251</guid>
      <dc:creator>manish_navi</dc:creator>
      <dc:date>2024-04-26T14:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Rest API Response filtering</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/685610#M19252</link>
      <description>&lt;P&gt;Please show exactly what you tried and tell how the results were not what was expected.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 11:55:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/685610#M19252</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-04-26T11:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Rest API Response filtering</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/685618#M19254</link>
      <description>&lt;P&gt;I dont know about the exact postman config for filtering, but via CLI you can test the below first and assuming you can use a Linux syste. .&lt;BR /&gt;&lt;BR /&gt;For the API call its seems to be called&lt;STRONG&gt; name&lt;/STRONG&gt; and not&lt;STRONG&gt; title&lt;/STRONG&gt; as I have noticed, this is difference between | rest and calling the API. (dont know why this is...)&lt;/P&gt;&lt;P&gt;Further more If you install the jq command it’s a json processer command, it will help with the two fields you want, if not remove from my command below.&lt;/P&gt;&lt;P&gt;You will need a token created in Splunk.&lt;/P&gt;&lt;P&gt;See my example below&lt;BR /&gt;&lt;BR /&gt;curl -k -H "Authorization: Bearer &amp;lt;YOUR TOKEN&amp;gt;" https://*****:8089/servicesNS/-/-/admin/macros --get -d output_mode=json | jq '.entry[] | {name: .name, definition: .content.definition}'&lt;/P&gt;&lt;P&gt;This should give you the results for the name of the macro and its defintion, optionally output to a json file&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 12:38:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/685618#M19254</guid>
      <dc:creator>deepakc</dc:creator>
      <dc:date>2024-04-26T12:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Rest API Response filtering</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/685837#M19267</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I was mentioning that by using below query : i can limit the result to show only title and definition&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|rest /servicesNS/-/-/admin/macros
|table title,definition&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Would there be a way to do the same with rest API call for macro :&lt;BR /&gt;&lt;A href="https://%2A%2A%2A%2A%2A:8089/servicesNS/-/-/admin/macros?output_mode=json" target="_blank" rel="noopener nofollow noreferrer"&gt;https://*****:8089/servicesNS/-/-/admin/macros?output_mode=json&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;While using above api call with postman , i am getting all the fields of results but i am interested in getting the result limited to show only "title" and "Definition"&amp;nbsp; .&lt;BR /&gt;Like below i am getting all fields , can i restrict the results to show only name and Definition of macro&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "links": {
        "create": "/servicesNS/-/-/admin/macros/_new",
        "_reload": "/servicesNS/-/-/admin/macros/_reload",
        "_acl": "/servicesNS/-/-/admin/macros/_acl"
    },
    "origin": "https://52.226.64.218:8089/servicesNS/-/-/admin/macros",
    "updated": "2024-04-29T13:11:40+00:00",
    "generator": {
        "build": "78803f08aabb",
        "version": "9.2.1"
    },
    "entry": [
        {
            "name": "3cx_supply_chain_attack_network_indicators_filter",
            "id": "https://52.226.64.218:8089/servicesNS/nobody/DA-ESS-ContentUpdate/admin/macros/3cx_supply_chain_attack_network_indicators_filter",
            "updated": "1970-01-01T00:00:00+00:00",
            "links": {
                "alternate": "/servicesNS/nobody/DA-ESS-ContentUpdate/admin/macros/3cx_supply_chain_attack_network_indicators_filter",
                "list": "/servicesNS/nobody/DA-ESS-ContentUpdate/admin/macros/3cx_supply_chain_attack_network_indicators_filter",
                "_reload": "/servicesNS/nobody/DA-ESS-ContentUpdate/admin/macros/3cx_supply_chain_attack_network_indicators_filter/_reload",
                "edit": "/servicesNS/nobody/DA-ESS-ContentUpdate/admin/macros/3cx_supply_chain_attack_network_indicators_filter",
                "disable": "/servicesNS/nobody/DA-ESS-ContentUpdate/admin/macros/3cx_supply_chain_attack_network_indicators_filter/disable"
            },
            "author": "nobody",
            "acl": {
                "app": "DA-ESS-ContentUpdate",
                "can_change_perms": true,
                "can_list": true,
                "can_share_app": true,
                "can_share_global": true,
                "can_share_user": false,
                "can_write": true,
                "modifiable": true,
                "owner": "nobody",
                "perms": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "admin"
                    ]
                },
                "removable": false,
                "sharing": "global"
            },
            "content": {
                "definition": "search *",
                "description": "Update this macro to limit the output results to filter out false positives.",
                "disabled": false,
                "eai:acl": null,
                "eai:appName": "DA-ESS-ContentUpdate",
                "eai:userName": "nobody"
            }
        }
    ],
    "paging": {
        "total": 2195,
        "perPage": 30,
        "offset": 0
    },
    "messages": []
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 13:13:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/685837#M19267</guid>
      <dc:creator>manish_navi</dc:creator>
      <dc:date>2024-04-29T13:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Rest API Response filtering</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/685852#M19269</link>
      <description>&lt;P&gt;You can filter the API response using the parameters described at &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.2.1/RESTREF/RESTprolog#Pagination_and_filtering_parameters" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.2.1/RESTREF/RESTprolog#Pagination_and_filtering_parameters&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;https://*****:8089/servicesNS/-/-/admin/macros?output_mode=json&amp;amp;f=title&amp;amp;f=description&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Apr 2024 14:15:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/685852#M19269</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-04-29T14:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Rest API Response filtering</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/686839#M19341</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have already tried using this if you see my posted questions , there i have already mentioned that filters parameter f , is not working .&lt;BR /&gt;&lt;BR /&gt;here is the screenshot if what i tried&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="manish_navi_0-1715147507778.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/30733iFD95ED1CC40CE66C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="manish_navi_0-1715147507778.png" alt="manish_navi_0-1715147507778.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 05:51:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/686839#M19341</guid>
      <dc:creator>manish_navi</dc:creator>
      <dc:date>2024-05-08T05:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Rest API Response filtering</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/686880#M19345</link>
      <description>&lt;P&gt;I believe you have to use the full name of the field ("entry.name", for example).&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 12:09:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/686880#M19345</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-05-08T12:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Rest API Response filtering</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/686890#M19347</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;it seems that when you are using output_mode=json those f=xyz didn't work. Instead of those you must use jq as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/79189"&gt;@deepakc&lt;/a&gt;&amp;nbsp;already propose.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -ksu $UP 'https://localhost:8089/servicesNS/-/-/admin/macros?count=4&amp;amp;output_mode=json' | jq '.entry[].name'
"3cx_supply_chain_attack_network_indicators_filter"
"7zip_commandline_to_smb_share_path_filter"
"abnormally_high_aws_instances_launched_by_user___mltk_filter"
"abnormally_high_aws_instances_launched_by_user_filter"&lt;/LI-CODE&gt;&lt;P&gt;You could/should leave comment on doc page where output_mode has defined and add information that if you are using json mode then f=xyz doesn't work. Doc team is really helpful to update that kind of notes into real documentation.&lt;/P&gt;&lt;P&gt;r. Ismo&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 13:44:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/686890#M19347</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-05-08T13:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Rest API Response filtering</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/688427#M19442</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/79189"&gt;@deepakc&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp; , If this require installation of JQ , then it would not be possible , because if i want my customer to use the application , and prerequisite is to install the JQ widget , I simply cant force my customer.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 09:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/688427#M19442</guid>
      <dc:creator>manish_navi</dc:creator>
      <dc:date>2024-05-23T09:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Rest API Response filtering</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/688428#M19443</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;would be helpful , if you can give screenshot of working solution , as i have tried this as well and no luck&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 09:23:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/688428#M19443</guid>
      <dc:creator>manish_navi</dc:creator>
      <dc:date>2024-05-23T09:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Rest API Response filtering</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/688430#M19444</link>
      <description>&lt;P&gt;The jq was a suggestion, and an optional command to help with filtering, if they can't use it, then they have to find an alternative method.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 09:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-Rest-API-Response-filtering/m-p/688430#M19444</guid>
      <dc:creator>deepakc</dc:creator>
      <dc:date>2024-05-23T09:26:02Z</dc:date>
    </item>
  </channel>
</rss>

