<?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 to edit this search to remove the time for maintenance windows using a CSV file? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202160#M58621</link>
    <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=/home/splunk/scripts/rigor/18326_xxxxx_kansasuptime-NG5.xml) index="webmonitor" sourcetype="_xml"     
 | search [inputlookup xxxxx_Web_Maint_Test5.csv
 | eval start=strptime(Starttime,"%m/%d/%Y %H:%M %p")
 | eval end=strptime(Endtime,"%m/%d/%Y %H:%M %p")
 | eval search = "(_time&amp;gt;"+start+" AND _time&amp;lt;"+end+")"  
 | fields search 
 | mvcombine search
 | eval search= "(" + mvjoin(search, " ") + ")"]
 | xmlkv    
 | rename average-response-time AS AvgResponseTime , error-count AS Errors, percentage-uptime AS Uptime, maximum-response-time AS MaxResponse, minimum-response-time AS MinResponse , run-count AS RunCount    
 |bucket _time span=1w     
 |eval Max=round(MaxResponse/1000,2)       
 |eval Min=round(MinResponse/1000,2)       
 |eval AvgResponse=round(AvgResponseTime/1000,2)    
 |eval Avg_Uptime=round(Uptime,2)    
 |eval Time=strftime(_time,"%m/%d/%y    %H")    
 |rex field=source "/home/splunk/scripts/rigor/(?&amp;lt;Rigor_Feed&amp;gt;.+)"    
 |eventstats sum(RunCount) as TotalRunCount by source  
 |stats avg(Uptime) AS Availability last(Avg_Uptime) AS "Last_Avg_Uptime" sum(RunCount) as RunCount last(TotalRunCount) as TotalRunCount sum(Errors) as Errors last(AvgResponse) AS Performance  max(Max) as WorstResponse min(Min) as BestResponse avg(Max) as AvgMax avg(Min) as AvgMin  by Rigor_Feed, Time  
 | rename Rigor_Feed AS Measurement 
 | eval Measurement=case(Measurement="18324_xxxxxxxxxxxuptime-NG5.xml","xxxxxxxxxxx",Measurement="18325_xxxxx-xxxxx,"Ally",Measurement="19345_xxxxx_xxxxxx_xxxxxx_Performance_5.xml","Common Ground",Measurement="23229_xxxxxo_tufts_uptime_5.xml","xxxxx",Measurement="18066_xxxxx_xxxxxxxx-uptime-NG5.xml","Ome Resa",Measurement="18326_xxxxx_kansasuptime-NG5.xml","Kansas",Measurement="19027_xxxxxx-SC-Prod.xml","Topaz xxxxxx-SC",Measurement="15165_Topaz_xxxxx-Prod.xml","Topaz xxxxxx",Measurement="19029_xxxxx_AZ_Nextgen9.xml","Arizona 9",Measurement="8145_Topaz-xxxxx-Prod.xml","Topaz PCMS",1=1,"Unknown") 
 | fields Measurement Availability RunCount Errors
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 20 Sep 2016 21:53:32 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-09-20T21:53:32Z</dc:date>
    <item>
      <title>How to edit this search to remove the time for maintenance windows using a CSV file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202159#M58620</link>
      <description>&lt;P&gt;We've got a search that displays our web monitor logs, and would like to add a function that allows us to remove time for maintenance windows via a CSV file. I ran across this question/answer that talked about what I'm trying to do, but I haven't made it work yet: &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/129068/using-lookup-tables-to-exclude-timerange-from-search.html" target="_blank"&gt;https://answers.splunk.com/answers/129068/using-lookup-tables-to-exclude-timerange-from-search.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The search to display the monitoring results is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(source=/home/splunk/scripts/rigor/18326_xxxxx_kansasuptime-NG5.xml) index="webmonitor" sourcetype="_xml"     
| xmlkv    
| rename average-response-time AS AvgResponseTime , error-count AS Errors, percentage-uptime AS Uptime, maximum-response-time AS MaxResponse, minimum-response-time AS MinResponse , run-count AS RunCount    
|bucket _time span=1w     
|eval Max=round(MaxResponse/1000,2)       
|eval Min=round(MinResponse/1000,2)       
|eval AvgResponse=round(AvgResponseTime/1000,2)    
|eval Avg_Uptime=round(Uptime,2)    
|eval Time=strftime(_time,"%m/%d/%y    %H")    
|rex field=source "/home/splunk/scripts/rigor/(?&amp;lt;Rigor_Feed&amp;gt;.+)"    
|eventstats sum(RunCount) as TotalRunCount by source  
|stats avg(Uptime) AS Availability last(Avg_Uptime) AS "Last_Avg_Uptime" sum(RunCount) as RunCount last(TotalRunCount) as TotalRunCount sum(Errors) as Errors last(AvgResponse) AS Performance  max(Max) as WorstResponse min(Min) as BestResponse avg(Max) as AvgMax avg(Min) as AvgMin  by Rigor_Feed, Time  
| rename Rigor_Feed AS Measurement 
| eval Measurement=case(Measurement="18324_xxxxxxxxxxxuptime-NG5.xml","xxxxxxxxxxx",Measurement="18325_xxxxx-xxxxx,"Ally",Measurement="19345_xxxxx_xxxxxx_xxxxxx_Performance_5.xml","Common Ground",Measurement="23229_xxxxxo_tufts_uptime_5.xml","xxxxx",Measurement="18066_xxxxx_xxxxxxxx-uptime-NG5.xml","Ome Resa",Measurement="18326_xxxxx_kansasuptime-NG5.xml","Kansas",Measurement="19027_xxxxxx-SC-Prod.xml","Topaz xxxxxx-SC",Measurement="15165_Topaz_xxxxx-Prod.xml","Topaz xxxxxx",Measurement="19029_xxxxx_AZ_Nextgen9.xml","Arizona 9",Measurement="8145_Topaz-xxxxx-Prod.xml","Topaz PCMS",1=1,"Unknown") 
| fields Measurement Availability RunCount Errors
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which displays:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Measurement Availability    RunCount    Errors
xxxxxx       99.183007     1777     15
xxxxxx       100.000000   173        0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I add the search from that linked answer, no results appear. This is what I added to the above search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search [inputlookup xxxxx_Web_Maint_Test5.csv
| eval start=strptime(Date." ".Starttime,"%m/%d/%Y %H:%M %p")
| eval end=strptime(Date." ".Endtime,"%m/%d/%Y %H:%M %p")
| eval search = "(_time "+end+")"  
| fields search 
| mvcombine search
| eval search= "(" + mvjoin(search, " ") + ")"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Contents of xxxxx_Web_Maint_Test5.csv:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Check                        Column4   Column5   Column6   Endtime            Starttime
18326_xxxxx_kansasuptime-NG5                             09/19/2016 5:00 AM   09/19/2016 3:00 AM
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Boy I hope that was enough information :). Can someone tell me what I'm doing wrong, and if this is the wrong way to do what I want to do? Thanks for sticking through this :).&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:02:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202159#M58620</guid>
      <dc:creator>banderson7</dc:creator>
      <dc:date>2020-09-29T11:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit this search to remove the time for maintenance windows using a CSV file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202160#M58621</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=/home/splunk/scripts/rigor/18326_xxxxx_kansasuptime-NG5.xml) index="webmonitor" sourcetype="_xml"     
 | search [inputlookup xxxxx_Web_Maint_Test5.csv
 | eval start=strptime(Starttime,"%m/%d/%Y %H:%M %p")
 | eval end=strptime(Endtime,"%m/%d/%Y %H:%M %p")
 | eval search = "(_time&amp;gt;"+start+" AND _time&amp;lt;"+end+")"  
 | fields search 
 | mvcombine search
 | eval search= "(" + mvjoin(search, " ") + ")"]
 | xmlkv    
 | rename average-response-time AS AvgResponseTime , error-count AS Errors, percentage-uptime AS Uptime, maximum-response-time AS MaxResponse, minimum-response-time AS MinResponse , run-count AS RunCount    
 |bucket _time span=1w     
 |eval Max=round(MaxResponse/1000,2)       
 |eval Min=round(MinResponse/1000,2)       
 |eval AvgResponse=round(AvgResponseTime/1000,2)    
 |eval Avg_Uptime=round(Uptime,2)    
 |eval Time=strftime(_time,"%m/%d/%y    %H")    
 |rex field=source "/home/splunk/scripts/rigor/(?&amp;lt;Rigor_Feed&amp;gt;.+)"    
 |eventstats sum(RunCount) as TotalRunCount by source  
 |stats avg(Uptime) AS Availability last(Avg_Uptime) AS "Last_Avg_Uptime" sum(RunCount) as RunCount last(TotalRunCount) as TotalRunCount sum(Errors) as Errors last(AvgResponse) AS Performance  max(Max) as WorstResponse min(Min) as BestResponse avg(Max) as AvgMax avg(Min) as AvgMin  by Rigor_Feed, Time  
 | rename Rigor_Feed AS Measurement 
 | eval Measurement=case(Measurement="18324_xxxxxxxxxxxuptime-NG5.xml","xxxxxxxxxxx",Measurement="18325_xxxxx-xxxxx,"Ally",Measurement="19345_xxxxx_xxxxxx_xxxxxx_Performance_5.xml","Common Ground",Measurement="23229_xxxxxo_tufts_uptime_5.xml","xxxxx",Measurement="18066_xxxxx_xxxxxxxx-uptime-NG5.xml","Ome Resa",Measurement="18326_xxxxx_kansasuptime-NG5.xml","Kansas",Measurement="19027_xxxxxx-SC-Prod.xml","Topaz xxxxxx-SC",Measurement="15165_Topaz_xxxxx-Prod.xml","Topaz xxxxxx",Measurement="19029_xxxxx_AZ_Nextgen9.xml","Arizona 9",Measurement="8145_Topaz-xxxxx-Prod.xml","Topaz PCMS",1=1,"Unknown") 
 | fields Measurement Availability RunCount Errors
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Sep 2016 21:53:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202160#M58621</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-20T21:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit this search to remove the time for maintenance windows using a CSV file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202161#M58622</link>
      <description>&lt;P&gt;I get an unbalanced quotes using this search, and when I remove the " after line 5: &lt;CODE&gt;| eval search = "(_time&amp;gt;"+start+" AND _time&amp;lt;"+end)"&lt;/CODE&gt;, I get &lt;CODE&gt;Error in 'eval' command: The expression is malformed&lt;/CODE&gt;.  Thanks for looking and suggestions.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 01:50:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202161#M58622</guid>
      <dc:creator>banderson7</dc:creator>
      <dc:date>2016-09-21T01:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit this search to remove the time for maintenance windows using a CSV file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202162#M58623</link>
      <description>&lt;P&gt;Try the updated query&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 03:58:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202162#M58623</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-21T03:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit this search to remove the time for maintenance windows using a CSV file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202163#M58624</link>
      <description>&lt;P&gt;After I pulled out the ) from the first line, it's a lot happier. However, it's giving me funny results. When the search is run querying the csv I get 23 checks total. Looks like it's only showing the number of checks in the time period specified in the csv. What I'd like to do is to remove those checks and their associated data from the search results altogether. &lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 14:29:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202163#M58624</guid>
      <dc:creator>banderson7</dc:creator>
      <dc:date>2016-09-21T14:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit this search to remove the time for maintenance windows using a CSV file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202164#M58625</link>
      <description>&lt;P&gt;Change &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search [inputlookup xxxxx_Web_Maint_Test5.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;TO&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search NOT [inputlookup xxxxx_Web_Maint_Test5.csv
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Sep 2016 14:33:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202164#M58625</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-21T14:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit this search to remove the time for maintenance windows using a CSV file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202165#M58626</link>
      <description>&lt;P&gt;No results found, unfortunately.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 17:56:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-this-search-to-remove-the-time-for-maintenance/m-p/202165#M58626</guid>
      <dc:creator>banderson7</dc:creator>
      <dc:date>2016-09-21T17:56:54Z</dc:date>
    </item>
  </channel>
</rss>

