Knowledge Management

convert memk() function usage

kannu
Communicator

Hello All ,

Greetings

 

I am looking for perfect explanation of memk() function used with convert statement , how it works and where to pass the m,g,k (The letter k indicates kilobytes, m indicates megabytes, and g indicates gigabytes) .

when i am trying this function to convert kb to KB , i am not seeing any change in values . Please help 

index=_internal source="*metric*" |convert memk(kb) as KB |table kb , KB

 

kannu_0-1720176545437.png

 

Thanks

Manish Kumar

 

 

 

Labels (1)
Tags (3)
0 Karma
1 Solution

isoutamo
SplunkTrust
SplunkTrust

Hi

this seems to work.

| makeresults
| eval gb=1, gb=gb . "g"
| convert memk(gb) as kb_c
| eval kb=round(kb_c/1024/1024,2)

Destination will be always as KB.

r. Ismo 

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

What difference are you expecting? Are you trying to say that in your example kb is 1000 based and you want to convert to 1024 based. That is not what memk does. In this case just do

| eval KB=round(kb/1.024,3)

If they are both 1024 based, then they are the same number, so memk will not do anything.

 

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

this seems to work.

| makeresults
| eval gb=1, gb=gb . "g"
| convert memk(gb) as kb_c
| eval kb=round(kb_c/1024/1024,2)

Destination will be always as KB.

r. Ismo 

Get Updates on the Splunk Community!

What's New in Splunk Enterprise 9.4: Features to Power Your Digital Resilience

Hey Splunky People! We are excited to share the latest updates in Splunk Enterprise 9.4. In this release we ...

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...

SignalFlow: What? Why? How?

What is SignalFlow? Splunk Observability Cloud’s analytics engine, SignalFlow, opens up a world of in-depth ...