We have updated our Terms of Service, Code of Conduct, and Addendum.

Using HMSET to update Redis

Are the available Redis commands in the dropdown list or should I go by the complete list at the URL provided when I hover over the ‘?’?

I’m trying to set multiple values for a hash and I’m having trouble grabbing the key-value pairs from my event to send. I’m not sure if it’s a limitation or I’m doing something incorrectly. I’m using ‘__e’ to grab the entire event (Args section) and specifying a key. The Command section allows me to put in hmset.

Best Answer

  • Brendan Dalpe
    Brendan Dalpe Posts: 201 mod
    edited July 2023 Answer ✓

    No, only the commonly used commands are listed in the dropdown. The Cribl Stream Redis function supports all available commands, you just need to type them into the command box.

    For HMSET, youll want to use something like this:

    The full args look like this:

    ['key1', key1, 'key2', key2, 'key3', key3]
    

    For purposes of this example, field1, field2, and field3 have already been extracted, but you can reference any field with the dot notation.

    Those values are now available in Redis!

Answers

  • dmtrs
    dmtrs Posts: 5
    edited March 2023

    I must've missed that part about only listing commonly used commands.

    This worked for me, thanks.

  • Brendan Dalpe
    Brendan Dalpe Posts: 201 mod
    edited July 2023 Answer ✓

    No, only the commonly used commands are listed in the dropdown. The Cribl Stream Redis function supports all available commands, you just need to type them into the command box.

    For HMSET, youll want to use something like this:

    The full args look like this:

    ['key1', key1, 'key2', key2, 'key3', key3]
    

    For purposes of this example, field1, field2, and field3 have already been extracted, but you can reference any field with the dot notation.

    Those values are now available in Redis!