<?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: SNOW TA: How to use filter_data when key-value has javascript in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/SNOW-TA-How-to-use-filter-data-when-key-value-has-javascript/m-p/546599#M65289</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/202008"&gt;@shandr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Splunk_TA_snow only accepts query parameters of the form key=value.&lt;/P&gt;&lt;P&gt;From Splunk_TA_snow/bin/snow.py:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def valid_filter_data_format(filter_data):
    """
    Parses the filter_data string and returns True if the filter_data is of the format:
    "key1=value1&amp;amp;key2=value2|key3=value3"
    """
    filter_data_list = re.split(r'&amp;amp;|\|', filter_data)
    for filter_data_value in filter_data_list:
        try:
            filter_key, filter_value = [ field.strip() for field in filter_data_value.split("=") ]
        except ValueError:
            return False
        else:
            if any((not filter_key, not filter_value)):
                return False
    return True&lt;/LI-CODE&gt;&lt;P&gt;This is a Splunk supported app, so your best long-term option is to open a support case. Splunk will most likely categorize the case as a feature enhancement request.&lt;/P&gt;&lt;P&gt;ServiceNow Paris (the latest release supported by Splunk) has a significant number of operators beyond "=" for various field types that Splunk should endeavor to support in filters:&amp;nbsp;&lt;A href="https://docs.servicenow.com/bundle/paris-platform-user-interface/page/use/common-ui-elements/reference/r_OpAvailableFiltersQueries.html" target="_self"&gt;https://docs.servicenow.com/bundle/paris-platform-user-interface/page/use/common-ui-elements/reference/r_OpAvailableFiltersQueries.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In the short-term, you could rewrite the valid_filter_data_format function to pass the operators you use, but you'll want to be mindful of the impact to other parts of the code that use or interpret the filter data.&lt;/P&gt;</description>
    <pubDate>Sat, 03 Apr 2021 15:52:54 GMT</pubDate>
    <dc:creator>tscroggins</dc:creator>
    <dc:date>2021-04-03T15:52:54Z</dc:date>
    <item>
      <title>SNOW TA: How to use filter_data when key-value has javascript</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/SNOW-TA-How-to-use-filter-data-when-key-value-has-javascript/m-p/546310#M65279</link>
      <description>&lt;P&gt;Does anybody know what my inputs.conf setting for filter_data must look like for a key-value like below?&lt;/P&gt;&lt;P&gt;I cannot find any detailed documentation on filter_data. And&amp;nbsp;see same error when I try to use URL encoding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;[snow://pa_job_logs4_javascript]&lt;BR /&gt;table = pa_job_logs&lt;BR /&gt;filter_data = run_time&amp;gt;javascript&amp;amp;colon;gs.getDurationDate('0 3:0:0')&amp;amp;sys_created_onONLast 3 months@javascript&amp;amp;colon;gs.beginningOfLast3Months()@javascript&amp;amp;colon;gs.endOfLast3Months()&lt;/P&gt;&lt;P&gt;2021-03-31 18:04:32,776 ERROR pid=22626 tid=MainThread file=snow.py:_check_filter_data:74&lt;BR /&gt;| Got unexpected value run_time&amp;gt;javascript&amp;amp;colon;gs.getDurationDate('0 3:0:0')&amp;amp;sys_created_onONLast 3 months@javascript&amp;amp;colon;gs.beginningOfLast3Months()@javascript&amp;amp;colon;gs.endOfLast3Months() of 'filter_data' field for input 'pa_job_logs4_javascript'.&amp;nbsp;Enter filter parameters in key1=value1&amp;amp;key2=value2 format.&amp;nbsp;You can either change it in inputs.conf file or edit 'Filter parameters' on Inputs page.&lt;/P&gt;&lt;P&gt;Above table filter seems to work with the REST API Explorer in Service Now, i.e. sysparm_query=run_time....&lt;/P&gt;&lt;P&gt;Is there some trick to simplify it? or a work-around?&lt;BR /&gt;Splunk Add-on for ServiceNow version 4.0.0&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 22:30:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/SNOW-TA-How-to-use-filter-data-when-key-value-has-javascript/m-p/546310#M65279</guid>
      <dc:creator>shandr</dc:creator>
      <dc:date>2021-03-31T22:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: SNOW TA: How to use filter_data when key-value has javascript</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/SNOW-TA-How-to-use-filter-data-when-key-value-has-javascript/m-p/546599#M65289</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/202008"&gt;@shandr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Splunk_TA_snow only accepts query parameters of the form key=value.&lt;/P&gt;&lt;P&gt;From Splunk_TA_snow/bin/snow.py:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def valid_filter_data_format(filter_data):
    """
    Parses the filter_data string and returns True if the filter_data is of the format:
    "key1=value1&amp;amp;key2=value2|key3=value3"
    """
    filter_data_list = re.split(r'&amp;amp;|\|', filter_data)
    for filter_data_value in filter_data_list:
        try:
            filter_key, filter_value = [ field.strip() for field in filter_data_value.split("=") ]
        except ValueError:
            return False
        else:
            if any((not filter_key, not filter_value)):
                return False
    return True&lt;/LI-CODE&gt;&lt;P&gt;This is a Splunk supported app, so your best long-term option is to open a support case. Splunk will most likely categorize the case as a feature enhancement request.&lt;/P&gt;&lt;P&gt;ServiceNow Paris (the latest release supported by Splunk) has a significant number of operators beyond "=" for various field types that Splunk should endeavor to support in filters:&amp;nbsp;&lt;A href="https://docs.servicenow.com/bundle/paris-platform-user-interface/page/use/common-ui-elements/reference/r_OpAvailableFiltersQueries.html" target="_self"&gt;https://docs.servicenow.com/bundle/paris-platform-user-interface/page/use/common-ui-elements/reference/r_OpAvailableFiltersQueries.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In the short-term, you could rewrite the valid_filter_data_format function to pass the operators you use, but you'll want to be mindful of the impact to other parts of the code that use or interpret the filter data.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Apr 2021 15:52:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/SNOW-TA-How-to-use-filter-data-when-key-value-has-javascript/m-p/546599#M65289</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-04-03T15:52:54Z</dc:date>
    </item>
  </channel>
</rss>

