<?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 Adapt search filter to a query in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Adapt-search-filter-to-a-query/m-p/391409#M69955</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;
i need to insert IP addresses here&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4939iB0A6EB1ACD01E382/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;coded as follow:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;input type="text" token="host" searchWhenChanged="false"&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to be applied to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot Cisco_IOS_Event Device last(hostname) AS "Hostname" last(site_id) AS "Site ID" last(model) AS "Model" last(serial_number) AS "Serial number" count(Device) AS "Count of events" SPLITROW host AS host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and many others panels. I should need to understand where to insert in panel's queries the referens to search-box posted above.&lt;/P&gt;

&lt;P&gt;E.g.:&lt;BR /&gt;
in this query, search-box works fine and it outputs me only IPs int 10..29.10.x subnet:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot Cisco_IOS_Event Cisco_IOS_Event count(Cisco_IOS_Event) AS "Count of Cisco IOS Event" SPLITROW host AS host SPLITCOL severity_id_and_name FILTER host is "$host$" SORT 500 host ROWSUMMARY 0 COLSUMMARY 0 NUMCOLS 100 SHOWOTHER 1 | sort -"0 - emergency", -"1 - alert", -"2 - critical", -"3 - error", -"4 - warning", -"5 - notification", -"6 - informational", -"7 - debugging" | table host "0 - emergency" "1 - alert" "2 - critical" "3 - error" "4 - warning" "5 - notification" "6 - informational" "7 - debugging"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope to have explaned clearly.&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;

&lt;P&gt;UPDATE&lt;BR /&gt;
i'm going to this about this filter could be applied only to PIVOT queries..&lt;/P&gt;

&lt;P&gt;because working a little bit more on the previous posted PIVOT query i had successful results.&lt;/P&gt;

&lt;P&gt;But e.g. on the following NON-PIVOT query i'm still have issues:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=cisco_ios-duplex_mismatch | dedup dvc,cdp_local_interface | table _time,dvc,cdp_local_interface,cdp_neighbor,dest_interface,message_text | rename cdp_local_interface AS "Local Int.",cdp_neighbor AS "CDP Neighbor",dest_interface AS "Remote Int.",message_text AS "Message" | sort dvc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 15 May 2018 14:14:21 GMT</pubDate>
    <dc:creator>null0</dc:creator>
    <dc:date>2018-05-15T14:14:21Z</dc:date>
    <item>
      <title>Adapt search filter to a query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adapt-search-filter-to-a-query/m-p/391409#M69955</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
i need to insert IP addresses here&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4939iB0A6EB1ACD01E382/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;coded as follow:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;input type="text" token="host" searchWhenChanged="false"&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to be applied to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot Cisco_IOS_Event Device last(hostname) AS "Hostname" last(site_id) AS "Site ID" last(model) AS "Model" last(serial_number) AS "Serial number" count(Device) AS "Count of events" SPLITROW host AS host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and many others panels. I should need to understand where to insert in panel's queries the referens to search-box posted above.&lt;/P&gt;

&lt;P&gt;E.g.:&lt;BR /&gt;
in this query, search-box works fine and it outputs me only IPs int 10..29.10.x subnet:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot Cisco_IOS_Event Cisco_IOS_Event count(Cisco_IOS_Event) AS "Count of Cisco IOS Event" SPLITROW host AS host SPLITCOL severity_id_and_name FILTER host is "$host$" SORT 500 host ROWSUMMARY 0 COLSUMMARY 0 NUMCOLS 100 SHOWOTHER 1 | sort -"0 - emergency", -"1 - alert", -"2 - critical", -"3 - error", -"4 - warning", -"5 - notification", -"6 - informational", -"7 - debugging" | table host "0 - emergency" "1 - alert" "2 - critical" "3 - error" "4 - warning" "5 - notification" "6 - informational" "7 - debugging"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope to have explaned clearly.&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;

&lt;P&gt;UPDATE&lt;BR /&gt;
i'm going to this about this filter could be applied only to PIVOT queries..&lt;/P&gt;

&lt;P&gt;because working a little bit more on the previous posted PIVOT query i had successful results.&lt;/P&gt;

&lt;P&gt;But e.g. on the following NON-PIVOT query i'm still have issues:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=cisco_ios-duplex_mismatch | dedup dvc,cdp_local_interface | table _time,dvc,cdp_local_interface,cdp_neighbor,dest_interface,message_text | rename cdp_local_interface AS "Local Int.",cdp_neighbor AS "CDP Neighbor",dest_interface AS "Remote Int.",message_text AS "Message" | sort dvc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 May 2018 14:14:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adapt-search-filter-to-a-query/m-p/391409#M69955</guid>
      <dc:creator>null0</dc:creator>
      <dc:date>2018-05-15T14:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Adapt search filter to a query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adapt-search-filter-to-a-query/m-p/391410#M69956</link>
      <description>&lt;P&gt;@null0,  what is the definition of your eventtype &lt;CODE&gt;eventtype=cisco_ios-duplex_mismatch&lt;/CODE&gt;? What is the host fieldname for &lt;CODE&gt;cisco_ios-duplex_mismatch&lt;/CODE&gt; ? Is it host?&lt;/P&gt;

&lt;P&gt;have you tried a filter like the following in your base search with eventtype (where host field name in your raw data is host)?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  eventtype=cisco_ios-duplex_mismatch  host="$host$"
 | dedup dvc,cdp_local_interface 
 | table _time,dvc,cdp_local_interface,cdp_neighbor,dest_interface,message_text 
 | rename cdp_local_interface AS "Local Int.",cdp_neighbor AS "CDP Neighbor",dest_interface AS "Remote Int.",message_text AS "Message" 
 | sort dvc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 May 2018 16:51:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adapt-search-filter-to-a-query/m-p/391410#M69956</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-15T16:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adapt search filter to a query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adapt-search-filter-to-a-query/m-p/391411#M69957</link>
      <description>&lt;P&gt;well it seems working fine adding &lt;STRONG&gt;host="$host$"&lt;/STRONG&gt; to NON_PIVOT query you posted. I'll try soon to adapt all others queries and will send you a feedback.&lt;/P&gt;

&lt;P&gt;thanks a lot&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 17:28:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adapt-search-filter-to-a-query/m-p/391411#M69957</guid>
      <dc:creator>null0</dc:creator>
      <dc:date>2018-05-15T17:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Adapt search filter to a query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adapt-search-filter-to-a-query/m-p/391412#M69958</link>
      <description>&lt;P&gt;Sure, check and revert back. If your issue gets resolved, don't forget to accept the answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 17:37:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adapt-search-filter-to-a-query/m-p/391412#M69958</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-15T17:37:59Z</dc:date>
    </item>
  </channel>
</rss>

