<?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 write this query in Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/639269#M221505</link>
    <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt;&amp;nbsp;said, the sample search is a start. &amp;nbsp;You may want to study this guide:&amp;nbsp;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/SQLtoSplunk" target="_blank" rel="noopener"&gt;Splunk SPL for SQL users&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Sat, 08 Apr 2023 06:52:18 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2023-04-08T06:52:18Z</dc:date>
    <item>
      <title>How to write this query in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/638759#M221320</link>
      <description>&lt;P&gt;This is application insight query which i need to write in splunk , can some one help me please&lt;/P&gt;
&lt;P&gt;let a=traces&lt;BR /&gt;| where cloud_RoleInstance startswith "sams-card-account-update"&lt;BR /&gt;| where message contains "Received Message from CAU:"&lt;BR /&gt;| parse message with * "clientReqId='" clientReqId "', status=" * "resultReason='" resultReason "', message" *&lt;BR /&gt;| project clientReqId, timestamp, resultReason&lt;BR /&gt;| parse clientReqId with personId "_" paymentInstrumentId "_retry-" retry "_" epoch&lt;BR /&gt;| project responseDate = bin(timestamp,1d),personId, paymentInstrumentId, retry, requestDate = bin(unixtime_milliseconds_todatetime(tolong(epoch)),1d), resultReason&lt;BR /&gt;| where resultReason !in ("AU202","AU203","AU401","AU501","Z999")&lt;BR /&gt;| distinct requestDate, personId, paymentInstrumentId, responseDate, resultReason&lt;BR /&gt;| summarize receivedCount = count() by requestDate, responseDate;&lt;BR /&gt;let b=customEvents&lt;BR /&gt;| where cloud_RoleInstance startswith "sams-card-account-update"&lt;BR /&gt;| where name == "CAU_UPDATE_REQUEST"&lt;BR /&gt;| extend personId = tostring(customDimensions.personId)&lt;BR /&gt;| extend paymentInstrumentId = tostring(customDimensions.paymentInstrumentId)&lt;BR /&gt;| project requestDate = bin(timestamp,1d), personId, paymentInstrumentId&lt;BR /&gt;| distinct requestDate, personId, paymentInstrumentId&lt;BR /&gt;| summarize requestedCount = count() by requestDate;&lt;BR /&gt;a | join kind=inner b on requestDate&lt;BR /&gt;| project requestDate, responseDate, requestedCount, receivedCount&lt;BR /&gt;| project received_perc = receivedCount / todouble(requestedCount) * 100, responseDate, requestDate=substring(requestDate,0,10)&lt;BR /&gt;| sort by requestDate asc,responseDate asc&lt;BR /&gt;| render timechart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this is how the data look like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{"kubernetes":{"labels":{"version":"v1","app":"card-account-update"},"pod_name":"card-account-update-5c4b875dc6-t7kzx","host":"stage-a6-vmss0003is","namespace_name":"n1497934467"},"time":"2023-03-25T09:05:16.023813003Z","log":{"timestamp":"2023-03-25T09:05:16.023Z","type":"trace","context":"default","thread":"org.springframework.kafka.KafkaListenerEndpointContainer#0-11-C-1","logger":"com.t.cau.integration.impl.CAUConsumer","level":"INFO","message":"Received Message from BST: BSTResponse{inquiryValue='20042341056', clientId='BSTclub.com', clientReqId='99f50c8e-4800-42af-b7ea-ccc9bf0a5349-4b40-9eea-aabfd0affec7_retry-2_1679735115331', status='ERROR', result='ERROR', resultReason='AU501', message='Unknown Error encountered', instrumentMap={xref=com.BST.payment.cau.integration.model.InstrumentInfo@6c3ad85}}"},"cluster_id":"wus-stage-a6"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 17:23:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/638759#M221320</guid>
      <dc:creator>Anidy21</dc:creator>
      <dc:date>2023-04-06T17:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to write this query in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/639128#M221447</link>
      <description>&lt;P&gt;Here is a start:&lt;BR /&gt;&lt;BR /&gt;|makeresults&lt;BR /&gt;| eval _raw="{\"kubernetes\":{\"labels\":{\"version\":\"v1\",\"app\":\"card-account-update\"},\"pod_name\":\"card-account-update-5c4b875dc6-t7kzx\",\"host\":\"stage-a6-vmss0003is\",\"namespace_name\":\"n1497934467\"},\"time\":\"2023-03-25T09:05:16.023813003Z\",\"log\":{\"timestamp\":\"2023-03-25T09:05:16.023Z\",\"type\":\"trace\",\"context\":\"default\",\"thread\":\"org.springframework.kafka.KafkaListenerEndpointContainer#0-11-C-1\",\"logger\":\"com.t.cau.integration.impl.CAUConsumer\",\"level\":\"INFO\",\"message\":\"Received Message from BST: BSTResponse{inquiryValue='20042341056', clientId='BSTclub.com', clientReqId='99f50c8e-4800-42af-b7ea-ccc9bf0a5349-4b40-9eea-aabfd0affec7_retry-2_1679735115331', status='ERROR', result='ERROR', resultReason='AU501', message='Unknown Error encountered', instrumentMap={xref=com.BST.payment.cau.integration.model.InstrumentInfo@6c3ad85}}\"},\"cluster_id\":\"wus-stage-a6\"}"&lt;BR /&gt;|kv&lt;BR /&gt;```| search cloud_RoleInstance = "sams-card-account-update*" AND message = "*Received Message from CAU:*"```&lt;BR /&gt;| rex field=log.message "clientReqId='(?&amp;lt;clientReqId&amp;gt;.*?)', status=.*?resultReason='(?&amp;lt;resultReason&amp;gt;.*?)', message"&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 01:06:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/639128#M221447</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2023-04-07T01:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to write this query in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/639141#M221451</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is what my requirement and this is what i am getting as result of your query .please help me how will i get the desired result.Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Requirement&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-04-07 at 8.55.54 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24830iA32E76E9A7DFCE7F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-04-07 at 8.55.54 AM.png" alt="Screenshot 2023-04-07 at 8.55.54 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; Result from your query&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-04-07 at 8.56.07 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24831iF2BCD53B8CA3D49F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-04-07 at 8.56.07 AM.png" alt="Screenshot 2023-04-07 at 8.56.07 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; This is the index from which i need to fetch the records&amp;nbsp;&lt;/P&gt;&lt;P&gt;index="BTS-card-account-update"&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 03:33:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/639141#M221451</guid>
      <dc:creator>Anidy21</dc:creator>
      <dc:date>2023-04-07T03:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to write this query in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/639269#M221505</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt;&amp;nbsp;said, the sample search is a start. &amp;nbsp;You may want to study this guide:&amp;nbsp;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/SQLtoSplunk" target="_blank" rel="noopener"&gt;Splunk SPL for SQL users&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Apr 2023 06:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/639269#M221505</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-04-08T06:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to write this query in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/639392#M221538</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;Noooo! Don't point people to this dreadful document. I know that writers of that guide meant well but it's filled with bad practices and encourages users to write bad searches.&lt;/P&gt;&lt;P&gt;That guide should have a big red warning at the top "This is &lt;EM&gt;not &lt;/EM&gt;how you should write SPL; you can use it for a one-off quickie but generally - don't write like that!"&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 17:20:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/639392#M221538</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-04-10T17:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to write this query in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/639417#M221549</link>
      <description>&lt;P&gt;I'll provide a friendly op-ed: &lt;EM&gt;Do&lt;/EM&gt; read&amp;nbsp;&lt;EM&gt;Splunk SQL for SQL Users&lt;/EM&gt; if you're familiar with relational databases and SQL-like languages and need a Splunk primer. The example searches aren't optimal; however, the SELECT through ORDER BY examples provide the foundation for most general search use cases. (Use the &lt;EM&gt;where&lt;/EM&gt; Splunk search command to compare two fields directly.) TRUNCATE and DELETE probably shouldn't have been included as the Splunk &lt;EM&gt;delete&lt;/EM&gt; search command doesn't do the same thing. The examples using the &lt;EM&gt;join&lt;/EM&gt; and &lt;EM&gt;append&lt;/EM&gt; Splunk search commands are arguably anti-patterns, but do use them if they help you make sense of the problem you're trying to solve; you can optimize your searches after you have the correct outputs in hand for comparison.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 19:37:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/639417#M221549</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2023-04-10T19:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to write this query in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/640725#M221993</link>
      <description>&lt;P&gt;Please help me with the exact query for my result i tried after reading but not able to get the desired result .&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 04:59:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/640725#M221993</guid>
      <dc:creator>Anidy21</dc:creator>
      <dc:date>2023-04-20T04:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to write this query in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/640728#M221995</link>
      <description>&lt;P&gt;As I and others said, the best way to get concrete help is to forget everything about SQL. &amp;nbsp;Instead, simply describe your use case. &amp;nbsp;What is it that you are trying to achieve? &amp;nbsp;Illustrate and explain data (anonymize as needed), explain and illustrate desired output, and describe, explain a logic connection between data and output. &amp;nbsp;Untangle complex SQL is unreasonable burden for volunteers here.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 05:19:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-this-query-in-Splunk/m-p/640728#M221995</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-04-20T05:19:16Z</dc:date>
    </item>
  </channel>
</rss>

