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
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...