<?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 build a timechart from a specific field and convert it from UTC to PST? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276316#M83332</link>
    <description>&lt;P&gt;Try this&lt;BR /&gt;
&lt;STRONG&gt;&lt;EM&gt;UPDATED&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=iis_logs http_status!=40* http_status!=5* | eval time=strptime(BeginRequest-UTC, "%Y-%m-%d %H:%M:%S.%3N") |  eval time=time+(10*3600) | bin span=1h time |stats count by time UserAgent | eval time=strftime(time, "%x %X")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;OR&lt;/EM&gt;&lt;/STRONG&gt;*&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=iis_logs http_status!=40* http_status!=5* | eval time=strptime(BeginRequest-UTC, "%Y-%m-%d %H:%M:%S.%3N") | eval time=time+(10*3600) | bin span=1h time |chart limit=0 count over time by UserAgent | eval time=strftime(time, "%x %X")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I believe UTC&amp;gt;PST = 10hrs = 3600*10 (please verify)&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2016 19:32:41 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-09-13T19:32:41Z</dc:date>
    <item>
      <title>How to build a timechart from a specific field and convert it from UTC to PST?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276315#M83331</link>
      <description>&lt;P&gt;Hello Splunk Masters,&lt;/P&gt;

&lt;P&gt;The search query I have built out works great, but due to the amount of requests hitting us, Splunk can get backed up and post a bunch of logs all at once which causes a manufactured spike in my chart. &lt;/P&gt;

&lt;P&gt;I would love to work around this by building a timetable off of a custom time field (BeginRequest-UTC) and converting it to PST. This way we're able to see when the requests are hitting our IIS services and accurately monitor when spikes are generated. I also need to be able to break it down by UserAgent as well to determine which user agents are sending successful responses and unsuccessful responses.&lt;/P&gt;

&lt;P&gt;The below query is what I'm using to look at successful IIS responses broken down by UserAgent.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=iis_logs http_status!=40* http_status!=5* | timechart count by UserAgent 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help is appreciated!&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Evan&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 19:25:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276315#M83331</guid>
      <dc:creator>evanleair</dc:creator>
      <dc:date>2016-09-13T19:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a timechart from a specific field and convert it from UTC to PST?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276316#M83332</link>
      <description>&lt;P&gt;Try this&lt;BR /&gt;
&lt;STRONG&gt;&lt;EM&gt;UPDATED&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=iis_logs http_status!=40* http_status!=5* | eval time=strptime(BeginRequest-UTC, "%Y-%m-%d %H:%M:%S.%3N") |  eval time=time+(10*3600) | bin span=1h time |stats count by time UserAgent | eval time=strftime(time, "%x %X")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;OR&lt;/EM&gt;&lt;/STRONG&gt;*&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=iis_logs http_status!=40* http_status!=5* | eval time=strptime(BeginRequest-UTC, "%Y-%m-%d %H:%M:%S.%3N") | eval time=time+(10*3600) | bin span=1h time |chart limit=0 count over time by UserAgent | eval time=strftime(time, "%x %X")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I believe UTC&amp;gt;PST = 10hrs = 3600*10 (please verify)&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 19:32:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276316#M83332</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-13T19:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a timechart from a specific field and convert it from UTC to PST?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276317#M83333</link>
      <description>&lt;P&gt;What type of field would I put in for "USE APPROPRIATE MODIFIERS HERE"? An example value I would get would be: 2016-09-13 19:55:09.503, and when I adjust the query to be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=iis_logs http_status!=40* http_status!=5* | eval time=strptime(BeginRequest-UTC, "earliest=-15m") | eval time=time+(7*3600) | bin span=1h time |chart limit=0 count over time by UserAgent | eval time=strftime(%x %X)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=iis_logs http_status!=40* http_status!=5* | eval time=strptime(BeginRequest-UTC, " %H:%M:%S") | eval time=time+(7*3600) | bin span=1h time |chart limit=0 count over time by UserAgent | eval time=strftime(%x %X)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get this error: Error in 'eval' command: The arguments to the 'strptime' function are invalid.&lt;/P&gt;

&lt;P&gt;What can be done to get around that?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 20:01:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276317#M83333</guid>
      <dc:creator>evanleair</dc:creator>
      <dc:date>2016-09-13T20:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a timechart from a specific field and convert it from UTC to PST?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276318#M83334</link>
      <description>&lt;P&gt;Try the updated query&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 20:07:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276318#M83334</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-13T20:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a timechart from a specific field and convert it from UTC to PST?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276319#M83335</link>
      <description>&lt;P&gt;I'm running the updated query and am still getting the same error. Any other ideas? Thanks so much in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 20:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276319#M83335</guid>
      <dc:creator>evanleair</dc:creator>
      <dc:date>2016-09-13T20:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a timechart from a specific field and convert it from UTC to PST?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276320#M83336</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; The error is in the second eval statement. I have corrected it now.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 20:43:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-timechart-from-a-specific-field-and-convert-it/m-p/276320#M83336</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-13T20:43:18Z</dc:date>
    </item>
  </channel>
</rss>

