<?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: Need to find query from mobile(Android, IOS) device in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477892#M192771</link>
    <description>&lt;P&gt;thanks for your updated query but can't see the logs data associated with log and moble table.&lt;/P&gt;

&lt;P&gt;For reference attached screenshot. &lt;IMG src="http://Screenshot+2020-01-13+at+4.33.23+PM" alt="alt text" /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jan 2020 11:06:23 GMT</pubDate>
    <dc:creator>sinha58</dc:creator>
    <dc:date>2020-01-13T11:06:23Z</dc:date>
    <item>
      <title>Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477888#M192767</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am new in Splunk, Looking for result which is coming from Android and IOS devices, seeing android and IOS query in logs but need to count, How many queries are coming from such devices, so can easily make a dashboard for same. &lt;/P&gt;

&lt;P&gt;if you guys suggest that query, it would be a great help for me. &lt;/P&gt;

&lt;P&gt;Here it is logs below for reference which showing a result for android devices.&lt;/P&gt;

&lt;P&gt;"{"cluster_id":"sc-a2","log":"11.16.39.12 - - [10/Jan/2020:10:05:48 +0000] \"GET /so/search?cat_id=1255027787111_1255027789273&amp;amp;client=us_gr&amp;amp;hd=false&amp;amp;ht=false&amp;amp;offset=10&amp;amp;page=1&amp;amp;prg=android&amp;amp;ps=30&amp;amp;sort=best_match&amp;amp;stores=1197"&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
ss&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:34:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477888#M192767</guid>
      <dc:creator>sinha58</dc:creator>
      <dc:date>2020-09-30T03:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477889#M192768</link>
      <description>&lt;P&gt;sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="{\"cluster_id\":\"sc-a2\",\"log\":\"11.16.39.12 - - [10/Jan/2020:10:05:48 +0000] \"GET /so/search?cat_id=1255027787111_1255027789273&amp;amp;client=us_gr&amp;amp;hd=false&amp;amp;ht=false&amp;amp;offset=10&amp;amp;page=1≺g=android&amp;amp;ps=30&amp;amp;sort=best_match&amp;amp;stores=1197\""
| rex "(?&amp;lt;mobile&amp;gt;(?&amp;lt;=g=).+?(?=&amp;amp;))"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;recommend:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=np_search-be1559690845 kubernetes.container_name=reso-og stream=stdout
| rex "(?&amp;lt;mobile&amp;gt;(?&amp;lt;=g=).+?(?=&amp;amp;))" 
| rex "\[(?&amp;lt;time&amp;gt;\d{2}/\w{3}/\d{4}:\d{2}:\d{2}:\d{2} \+0000)\]"
| eval time=strptime(time,"%d/%b/%Y:%T %z")
| spath 
| eval log = mvindex(split(log," "),0)
| fieldformat time=strftime(time,"%c")
| table time cluster_id log mobile
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi,  &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/35290"&gt;@sinha58&lt;/a&gt; &lt;BR /&gt;
If you can identify the string, you can extract in this way.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Explanation:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt; regex: cf. &lt;A href="http://regex101.com" target="_blank"&gt;regex101.com&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;spath&lt;/CODE&gt;: extract JSON, &lt;EM&gt;cluster_id&lt;/EM&gt; and &lt;EM&gt;log&lt;/EM&gt; objects.&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;mvindex&lt;/CODE&gt;: extract IP address(split spaces)&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;fieldformat&lt;/CODE&gt;: change time(UNIX epoch)  to readable. 
  The reason I don't use &lt;CODE&gt;strftime&lt;/CODE&gt; is that UNIX time is just fine for future aggregations.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Splunk Search Processing Language (SPL) is processed in order.&lt;BR /&gt;
please try one by one line and check result.&lt;/P&gt;

&lt;P&gt;cf. &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Commandsbycategory" target="_blank"&gt;SearchReference/Commands by category&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:34:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477889#M192768</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-09-30T03:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477890#M192769</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt; for your response, I appreciated it.  &lt;/P&gt;

&lt;P&gt;Here it is my query:- &lt;BR /&gt;
"index=np_search-be1559690845 kubernetes.container_name=reso-og stream=stdout"&lt;/P&gt;

&lt;P&gt;Result:- "{"cluster_id":"sc-a2","log":"11.16.39.12 - - [10/Jan/2020:10:05:48 +0000] \"GET /so/search?cat_id=1255027787111_1255027789273&amp;amp;client=us_gr&amp;amp;hd=false&amp;amp;ht=false&amp;amp;offset=10&amp;amp;page=1≺g=android&amp;amp;ps=30&amp;amp;sort=best_match&amp;amp;stores=1197"&lt;/P&gt;

&lt;P&gt;Can you advise me on the above query to filter Android devices? I need to count how many queries are coming from Android and IOS.&lt;/P&gt;

&lt;P&gt;I will be waiting for your response. Thank you again for your kind reply.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:46:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477890#M192769</guid>
      <dc:creator>sinha58</dc:creator>
      <dc:date>2020-09-30T03:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477891#M192770</link>
      <description>&lt;P&gt;HI, @shinha58&lt;BR /&gt;
my answer is updated, please check it.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 07:02:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477891#M192770</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-13T07:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477892#M192771</link>
      <description>&lt;P&gt;thanks for your updated query but can't see the logs data associated with log and moble table.&lt;/P&gt;

&lt;P&gt;For reference attached screenshot. &lt;IMG src="http://Screenshot+2020-01-13+at+4.33.23+PM" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 11:06:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477892#M192771</guid>
      <dc:creator>sinha58</dc:creator>
      <dc:date>2020-01-13T11:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477893#M192772</link>
      <description>&lt;P&gt;please provide sample log and your_result.&lt;BR /&gt;
I can't see the screenshot.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 11:12:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477893#M192772</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-13T11:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477894#M192773</link>
      <description>&lt;P&gt;Hi @to4kawa, thanks for your updated query, Could you please explain to me briefly those queries to understand. thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2020 09:44:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477894#M192773</guid>
      <dc:creator>sinha58</dc:creator>
      <dc:date>2020-01-20T09:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477895#M192774</link>
      <description>&lt;P&gt;HI, @sinha58 &lt;BR /&gt;
my answer is updated, Happy splunking.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2020 11:12:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477895#M192774</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-20T11:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477896#M192775</link>
      <description>&lt;P&gt;good explanation in brief @to4kawa, thank you so much for your valuable response. Is there any good way to learn Splunk other than Splunk doc.  &lt;/P&gt;

&lt;P&gt;Have a nice day man!!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 10:27:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477896#M192775</guid>
      <dc:creator>sinha58</dc:creator>
      <dc:date>2020-01-22T10:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477897#M192776</link>
      <description>&lt;P&gt;In my case, I run the queries of Splunk answers line by line and check the result of the command.&lt;BR /&gt;
Some people write cool SPL.&lt;/P&gt;

&lt;P&gt;Happy Splunking.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 10:58:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477897#M192776</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-22T10:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477898#M192777</link>
      <description>&lt;P&gt;Hi @to4kawa, Need one more question on this query, would like to add time on my dashboard? So I can easily co-relate my logs timestamp value. Could you please suggest to me ?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 09:28:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477898#M192777</guid>
      <dc:creator>sinha58</dc:creator>
      <dc:date>2020-01-23T09:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477899#M192778</link>
      <description>&lt;P&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/8160iF3908B5E4EDE7D67/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 09:29:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477899#M192778</guid>
      <dc:creator>sinha58</dc:creator>
      <dc:date>2020-01-23T09:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477900#M192779</link>
      <description>&lt;P&gt;@to4kawa if you can see the above graph as per your query, It's perfect except timestamp value.  need to add a timestamp for the same. waiting for your suggestions&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 09:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477900#M192779</guid>
      <dc:creator>sinha58</dc:creator>
      <dc:date>2020-01-23T09:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477901#M192780</link>
      <description>&lt;P&gt;x-axis: _time&lt;BR /&gt;
y-axis: mobile&lt;BR /&gt;
right?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 09:49:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477901#M192780</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-23T09:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477902#M192781</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; ....
 | table time cluster_id log mobile
 | rename time as _time
 | timechart count by mobile
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @sinha58 &lt;BR /&gt;
How about this?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 09:58:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477902#M192781</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-23T09:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477903#M192782</link>
      <description>&lt;P&gt;@to4kawa, thanks for your reply, I have tried but queries coming from devices are not shown as earlier. so it's not an ideal way to look at the graf and identify. Attached the screenshot for that added query.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 13:18:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477903#M192782</guid>
      <dc:creator>sinha58</dc:creator>
      <dc:date>2020-01-23T13:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477904#M192783</link>
      <description>&lt;P&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/8161iDB186E6B871781E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 13:27:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477904#M192783</guid>
      <dc:creator>sinha58</dc:creator>
      <dc:date>2020-01-23T13:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477905#M192784</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; index=np_search-be1559690845 kubernetes.container_name=reso-og stream=stdout
 | rex "(?&amp;lt;mobile&amp;gt;(?&amp;lt;=g=).+?(?=&amp;amp;))" 
 | rex "\[(?&amp;lt;time&amp;gt;\d{2}/\w{3}/\d{4}:\d{2}:\d{2}:\d{2} \+0000)\]"
 | eval time=strptime(time,"%d/%b/%Y:%T %z")
 | spath 
 | eval log = mvindex(split(log," "),0)
 | fieldformat time=strftime(time,"%c")
 | table time cluster_id log mobile
 | rename time as _time
 | timechart count by mobile
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;your result is by this query?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 13:36:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477905#M192784</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-23T13:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477906#M192785</link>
      <description>&lt;P&gt;Here it is the query which is working fine,  I had only only "| stats count by mobile" with your updated queries. &lt;/P&gt;

&lt;P&gt;index=np_search-be1559690845 kubernetes.container_name=reso-og stream=stdout | rex "(?(?&amp;lt;=g=).+?(?=&amp;amp;))" &lt;BR /&gt;
 | rex "[(?\d{2}/\w{3}/\d{4}:\d{2}:\d{2}:\d{2} +0000)]"&lt;BR /&gt;
 | eval time=strptime(time,"%d/%b/%Y:%T %z")&lt;BR /&gt;
 | spath &lt;BR /&gt;
 | eval log = mvindex(split(log," "),0)&lt;BR /&gt;
 | fieldformat time=strftime(time,"%c")&lt;BR /&gt;
 | table time cluster_id log mobile | stats count by mobile&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:54:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477906#M192785</guid>
      <dc:creator>sinha58</dc:creator>
      <dc:date>2020-09-30T03:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find query from mobile(Android, IOS) device</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477907#M192786</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=np_search-be1559690845 kubernetes.container_name=reso-og stream=stdout | rex "(?(?&amp;lt;=g=).+?(?=&amp;amp;))"
| rex "[(?\d{2}/\w{3}/\d{4}:\d{2}:\d{2}:\d{2} +0000)]"
| eval time=strptime(time,"%d/%b/%Y:%T %z")
| spath
| eval log = mvindex(split(log," "),0)
| fieldformat time=strftime(time,"%c")
| table time cluster_id log mobile 
| table time mobile
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;viz &amp;gt; line chart&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 17:49:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-find-query-from-mobile-Android-IOS-device/m-p/477907#M192786</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-23T17:49:53Z</dc:date>
    </item>
  </channel>
</rss>

