Reporting

How to subtract Total Amount to  WithdrawRequest to total Amount of  DepositRequest?

Kisame27
Explorer

How to subtract Total Amount to  WithdrawRequest to total Amount of  DepositRequest 

Result=WithdrawRequest-DepositRequest 

Kisame27_0-1649683321953.png

 

Labels (2)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Kisame27,

sorry but I don't understand, could you share your result and indicate which field you want to add to which other field?

Ciao.

Giuseppe

0 Karma

Kisame27
Explorer

For Example : i have  three Column 

transactiontype      Amount       CostumerName

DP                                        20               Tom

WD                                      30               Tom

DP                                       10                Elen

WD                                      15               Elen

DP                                        50              Tom

....                                           ...                 ....

....                                           ....                ....

i want to get:    Result  as Table For Tom= Sum(Dep) -Sum(WD)   Tom= 70-30=40

                                                     Elen=  Sum(Dep) -Sum(WD)   Elen= 10-15=-5

 

Result as Table  With 4 columns

    DP    WD         CostumerName  Result

   70         30           Tom                        40

   10          15          Elen                        -5

   ...                          ....                             .....

    ....                         ....                            .....

 

thanks for Helping 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Kisame27,

if the transactiontype are always the same (DP or WD), you could run something like this:

| your_search
| stats sum(eval(if(transactiontype="WD",Amount,0))) AS WD sum(eval(if(transactiontype="DP",Amount,0))) AS DP BY CostumerName
| eval Result=DP-WD

Ciao.

Giuseppe

 

Kisame27
Explorer

You are Very Good Person, Thanks For Helping  😍

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Kisame27,

you're welcome, it's a pleasure.

Please accept the answer for the other people of Community.

Ciao and happy splunking.

Giuseppe

Kisame27
Explorer

cs_uri_query="*DepositRequest*" OR cs_uri_query="*WithdrawRequest*"

| rex "Amount\':(?<amount>[^+]+)"
| rex "CustomerId\':(?<GUID>[^+]+)"
|rex "ProviderName\':(?<provider>[^+]+)"
| search GUID = '3f55310a-2f17-476c-a28b-0d50c444b03f'

================================================================

 

DepositRequest="{'ProviderName':'Vazisubani'+'BrandName':'Betsmarket'+'CustomerId':'3f55310a-2f17-476c-a28b-'+'Amount':0.00+'TransactionId'

 

WithdrawRequest="{'ProviderName':'Vazisubani'+'BrandName':'BestMarket'+'CustomerId':'3f55310a-2f17-476c-a28b'+'Amount':175.0+'TransactionId':'625314d6a230ee62325ed373'

 

 i want to get  Table with new column which was created by me 

 CustomerId                                                DepositRequest    WithdrawRequest             Result

 3f55310a-2f17-476c-a28b                     0.00                             175                                   -175

 

 

Tags (1)
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...