<?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 change date_wday for different countries in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172952#M49596</link>
    <description>&lt;P&gt;sno,country,start_hour,end_hour,receivebandwidth,transmitbandwidth,sitename,tier,threshold,work_wdays,work_wdays_len&lt;BR /&gt;
1,C:\Network Analysis\tier1\rusxwalmartedc S0-0-0.csv,0,24,1,1,Walmart,tier1,70%,Mon:Tue:Wed:Thu,15&lt;BR /&gt;
2,C:\Network Analysis\tier1\rdinmumbai010-7-1 S2-0.csv,0,24,45,45,Mumbai,tier1,70%,Sun:Mon:Tue:Wed:Thu:Fri:Sat,27&lt;BR /&gt;
3,C:\Network Analysis\tier2\rdingurgao010-5-1 f0-1.csv,0,24,20,20,Gurgaon,tier2,80%,Mon:Tue:Wed:Thu:Fri,19&lt;BR /&gt;
4,C:\Network Analysis\tier3\rdinsecund010-5-2 Gig0-0.csv,0,24,20,20,Secunderabad,tier3,90%,Mon:Tue:Wed:Thu:Fri,19&lt;BR /&gt;
5,C:\Network Analysis\tier2\rdphcebu010-5-1 f0-2-0.csv,0,24,40,40,Cebu,tier2,80%,Sun:Mon:Tue:Wed:Thu:Fri:Sat,27&lt;BR /&gt;
6,C:\Network Analysis\tier1\rdgbreddit010-1-2 Gig0-2.csv,0,24,100,100,Redditch,tier1,70%,Sun:Mon:Tue:Wed:Thu:Fri:Sat,27&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 07:04:44 GMT</pubDate>
    <dc:creator>deepthi5</dc:creator>
    <dc:date>2020-09-29T07:04:44Z</dc:date>
    <item>
      <title>how to change date_wday for different countries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172947#M49591</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I have got a search query running the same query on different source files&lt;/P&gt;

&lt;P&gt;ource="C:\Budapest Router1full.csv" OR source="C:\Adelaide Router1full.csv" OR source="C:\Network Analysis\tier1\rusxwalmartedc S0-0-0.csv" OR  source="C:\Network Analysis\tier1\rdinmumbai010-7-1 S2-0.csv" OR source="C:\Network Analysis\tier2\rdingurgao010-5-1 f0-1.csv" OR source="C:\Network Analysis\tier3\rdinsecund010-5-2 Gig0-0.csv" OR source="C:\Network Analysis\tier2\rdphcebu010-5-1 f0-2-0.csv"host="SEZ00VVM-153"   sourcetype="csv"    | rex field=source "(?&amp;lt;country&amp;gt;.*?)$"   | lookup datacentre.csv country OUTPUT start_hour end_hour receivebandwidth sitename tier   | search sitename="cebu" tier=tier2    | where date_hour&amp;gt;=start_hour AND date_hour&amp;lt;= end_hour  |eval Intraffic=IN/1048576   | bin _time span=1h  | stats values(receivebandwidth) as maxin ,perc95(Intraffic) AS Percentile by _time  | eval seventyperc= maxin*0.7   | eval eightyperc=maxin*0.8    | eval nightyperc=maxin*0.9&lt;/P&gt;

&lt;P&gt;I have different sites working for different business days can i get this done using look up &lt;BR /&gt;
example:Cebu :Monday-Friday&lt;BR /&gt;
Mumbai-Sunday to saturday (24*7)&lt;BR /&gt;
Us-monday -thursday&lt;/P&gt;

&lt;P&gt;How can i do that using the search and declare in lookup file&lt;/P&gt;

&lt;P&gt;Please Help me &lt;/P&gt;

&lt;P&gt;Thanks and Regards,&lt;BR /&gt;
Deepthi&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:59:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172947#M49591</guid>
      <dc:creator>deepthi5</dc:creator>
      <dc:date>2020-09-29T06:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to change date_wday for different countries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172948#M49592</link>
      <description>&lt;P&gt;You can have a lookup file like this with a&lt;CODE&gt;work_wdays&lt;/CODE&gt; field and a &lt;CODE&gt;work_wdays_strlen&lt;/CODE&gt; on the end that is the length (number of characters) in the &lt;CODE&gt;work_wdays&lt;/CODE&gt; field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Country, ..... ,work_wdays,work_wdays_len
 Cebu, ..... ,Mon:Tue:Wed:Thu:Fri,19
 Mumbai, ..... ,Sun:Mon:Tue:Wed:Thu:Fri:Sat,27
 Us, ..... ,Mon:Tue:Wed:Thu,15
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then your search changes to this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source="C:Budapest Router1full.csv" OR source="C:Adelaide Router1full.csv" OR source="C:Network Analysistier1rusxwalmartedc S0-0-0.csv" OR source="C:Network Analysistier1rdinmumbai010-7-1 S2-0.csv" OR source="C:Network Analysistier2rdingurgao010-5-1 f0-1.csv" OR source="C:Network Analysistier3rdinsecund010-5-2 Gig0-0.csv" OR source="C:Network Analysistier2rdphcebu010-5-1 f0-2-0.csv"host="SEZ00VVM-153" sourcetype="csv" | rex field=source "(?&amp;lt;country&amp;gt;.*?)$" | lookup datacentre.csv country OUTPUT start_hour end_hour receivebandwidth sitename tier start_wday end_wday| eval date_wday=strftime(_time,"%a") | search sitename="cebu" tier=tier2 | where date_hour&amp;gt;=start_hour AND date_hour&amp;lt;= end_hour AND (len(trim(work_wdays,date_wday)) &amp;lt; work_wdays_len) |eval Intraffic=IN/1048576 | bin _time span=1h | stats values(receivebandwidth) as maxin ,perc95(Intraffic) AS Percentile by _time | eval seventyperc= maxin*0.7 | eval eightyperc=maxin*0.8 | eval nightyperc=maxin*0.9
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Aug 2015 15:59:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172948#M49592</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-14T15:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to change date_wday for different countries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172949#M49593</link>
      <description>&lt;P&gt;Hi Woodcock,&lt;/P&gt;

&lt;P&gt;This did not work for me may due to len function&lt;BR /&gt;
For sun to saturday sites it worked fine  But from Mon to friday sites Using this query it picked up only Monday samples and friday samples skipping all the data in between can you please help me &lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2015 07:40:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172949#M49593</guid>
      <dc:creator>deepthi5</dc:creator>
      <dc:date>2015-08-26T07:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to change date_wday for different countries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172950#M49594</link>
      <description>&lt;P&gt;one more comment for monday to thursday it picked up monday tuesday and thursday skipping wednesay data &lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2015 07:46:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172950#M49594</guid>
      <dc:creator>deepthi5</dc:creator>
      <dc:date>2015-08-26T07:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to change date_wday for different countries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172951#M49595</link>
      <description>&lt;P&gt;You data file must use only the following values when constructing &lt;CODE&gt;date_wday&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sun, Mon, Tue, Wed, Thu, Fri, Sat
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you are using any other capitalization or spelling, it will fail.  I can only assume that your &lt;CODE&gt;work_wdays&lt;/CODE&gt; strings are built such that the &lt;CODE&gt;trim&lt;/CODE&gt; command will not find a match (see previous comment) or that your &lt;CODE&gt;work_wdays_len&lt;/CODE&gt; calculation is wrong for some of them.  Show me your &lt;CODE&gt;datacentre.csv&lt;/CODE&gt; file's contents; that is probably where the problem exists.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2015 14:24:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172951#M49595</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-26T14:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to change date_wday for different countries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172952#M49596</link>
      <description>&lt;P&gt;sno,country,start_hour,end_hour,receivebandwidth,transmitbandwidth,sitename,tier,threshold,work_wdays,work_wdays_len&lt;BR /&gt;
1,C:\Network Analysis\tier1\rusxwalmartedc S0-0-0.csv,0,24,1,1,Walmart,tier1,70%,Mon:Tue:Wed:Thu,15&lt;BR /&gt;
2,C:\Network Analysis\tier1\rdinmumbai010-7-1 S2-0.csv,0,24,45,45,Mumbai,tier1,70%,Sun:Mon:Tue:Wed:Thu:Fri:Sat,27&lt;BR /&gt;
3,C:\Network Analysis\tier2\rdingurgao010-5-1 f0-1.csv,0,24,20,20,Gurgaon,tier2,80%,Mon:Tue:Wed:Thu:Fri,19&lt;BR /&gt;
4,C:\Network Analysis\tier3\rdinsecund010-5-2 Gig0-0.csv,0,24,20,20,Secunderabad,tier3,90%,Mon:Tue:Wed:Thu:Fri,19&lt;BR /&gt;
5,C:\Network Analysis\tier2\rdphcebu010-5-1 f0-2-0.csv,0,24,40,40,Cebu,tier2,80%,Sun:Mon:Tue:Wed:Thu:Fri:Sat,27&lt;BR /&gt;
6,C:\Network Analysis\tier1\rdgbreddit010-1-2 Gig0-2.csv,0,24,100,100,Redditch,tier1,70%,Sun:Mon:Tue:Wed:Thu:Fri:Sat,27&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172952#M49596</guid>
      <dc:creator>deepthi5</dc:creator>
      <dc:date>2020-09-29T07:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to change date_wday for different countries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172953#M49597</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;That still   did not work  for me i have got an other solution for this &lt;/P&gt;

&lt;P&gt;sourcetype="csv" |rex field=source "(?.*?)$"| lookup datacentre.csv country OUTPUT start_hour end_hour receivebandwidth sitename tier start_wday end_wday|eval date_wday=strftime(_time,"%u")|search tier=tier2|where date_hour&amp;gt;=start_hour AND date_hour&amp;lt;= end_hour AND date_wday&amp;gt;=start_wday AND date_wday&amp;lt;=end_wday|&lt;/P&gt;

&lt;P&gt;start_wday end-wday can be given in look up table starting with 1 for Monday to 7 for Sunday&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:11:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-change-date-wday-for-different-countries/m-p/172953#M49597</guid>
      <dc:creator>deepthi5</dc:creator>
      <dc:date>2020-09-29T07:11:32Z</dc:date>
    </item>
  </channel>
</rss>

