<?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: How can I clean up my Splunk search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263206#M79011</link>
    <description>&lt;P&gt;May something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=firewall NOT [| gentimes start=-1 | eval fields="Destination_Port Source_Port 1_Dst_Port 1_Src_Port 1_Dst_Nat_Port 1_Src_Nat_Port" | eval ports="80 443 8080" | fields fields ports | makemv fields | makemv ports | mvexpand fields | mvexpand ports | eval {fields}=ports | fields - fields ports | format "" "" "" "OR" "" ""]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just add/update/remove field names and the port numbers in the subsearch.&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2016 18:12:31 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-02-02T18:12:31Z</dc:date>
    <item>
      <title>How can I clean up my Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263205#M79010</link>
      <description>&lt;P&gt;How do I clean up the following Splunk search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=firewall Destination_Port!=80 Destination_Port!=443 Destination_Port!=8080 Source_Port!=80 Source_Port!=443 Source_Port!=8080 1_Dst_Port!=80 1_Dst_Port!=443 1_Dst_Port!=8080 1_Src_Port!=80 1_Src_Port!=443 1_Src_Port!=8080 1_Dst_Nat_Port!=80 1_Dst_Nat_Port!=443 1_Dst_Nat_Port!=8080 1_Src_Nat_Port!=80 1_Src_Nat_Port!=443 1_Src_Nat_Port!=8080
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Feb 2016 17:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263205#M79010</guid>
      <dc:creator>phspec</dc:creator>
      <dc:date>2016-02-02T17:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I clean up my Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263206#M79011</link>
      <description>&lt;P&gt;May something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=firewall NOT [| gentimes start=-1 | eval fields="Destination_Port Source_Port 1_Dst_Port 1_Src_Port 1_Dst_Nat_Port 1_Src_Nat_Port" | eval ports="80 443 8080" | fields fields ports | makemv fields | makemv ports | mvexpand fields | mvexpand ports | eval {fields}=ports | fields - fields ports | format "" "" "" "OR" "" ""]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just add/update/remove field names and the port numbers in the subsearch.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 18:12:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263206#M79011</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-02T18:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I clean up my Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263207#M79012</link>
      <description>&lt;P&gt;if I wanted the search to go back 3 days, would the "gentimes start=-3d"?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 18:14:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263207#M79012</guid>
      <dc:creator>phspec</dc:creator>
      <dc:date>2016-02-02T18:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I clean up my Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263208#M79013</link>
      <description>&lt;P&gt;Ohh no. The gentimes is basically an event generator that I use (your can use just the '| stats count' as well there). It has nothing to do with the requirement you've here. The subsearch is generating the dynamic conditions (you can check the normalizedSearch property in Inspect job) from the results of the subsearch. For more details just run the subsearch in a separate search page.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 18:22:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263208#M79013</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-02T18:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I clean up my Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263209#M79014</link>
      <description>&lt;P&gt;Also, I get the following error: Error in 'search' command: Unable to parse the search: 'OR' operator is missing a clause on the right hand side.&lt;/P&gt;

&lt;P&gt;When I add two double quotes to the right of the 'OR' operator, I get the following error: Error in 'format' command: Invalid argument: '' &lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 18:24:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263209#M79014</guid>
      <dc:creator>phspec</dc:creator>
      <dc:date>2016-02-02T18:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: How can I clean up my Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263210#M79015</link>
      <description>&lt;P&gt;Try running it with the format command. So just this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=firewall NOT [| gentimes start=-1 | eval fields="Destination_Port Source_Port 1_Dst_Port 1_Src_Port 1_Dst_Nat_Port 1_Src_Nat_Port" | eval ports="80 443 8080" | fields fields ports | makemv fields | makemv ports | mvexpand fields | mvexpand ports | eval {fields}=ports | fields - fields ports ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Feb 2016 18:46:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263210#M79015</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-02T18:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I clean up my Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263211#M79016</link>
      <description>&lt;P&gt;without the format command, the query works. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 21:58:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263211#M79016</guid>
      <dc:creator>phspec</dc:creator>
      <dc:date>2016-02-02T21:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I clean up my Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263212#M79017</link>
      <description>&lt;P&gt;I'm trying to get the query going back 3 days, so I've tried the "gentimes" command formatting as such: gentimes start=1/31/16 end=2/2/16, and I've also tried: gentimes start=-3 end=0 interval=1d, but my query only goes back 1 hour. Could you possibly indicate where my syntax is wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 22:57:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-clean-up-my-Splunk-search/m-p/263212#M79017</guid>
      <dc:creator>phspec</dc:creator>
      <dc:date>2016-02-02T22:57:39Z</dc:date>
    </item>
  </channel>
</rss>

